Fix ignored boolean getter property mapping in DynamoDB Enhanced Client - #7356
Open
IamPritamAcharya wants to merge 2 commits into
Open
Fix ignored boolean getter property mapping in DynamoDB Enhanced Client#7356IamPritamAcharya wants to merge 2 commits into
IamPritamAcharya wants to merge 2 commits into
Conversation
Reconcile JavaBeans property descriptors when an ignored boolean isX() getter masks a valid getX()/setX() property. Fixes aws#7328
1 task
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.
Motivation and Context
BeanTableSchemarelies on the JavaBeansIntrospectorto discover bean properties. When a bean declaresconflicting getters such as:
The JavaBeans introspector gives the boolean
isA()method precedence overgetA(). Because the selected getterreturns
boolean, the introspector does not associatesetA(int)with the resulting property descriptor.If
isA()is annotated with@DynamoDbIgnore, the descriptor therefore contains the ignored boolean getter and nowriter. The enhanced client rejects that descriptor before it can discover and map the valid
getA()/setA(int)property.
Fixes #7328.
Modifications
getX()/setX()pair only when:isX()getter;@DynamoDbIgnoreorjava.beans.Transient;getX()method exists; andsetX()method exists.voidsetters and existing fluent setters returning the bean type.isX()is not ignored.@DynamoDbIgnoreandjava.beans.Transient.This is an internal mapper change and does not modify any public API.
Testing
The regression test was added before the implementation and reproduced the original failure:
The focused mapper suite passed after the fix:
./mvnw -pl :dynamodb-enhanced test -Dtest=BeanTableSchemaTestResult:
The DynamoDB Enhanced Client module and its required reactor dependencies were also validated. This included:
The affected module completed successfully.
A repository-wide
./mvnw packagebuild was attempted. It progressed to the S3 module but did not complete becausethe unrelated S3 test suite encountered WireMock and forked-JVM failures. The DynamoDB Enhanced Client was validated separately as described above.
No AWS integration-test profile was enabled, and no real AWS API calls were made.
Screenshots (if appropriate)
N/A
Types of changes
Checklist
mvn installsucceedsscripts/new-changescript and following the instructions. Commit the new file created by the script in.changes/next-releasewith your changes.License
Authored and reviewed by Pritam Acharya; AI-assisted.