diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/lombok/eclipse/handlers/HandleLog.java | 5 | ||||
-rw-r--r-- | src/core/lombok/javac/handlers/HandleLog.java | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleLog.java b/src/core/lombok/eclipse/handlers/HandleLog.java index 3dc9536d..7a140193 100644 --- a/src/core/lombok/eclipse/handlers/HandleLog.java +++ b/src/core/lombok/eclipse/handlers/HandleLog.java @@ -88,6 +88,11 @@ public class HandleLog { if (loggerTopic != null && loggerTopic.trim().isEmpty()) loggerTopic = null; if (framework.getDeclaration().getParametersWithTopic() == null && loggerTopic != null) { annotationNode.addError(framework.getAnnotationAsString() + " does not allow a topic."); + loggerTopic = null; + } + if (framework.getDeclaration().getParametersWithoutTopic() == null && loggerTopic == null) { + annotationNode.addError(framework.getAnnotationAsString() + " requires a topic."); + loggerTopic = ""; } ClassLiteralAccess loggingType = selfType(owner, source); diff --git a/src/core/lombok/javac/handlers/HandleLog.java b/src/core/lombok/javac/handlers/HandleLog.java index 5f0f8c90..522f8576 100644 --- a/src/core/lombok/javac/handlers/HandleLog.java +++ b/src/core/lombok/javac/handlers/HandleLog.java @@ -79,6 +79,11 @@ public class HandleLog { if (loggerTopic != null && loggerTopic.trim().isEmpty()) loggerTopic = null; if (framework.getDeclaration().getParametersWithTopic() == null && loggerTopic != null) { annotationNode.addError(framework.getAnnotationAsString() + " does not allow a topic."); + loggerTopic = null; + } + if (framework.getDeclaration().getParametersWithoutTopic() == null && loggerTopic == null) { + annotationNode.addError(framework.getAnnotationAsString() + " requires a topic."); + loggerTopic = ""; } JCFieldAccess loggingType = selfType(typeNode); |