Part of #301.
Current state
The resolver only looks up a candidate builder class next to the referenced type (<Simple><builderUsageSuffix> in the same package). A builder that lives inside the referenced type itself — e.g. the common Lombok/Immutables pattern public static PersonBuilder builder() on Person — is never discovered, even though generated code could call it the same way MapStruct does.
Goal
Extend the builder search with a second candidate location, MapStruct DefaultBuilderProvider-style:
- Look for an accessible static parameterless method on the referenced type (conventionally
builder(), possibly a configurable name) returning a type that satisfies the builder contract.
- Verify that returned type against the same capability checks as the same-package candidate (empty/prefilled instantiation,
build()).
- Decide precedence when both candidates exist (e.g. in-type
builder() vs same-package XBuilder) — and whether an ambiguous in-type candidate (several matching methods) warns and skips like MapStruct.
Notes
- Keeps the contract checks from the sibling sub-tasks unchanged — only the lookup gains a second location.
- Worth deciding whether
java.*/javax.* types are excluded from this lookup (MapStruct excludes them).
Part of #301.
Current state
The resolver only looks up a candidate builder class next to the referenced type (
<Simple><builderUsageSuffix>in the same package). A builder that lives inside the referenced type itself — e.g. the common Lombok/Immutables patternpublic static PersonBuilder builder()onPerson— is never discovered, even though generated code could call it the same way MapStruct does.Goal
Extend the builder search with a second candidate location, MapStruct
DefaultBuilderProvider-style:builder(), possibly a configurable name) returning a type that satisfies the builder contract.build()).builder()vs same-packageXBuilder) — and whether an ambiguous in-type candidate (several matching methods) warns and skips like MapStruct.Notes
java.*/javax.*types are excluded from this lookup (MapStruct excludes them).