Fix custom logger when topic presence != allowance

This commit is contained in:
Adam Juraszek committed 2019-05-29 19:18:10 +02:00
1 parent 06004b933b
commit 2a98c4d1fd
2 files changed
+10

No files matched your search

@@ -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);
@@ -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);