Skip to content

DynamoDB enhanced TableSchema introspection fails for Lombok's getters for java.lang.Booleans #6371

Description

@yattoni

Describe the bug

I think this bug was introduced after #6349 was merged.

Bug:

@Builder(toBuilder = true)
@Data
@DynamoDbImmutable(builder = DdbItem.DdbItemBuilder.class)
public class DdbItem {
  private final Boolean isNew;
}
TableSchema.fromImmutableClass(DdbItem.class);
      Caused by:
            java.lang.IllegalArgumentException: A method was found on the immutable class that does not appear to have a matching setter on the builder class. Use the @DynamoDbIgnore annotation on the method if you do not want it to be included in the TableSchema introspection. [Method = "public java.lang.Boolean model.DdbItem.getIsNew()"]
                at software.amazon.awssdk.enhanced.dynamodb.internal.immutable.ImmutableIntrospector.generateExceptionForMethod(ImmutableIntrospector.java:134)
                at software.amazon.awssdk.enhanced.dynamodb.internal.immutable.ImmutableIntrospector.lambda$introspect$1(ImmutableIntrospector.java:87)
                at java.base/java.util.Optional.orElseThrow(Optional.java:403)
                at software.amazon.awssdk.enhanced.dynamodb.internal.immutable.ImmutableIntrospector.lambda$introspect$2(ImmutableIntrospector.java:86)
                at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
                at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
                at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
                at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
                at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
                at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
                at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
                at software.amazon.awssdk.enhanced.dynamodb.internal.immutable.ImmutableIntrospector.introspect(ImmutableIntrospector.java:93)
                at software.amazon.awssdk.enhanced.dynamodb.internal.immutable.ImmutableIntrospector.getImmutableInfo(ImmutableIntrospector.java:65)
                at software.amazon.awssdk.enhanced.dynamodb.mapper.ImmutableTableSchema.createStaticImmutableTableSchema(ImmutableTableSchema.java:204)
                at software.amazon.awssdk.enhanced.dynamodb.mapper.ImmutableTableSchema.create(ImmutableTableSchema.java:172)
                at software.amazon.awssdk.enhanced.dynamodb.mapper.ImmutableTableSchema.lambda$create$0(ImmutableTableSchema.java:140)
                at java.base/java.util.Map.computeIfAbsent(Map.java:1054)
                at java.base/java.util.Collections$SynchronizedMap.computeIfAbsent(Collections.java:2761)
                at software.amazon.awssdk.enhanced.dynamodb.mapper.ImmutableTableSchema.create(ImmutableTableSchema.java:139)
                at software.amazon.awssdk.enhanced.dynamodb.mapper.ImmutableTableSchema.create(ImmutableTableSchema.java:161)
                at software.amazon.awssdk.enhanced.dynamodb.TableSchema.fromImmutableClass(TableSchema.java:164)

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Table schema gets made as it did before that PR

Current Behavior

Fails initializing the table schema

Reproduction Steps

See above

Possible Solution

I was able to resolve it by putting @Getter(AccessLevel = NONE) on the fields and defining my own getters that don't start with get: public Boolean isNew() but that means it's a breaking change. The inspector needs to be fixed.

Edit: this may not have resolved it as I think I have to get the generated builder method to also match this new getter....

Additional Information/Context

No response

AWS Java SDK version used

2.32.25 2025-08-18

JDK version used

17

Operating System and version

AL2

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.dynamodb-enhancedpotential-regressionMarking this issue as a potential regression to be checked by team member

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions