DynamoDB Enhanced : Getting IndexOutOfBoundsException for missing converter
- Dominant language
- Java
- Stars
- 2.6k
- Forks
- 1k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 51
Description
### Describe the bug
DefaultAttributeConverterProvider.findConverter(EnhancedType type) throws java.lang.IndexOutOfBoundsException: Index: 0 when cannot find a converter for Map.
### Expected Behavior
DefaultAttributeConverterProvider.findConverter(EnhancedType type) should log "No converter available for (..)" when it cannot find a converter for Map.
### Current Behavior
The method Optional> converter = this.findConverterInternal(type); cannot resolve finding the missing converter for objects of type Map. Stacktrace with error:

### Reproduction Steps
1. Create model class with @DynamoDbBean annotation.
2. Add a Map field to the created class, for example: private Map data;
3. Create the DynamoDbEnhancedAsyncClient instance, e.g:
` DynamoDbAsyncClientBuilder asyncClientBuilder = DynamoDbAsyncClient.builder();
if (endpoint != null) {
try {
asyncClientBuilder.endpointOverride(new URI("your endpoint));
} catch (Exception e) {
logger.error("Failed to setup up custom endpoint " + endpoint, e);
}
}
return DynamoDbEnhancedAsyncClient.builder()
.dynamoDbClient(asyncClientBuilder.build())
.build();
}`
4. Run the application.
### Possible Solution
_No response_
### Additional Information/Context
_No response_
### AWS Java SDK version used
2.20.27
### JDK version used
17
### Operating System and version
Mac OS Ventura 13.1
Contributor guide
Assessment
This issue has not been assessed yet.