ARTEMIS-4020 Adding check on %s or %d on log.processor

This commit is contained in:
Clebert Suconic 2022-09-28 14:15:49 -04:00 committed by clebertsuconic
parent 9873fccf74
commit 4cfc4cbb12
1 changed files with 4 additions and 0 deletions

View File

@ -473,6 +473,10 @@ public class LogAnnotationProcessor extends AbstractProcessor {
throw new IllegalArgumentException("Invalid placeholder argument {" + tupple + "} on message \'" + message + "\' as part of " + holder + "\nreplace it by {}"); throw new IllegalArgumentException("Invalid placeholder argument {" + tupple + "} on message \'" + message + "\' as part of " + holder + "\nreplace it by {}");
} }
}); });
if (message.contains("%s") || message.contains("%d")) {
throw new IllegalArgumentException("Cannot use %s or %d in loggers. Please use {} on message \'" + message + "\'");
}
} }
private static void verifyIdNotProcessedPreviously(final Integer id, final String message, final HashMap<Integer, String> processedMessages) { private static void verifyIdNotProcessedPreviously(final Integer id, final String message, final HashMap<Integer, String> processedMessages) {