Skip to content

NPE when calling hashCode() on wildcard DynamoDB EnhancedType #5890

Description

@xiangqiyan

Describe the bug

When a DynamoDB EnhancedType is created for a wildcard type or a generic type having wildcard type parameters. Calling the hashCode() method on the EnhancedType results in a NullPointerException

Regression Issue

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

Expected Behavior

The hashCode is computed successfully

Current Behavior

java.lang.NullPointerException: Cannot invoke "Object.hashCode()" because "this.rawClass" is null

Reproduction Steps

EnhancedType<Set<?>> enhancedType = new EnhancedType<Set<?>>(){};
int hashCode = enhancedType.hashCode();

Possible Solution

Add a null check here

Additional Information/Context

No response

AWS Java SDK version used

2.26.20

JDK version used

openjdk version "17.0.12"

Operating System and version

macOS Sonoma 14.5

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.p2This is a standard priority issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions