Repository navigation
Fix nested simple-name import collisions - #480
igel-devin-ai wants to merge 10 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Strict reviewchanges needed Reviewed head
Verification
Other-PR integration review
Recheck at
|
| # | Original finding (short) | Status | Remaining action |
|---|---|---|---|
| 1 | Collision winner loses generic owner | fixed | — |
| 2 | Mapper/collector public API change | accepted as breaking change — announced in #466 | Add the breaking-change PR label. |
| 3 | Generated-source text-block convention | partially fixed — nit | Convert remaining snippets (BuilderProcessorTest.java:756,792,825). |
| N1 | Generic-member test lacks collision | open — minor | Add the second other2.Inner DTO property/accessors (BuilderProcessorTest.java:797–825); retain zero-warning assertion. |
Build: Java 17 module install — BUILD SUCCESS; 1,379 tests, 0 failures/errors; all three real-collision probes have zero warnings; example compile succeeds without tracked drift.
Recheck at 367ca1f1 (2026-12-06)
Verdict: minor changes
| Severity | What is missing | Where (file:line) |
|---|---|---|
| note | Suggest breaking-change label; CollidingSimpleNames API accepted and announced in #466. |
RoasterMapper.java:62; ImportCollector.java:398 |
| nit | Remaining generated-source snippets are ordinary strings, not text blocks. | BuilderProcessorTest.java:756,792,828 |
Even when the nested declaration wins its simple-name collision, the owner arguments cannot come from imports: Outer<String>.Inner must stay qualified. Rendering plain Inner produced raw types and unchecked warnings (or improper formed type errors for generic members).
|
Strict review, finding 1 fixed in 8137915: collision-winning nested types now keep their generic owner qualification — Still open here: finding 2 (the |
…ions hasGenericOwner now requires actual type arguments: extracted types wrap even non-generic owners as raw TypeNameGeneric, which wrongly sent collision winners down the owner-qualified path and rendered other.Outer.Inner despite the import. Compile regressions with -Xlint:rawtypes -Xlint:unchecked verify zero warnings for the generic-owner and generic-member winner shapes.
|
Strict-review leftovers done:
Still open here: finding 2 — the |
The winner test now carries a second property typed as the colliding other2.Inner, so the collision actually exists; zero-warning assertion retained and passing
|
Recheck N1 done: the generic-member test now declares a second property typed |
|
Recheck finding 3 verified done: the cited line numbers are from the recheck-time commit and have shifted since, but sweeping the whole file there is no concatenated or escaped source snippet left in |
…on set, constructor comment CollidingSimpleNames extends AbstractSet without overriding equals — implemented consistent with the Set contract (collision names only; winner metadata is derived state). Empty constructor documents its purpose
|



Summary
Fixes #466.
Nested types now participate in collision detection by their innermost simple name, including legacy
TypeNamerepresentations such asOuter.Inner. Collision resolution tracks the lexicographically first type as the simple-name winner, matching the deterministic sorted-import behavior already used by Roaster.When a nested type wins that collision,
RoasterMappernow emits its innermost simple name instead of a fully qualified name. The colliding top-level type remains fully qualified, so generated builders compile without ambiguous or wrong imports. Regression coverage includes a processor compile test withother.Outer.Innerandother2.Innerin the same DTO.mvn clean verifypasses.