From 60cce0542b37e01edddd6b0809cc9035a9e150fb Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 06:14:54 +0000 Subject: [PATCH] fix: never claim annotations in BuilderProcessor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With @SupportedAnnotationTypes("*") — required for discovering user-defined template annotations — returning true claimed every annotation of the round for this processor, starving all other processors sharing the annotation processor path (e.g. MapStruct never seeing @Mapper). process() now always returns false, with javadoc explaining the never-claim contract. Fixes #331 --- .../simple/builders/processor/BuilderProcessor.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/processor/src/main/java/org/javahelpers/simple/builders/processor/BuilderProcessor.java b/processor/src/main/java/org/javahelpers/simple/builders/processor/BuilderProcessor.java index deced551..779c2fe2 100644 --- a/processor/src/main/java/org/javahelpers/simple/builders/processor/BuilderProcessor.java +++ b/processor/src/main/java/org/javahelpers/simple/builders/processor/BuilderProcessor.java @@ -130,7 +130,15 @@ public synchronized void init(ProcessingEnvironment processingEnv) { } } + /** + * Always returns {@code false}, so this method intentionally never claims annotations (hence the + * {@code java:S3516} suppression). Claiming is all-or-nothing over the supported set and {@link + * SupportedAnnotationTypes} must stay {@code "*"} to discover user-defined template annotations; + * claiming would therefore hide every annotation in the round — including foreign ones like + * MapStruct's {@code @Mapper} — from later processors. + */ @Override + @SuppressWarnings("java:S3516") public boolean process(Set annotations, RoundEnvironment roundEnv) { if (!supportedJdk) { // Fail fast: we already emitted an error in init(); do not attempt any processing. @@ -187,7 +195,7 @@ public boolean process(Set annotations, RoundEnvironment // Reset indentation level at the end of each processing round to prevent cascading errors context.resetIndentation(); - return true; + return false; } /** Generates all Jackson modules after the last processing round and reports the metrics. */