Repository navigation
Bugfix/5589 DynamoDB immutable getters introspection for underscores and dollar sign issue - #7510
Open
iulianbudau wants to merge 2 commits into
Open
iulianbudau wants to merge 2 commits into
iulianbudau wants to merge 2 commits into
Conversation
This branch has not been deployed
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
TableSchema.fromClass/ immutable schema creation fails for Lombok-style@DynamoDbImmutablemodels when a field such as__encryption_keyIdproduces getterget__encryption_keyId()and fluent builder__encryption_keyId(...).ImmutableIntrospectoronly stripped agetprefix when the next character was uppercase, so the property key stayedget__encryption_keyIdand did not match the builder. The equivalent@DynamoDbBeanpath already maps the attribute as__encryption_keyIdvia JavaBeans introspection.Fixes #5589.
Modifications
ImmutableIntrospector.normalizeGetterName, thegetbranch also strips when the character aftergetis_or$, preserving existing lowercasing/suffix behavior (getId→id,getURL→uRL,getfoo→getfoo).get_/get$getters only, fall back to the original getter name if no valid normalized builder exists (legacy pairing). OrdinarygetX/isXstripping does not use that fallback.normalizeSetterName, theisbranch, discovery, ignore/transient handling, and unmatched/leftover validation behavior are unchanged aside from using the resolved property name._and$, ambiguous both-builders, andgetURL/getfoo; schema round-trips viaitemToMap/mapToItemplus a@DynamoDbBeancontrol for attribute__encryption_keyId.Testing
Tests added
ImmutableIntrospectorTestImmutableLeadingUnderscoreAttributeTest(normalized/legacy_and$schema round-trips; bean control)Test Coverage Matrix
TableSchema.fromBean(UnderscoreBean.class)inImmutableLeadingUnderscoreAttributeTest; focused + module tests passed.TableSchema.fromClass(same immutable introspection path);fromImmutableClassnot invoked explicitly.ImmutableIntrospectornaming.Screenshots (if appropriate)
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