Repository navigation
Resolve builders anchored inside the referenced type (#317) - #318
Merged
AndreasIgel merged 12 commits intoOct 3, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
AndreasIgel
reviewed
Oct 3, 2026
|
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.



Closes #317 — sub-task of #301.
Summary
Adds builder lookup anchored inside the referenced type itself (Lombok/Immutables/FreeBuilder shapes), before the same-package candidate lookup:
Person.PersonBuilder/Person.Builderranked before other nested names (Lombok vs FreeBuilder conventions).builder()ranks first. The factory IS the empty-instantiation path — the return type only needs an accessible no-argbuild()returningT(MapStruct'sDefaultBuilderProvidersemantics), so Lombok builders with package-private ctors qualify.ctor(T)/of(T)), a staticbuilder(T)-style method on the type, or an instance method on the value liketoBuilder()(LomboktoBuilder=true, AutoValue).BuilderInstantiationkinds:AnchorFactoryCall(anchor, method)rendersT.m(args)/T::m;ValueFactoryCall(anchor, method)rendersvalue.m()/T::mfortoBuilder().JavaLangAnalyser:findMethods/findMethodsStaticoverloads returningList<ExecutableElement>;JavaLangMapper.mapToTypeNamenow keeps the enclosing name for nested types (lib.Person.PersonBuilder).Tests
5 resolver tests: nested-type contract builder, anchored
builder()in another package, contract-rejecting anchor falls through,builder()-name preference,toBuilder()seeded path. 479 processor tests green; generated example output unchanged.Docs: class javadoc resolution-order list and CONFIGURATION.md updated.