Skip to content

fix: never claim annotations in BuilderProcessor - #332

Merged
AndreasIgel merged 1 commit into
java-helpers:mainfrom
igel-devin-ai:devin/1791180879-never-claim-annotations
Oct 5, 2026
Merged

AndreasIgel merged 1 commit into
java-helpers:mainfrom
igel-devin-ai:devin/1791180879-never-claim-annotations

Conversation

@igel-devin-ai

Copy link
Copy Markdown
Collaborator

Summary

Fixes #331.

BuilderProcessor declares @SupportedAnnotationTypes("*") — required so user-defined @SimpleBuilder.Template meta-annotations (arbitrary names) still reach the processor — and ended process() with return true. Under annotation-processing claiming semantics that claims all annotations in the round over the wildcard supported set, starving every processor ordered after it on a shared annotation processor path: e.g. mapstruct-processor never sees @Mapper and silently generates no mappers.

process() now always returns false — simple-builders never needs to claim; a subset claim is not expressible (the boolean applies to the whole supported set). Javadoc documents the never-claim contract and the java:S3516 suppression for the intentionally constant return.

Split out of #312, where the fix surfaced while adding the MapStruct SPI integration (which itself relies on other processors still seeing their annotations).

Verification

Behavior-neutral for simple-builders itself (it claims nothing it needs back); existing processor suite unchanged.

Written by Devin

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 java-helpers#331
@sonarqubecloud

sonarqubecloud Bot commented Oct 5, 2026

Copy link
Copy Markdown

@AndreasIgel
AndreasIgel merged commit 4ca57db into java-helpers:main Oct 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BuilderProcessor claims all round annotations, starving other annotation processors on the shared path

2 participants