gemmellr commented on code in PR #5303: URL: https://github.com/apache/activemq-artemis/pull/5303#discussion_r1811017624
########## artemis-log-annotation-processor/src/main/java/org/apache/activemq/artemis/logs/annotation/processor/LogAnnotationProcessor.java: ########## @@ -204,6 +208,17 @@ void validateRegexID(LogBundle bundleAnnotation, long id) { } } + void checkRetiredIDs(LogBundle bundleAnnotation, long id) { + if (bundleAnnotation.retiredIDs() != null && !bundleAnnotation.retiredIDs().isEmpty()) { + if (Arrays.stream(bundleAnnotation.retiredIDs().split(",")) + .map(String::trim) + .map(Long::valueOf) + .collect(Collectors.toList()).contains(id)) { + throw new IllegalArgumentException("Code ID " + id + " has been retired. Select a different ID."); + } + } + } Review Comment: The 'dont create repeatedly' aspect looks better, however it still doesn't do anything to indicate about the IDs it knows you cant use, which would prevent the very likely 'just try using next ID...find it is also retired' gotcha. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org For additional commands, e-mail: gitbox-h...@activemq.apache.org For further information, visit: https://activemq.apache.org/contact