Repository navigation
feat: model and render fields and constructors in nested types (#487) - #488
Merged
AndreasIgel merged 3 commits intoDec 5, 2026
Merged
Conversation
…helpers#487) - NestedTypeDto gains classFields and constructors, with the full builder helper set on NestedTypeDtoBuilder (element-adds, consumers, varargs consumers, wholesale replacement) - Roaster renders fields and constructors for nested classes; nested interfaces skip both since Java interfaces cannot declare constructors and their fields are implicitly constants - tests: rendering of nested fields/constructors, interface exclusion, builder helper coverage
devin-ai-integration Bot
added a commit
to igel-devin-ai/simple-builders-devin-fork
that referenced
this pull request
Dec 4, 2026
- nested-type validation now recurses into fields and constructors, not just methods (model support added in java-helpers#487/java-helpers#488) - nested interfaces declaring constructors or fields are rejected: constructors are impossible in interfaces, fields are implicit constants and cannot be generated as declared
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
devin-ai-integration Bot
added a commit
to igel-devin-ai/simple-builders-devin-fork
that referenced
this pull request
Dec 5, 2026
- nested-type validation now recurses into fields and constructors, not just methods (model support added in java-helpers#487/java-helpers#488) - nested interfaces declaring constructors or fields are rejected: constructors are impossible in interfaces, fields are implicit constants and cannot be generated as declared
AndreasIgel
pushed a commit
that referenced
this pull request
Dec 5, 2026
* feat: validate generation targets before rendering (#465) Extends and moves GenerationTargetValidator into codegen-core (org.javahelpers.codegen.validation): duplicate parameter names, duplicate method/constructor signatures (erasure-aware via JavaSignatures), duplicate field names, nested-type collisions, simple-name collisions of referenced types, reserved words and illegal identifiers. Collects all violations into one exception. Stacked on java-signature-erasure: the signature calculation is split into its own PR. * fix: validate static import collisions and reuse field validation - validateFields takes the field list so it can be reused for nested type validation - static imports are checked for member-name collisions across different owners * feat: validate nested-type members and interface-kind restrictions - nested-type validation now recurses into fields and constructors, not just methods (model support added in #487/#488) - nested interfaces declaring constructors or fields are rejected: constructors are impossible in interfaces, fields are implicit constants and cannot be generated as declared * refactor: validate on instance state instead of threaded parameters The static entry point now creates a validator instance holding the collected violations, the validation context and the type-variable bounds, so the private validation methods no longer repeat targetName and violations in every signature. Nested-type recursion scopes context and type-variable bounds with save/restore. --------- Co-authored-by: Andreas Igel <Andreas.Igel@gmx.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Implements #487:
NestedTypeDtocan now carry fields and constructors, and Roaster renders them.NestedTypeDtogainsclassFieldsandconstructorslists with getters/adders, mirroring whatGenerationTargetClassDtoalready modelsNestedTypeDtoBuildergains the full helper set for both (element-adds, single/plural consumers, wholesale replacement), consistent with the existing collection conventionsNotes
GenerationTargetValidator— wiring it there is a trivial follow-up once feat: validate generation targets before rendering (#465) #479 is merged, sincevalidateFields/validateConstructorsalready take plain lists. Tracked in NestedTypeDto: model and generate fields and constructors for nested types #487.Tests
RoasterCodeGeneratorTest: nested class renders field + constructor; nested interface renders neitherNestedTypeDtoBuilderTest: consumer/varargs/copy coverage for the new helpers (5 new tests)