Skip to content

Fix ignored boolean getter property mapping in DynamoDB Enhanced Client - #7356

Open
IamPritamAcharya wants to merge 2 commits into
aws:masterfrom
IamPritamAcharya:fix/dynamodb-ignore-property-mapping-7328
Open

Fix ignored boolean getter property mapping in DynamoDB Enhanced Client#7356
IamPritamAcharya wants to merge 2 commits into
aws:masterfrom
IamPritamAcharya:fix/dynamodb-ignore-property-mapping-7328

Conversation

@IamPritamAcharya

@IamPritamAcharya IamPritamAcharya commented Sep 8, 2026

Copy link
Copy Markdown

Motivation and Context

BeanTableSchema relies on the JavaBeans Introspector to discover bean properties. When a bean declares
conflicting getters such as:

public int getA()
public boolean isA()
public void setA(int value)

The JavaBeans introspector gives the boolean isA() method precedence over getA(). Because the selected getter
returns boolean, the introspector does not associate setA(int) with the resulting property descriptor.

If isA() is annotated with @DynamoDbIgnore, the descriptor therefore contains the ignored boolean getter and no
writer. The enhanced client rejects that descriptor before it can discover and map the valid getA()/setA(int)
property.

Fixes #7328.

Modifications

  • Reconcile affected JavaBeans property descriptors before normal property mapping and fluent-setter enhancement.
  • Restore a getX()/setX() pair only when:
    • the introspector-selected method is a primitive-boolean isX() getter;
    • the selected getter is annotated with @DynamoDbIgnore or java.beans.Transient;
    • the descriptor has no writer;
    • a public, non-static, non-ignored getX() method exists; and
    • a public, non-static, exact-type setX() method exists.
  • Preserve ordinary void setters and existing fluent setters returning the bean type.
  • Preserve normal JavaBeans boolean getter precedence when isX() is not ignored.
  • Preserve existing behavior when the actual mapped property getter is intentionally ignored.
  • Add regression coverage for both @DynamoDbIgnore and java.beans.Transient.
  • Add the required DynamoDB Enhanced Client changelog entry.

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:

Expected attribute names: ["A"]
Actual attribute names:   []

The focused mapper suite passed after the fix:

./mvnw -pl :dynamodb-enhanced test -Dtest=BeanTableSchemaTest

Result:

Tests run: 92, Failures: 0, Errors: 0, Skipped: 0
Checkstyle violations: 0
SpotBugs findings: 0
BUILD SUCCESS

The DynamoDB Enhanced Client module and its required reactor dependencies were also validated. This included:

  • Unit tests
  • DynamoDB Local functional tests
  • Checkstyle
  • SpotBugs
  • Javadocs
  • Dependency analysis
  • Binary compatibility checks

The affected module completed successfully.

A repository-wide ./mvnw package build was attempted. It progressed to the S3 module but did not complete because
the 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

Authored and reviewed by Pritam Acharya; AI-assisted.

Reconcile JavaBeans property descriptors when an ignored boolean isX() getter masks a valid getX()/setX() property.

Fixes aws#7328
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DynamoDB Enhanced Client: @DynamoDbIgnore fails in some property mapping scenarios

1 participant