aws / aws/aws-sdk-java-v2

DynamoDB Enhanced : Getting IndexOutOfBoundsException for missing converter

Aperta
#3,845 3 commenti 0 reazioni 1 assegnatario Rivendicata da @debora-ito Vedi su GitHub
dynamodb-enhanced feature-request p2
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:
![image](https://user-images.githubusercontent.com/15208668/226286216-04ddd7f2-fbf0-4703-9c3f-89a1822454ef.png)

### 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.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.