--- ## 🛠️ Fix ImmutablesBuilderProvider superclass handling and nested type resolution#4054
Open
ThomasHumper wants to merge 1 commit into
Open
--- ## 🛠️ Fix ImmutablesBuilderProvider superclass handling and nested type resolution#4054ThomasHumper wants to merge 1 commit into
ThomasHumper wants to merge 1 commit into
Conversation
Contributor
|
@ThomasHumper I’m not sure what issue this PR is intended to fix. Could you please add tests that reproduce the actual bug being addressed? Also, MapStruct enforces custom formatting rules via Checkstyle, so please make sure the PR passes those checks as well. Your summary description currently states:
However, that does not appear to be an actual issue, since |
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.
Here’s a clean PR description you can use:
🛠️ Fix ImmutablesBuilderProvider superclass handling and nested type resolution
Summary
This PR fixes incorrect superclass traversal and improves the resolution of Immutables-generated types in
ImmutablesBuilderProvider. It also corrects issues in constructing qualified names for nested types when resolving Immutable implementations.🔧 Changes
1. Fixed superclass lookup logic
TypeElement.getSuperclass()returns aTypeMirror, not aTypeElementAdded safe handling for:
TypeKind.NONE(e.g.java.lang.Object)DeclaredTypecasting before recursionPrevents incorrect or unsafe recursive calls in
findBuilderInfo2. Fixed immutable type resolution for nested classes
asImmutableElement()to correctly handle nested types$for nested classes3. Fixed
getTypeElementusageelementUtils.getTypeElement()is called withString(toString()result), notStringBuilder🧪 Impact
If you want, I can also format this for GitHub (with checkboxes, issue links, or conventional commits style).