From fff0ff1c13ca3b8f451da72c11002be6ec029aee Mon Sep 17 00:00:00 2001 From: AndreasIgel Date: Sat, 15 Aug 2026 10:57:46 +0200 Subject: [PATCH 01/11] Make @SimpleBuilder @Inherited to match documentation (#244) The class-level Javadoc and docs/CONFIGURATION.md implied that @SimpleBuilder is inherited by subclasses, but the annotation was not meta-annotated with @Inherited. As a result BuilderProcessor, which collects types via RoundEnvironment.getElementsAnnotatedWith(...), only produced builders for the exact type carrying @SimpleBuilder and not for unannotated subclasses. Add @Inherited to @SimpleBuilder so subclasses are treated as if they also carried the annotation, mirroring the existing behaviour of @SimpleBuilder.Template (which is already @Inherited). Update the Javadoc to document the inheritance explicitly and clarify the CONFIGURATION.md wording. @Ignore4BuilderGeneration still suppresses generation for the exact type it is placed on, so opt-outs continue to work as before. Add SimpleBuilderInheritanceTest covering direct inheritance, the opt-out interaction, and multi-level (grandchild) inheritance. Closes #244 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../core/annotations/SimpleBuilder.java | 7 + docs/CONFIGURATION.md | 2 +- .../SimpleBuilderInheritanceTest.java | 222 ++++++++++++++++++ 3 files changed, 230 insertions(+), 1 deletion(-) create mode 100644 processor/src/test/java/org/javahelpers/simple/builders/processor/SimpleBuilderInheritanceTest.java diff --git a/core/src/main/java/org/javahelpers/simple/builders/core/annotations/SimpleBuilder.java b/core/src/main/java/org/javahelpers/simple/builders/core/annotations/SimpleBuilder.java index 46bbf140..271409ba 100644 --- a/core/src/main/java/org/javahelpers/simple/builders/core/annotations/SimpleBuilder.java +++ b/core/src/main/java/org/javahelpers/simple/builders/core/annotations/SimpleBuilder.java @@ -54,6 +54,12 @@ * *

Use {@link Template} to create reusable configuration presets. * + *

This annotation is {@link Inherited}: a subclass of an annotated type is treated as if it also + * carried {@code @SimpleBuilder}, unless it is explicitly excluded via {@link + * Ignore4BuilderGeneration}. The {@link Template} meta-annotation is {@link Inherited} as well, so + * custom template annotations that are themselves {@code @Inherited} propagate to subclasses in the + * same way. + * *

Related annotations: * *