DynamoDB Enhanced : Getting IndexOutOfBoundsException for missing converter
- Lingua principale
- Java
- Stelle
- 2.6k
- Fork
- 1k
- Merge medio
- 2g 9h
- PR unite (30g)
- 51
Descrizione
### 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
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.