#4000 Fix property name resolution for fluent setters whose second character is upper case#4074
Open
BK202503 wants to merge 1 commit into
Open
#4000 Fix property name resolution for fluent setters whose second character is upper case#4074BK202503 wants to merge 1 commit into
BK202503 wants to merge 1 commit into
Conversation
…second character is upper case
4 tasks
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.
Fixes #4000.
DefaultAccessorNamingStrategy.getPropertyName(...)returns the raw method name as the property name for fluent setters that do not start withset(e.g. Lombok@Builderstyle). For methods whose second character is upper case, this conflicts with how the JavaBean accessor side resolves the same property:getXNameField()XNameField(via Introspector decapitalize, both first chars upper case → kept)xNameField(...)(Lombok@Builder)xNameField(raw method name)The two property names differ, so the target field is silently skipped and a user-supplied
@Mapping(target = "xNameField", source = "XNameField")with a capitalized source is required to work around it.This PR applies the same JavaBean-style decapitalization to fluent setters:
xNameField→ capitalize first char →XNameField→decapitalize→XNameField. Ordinary fluent setters whose second character is lower case (settlementDate(...)) are unaffected (SettlementDate→settlementDate).Test
Added
Issue4000Testmodelled afterIssue1799Test, with a source class exposinggetXNameField()and a target class with a Lombok-styleBuilder.xNameField(...)fluent setter.Regression
Ran the
builder/superbuilder/_1799test suites locally (82 tests) - all passing. Full processor suite was not run locally; CI will exercise it.