aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Juraszek <Adam.Juraszek@ataccama.com>2019-05-29 19:16:19 +0200
committerAdam Juraszek <Adam.Juraszek@ataccama.com>2019-05-29 19:18:10 +0200
commit2a98c4d1fd80ff0b3181da4fe8d5f3f32f168644 (patch)
tree41c9e1a65c990bac926ed029cc43966a91037cd9
parent06004b933b6afaa58ca753c4c33e8a977f91e294 (diff)
downloadlombok-2a98c4d1fd80ff0b3181da4fe8d5f3f32f168644.tar.gz
lombok-2a98c4d1fd80ff0b3181da4fe8d5f3f32f168644.tar.bz2
lombok-2a98c4d1fd80ff0b3181da4fe8d5f3f32f168644.zip
Fix custom logger when topic presence != allowance
-rw-r--r--src/core/lombok/eclipse/handlers/HandleLog.java5
-rw-r--r--src/core/lombok/javac/handlers/HandleLog.java5
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);