You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Class DefaultAttributeConverterProvider throws IndexOutOfBoundException when using the List class. This for the TableSchema builder.
If I have a List<String> field in the class:
private List<String> faceMatchErrors;
Then for the TableSchema.builder():
.addAttribute(List.class, a ->
a.name("faceMatchErrors").getter(Transaction::getFaceMatchErrors).setter(Transaction::setFaceMatchErrors))
Expected Behavior
This should return the (AttributeConverter<T>) ListAttributeConverter.create(innerConverter) for the List<String> field.
Current Behavior
This throws:
Caused by: java.lang.IndexOutOfBoundsException: Index: 0
at java.base/java.util.Collections$EmptyList.get(Collections.java:4483)
at software.amazon.awssdk.enhanced.dynamodb.DefaultAttributeConverterProvider.findConverterInternal(DefaultAttributeConverterProvider.java:163)
at software.amazon.awssdk.enhanced.dynamodb.DefaultAttributeConverterProvider.findConverter(DefaultAttributeConverterProvider.java:143)
at software.amazon.awssdk.enhanced.dynamodb.DefaultAttributeConverterProvider.converterFor(DefaultAttributeConverterProvider.java:135)
This is caused by line 163 in DefaultAttributeConverterProvider
.addAttribute(List.class, a ->
a.name("faceMatchErrors").getter(Transaction::getFaceMatchErrors).setter(Transaction::setFaceMatchErrors)
.attributeConverter( (AttributeConverter) ListAttributeConverter.create(StringAttributeConverter.create())) )
Based on the default provider code, this has to be done automatically.
Additional Information/Context
I'm not using annotations due to introspection problems and compatibility with Micronaut and GraalVM. Using the TableSchema.fromClass(Transaction.class) gets this field right without problems.
AWS Java SDK version used
2.17.271
JDK version used
openjdk version "11.0.15"
Operating System and version
Linux
The text was updated successfully, but these errors were encountered:
Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
Similar to #2296
Class
DefaultAttributeConverterProvider
throwsIndexOutOfBoundException
when using theList
class. This for theTableSchema
builder.If I have a
List<String>
field in the class:Then for the
TableSchema.builder()
:Expected Behavior
This should return the
(AttributeConverter<T>) ListAttributeConverter.create(innerConverter)
for theList<String>
field.Current Behavior
This throws:
This is caused by line 163 in
DefaultAttributeConverterProvider
Since
rawClassParameters
is anEmpty List
.Reproduction Steps
Just create a table schema builder with a
List.class
attribute.Possible Solution
I had to manually create the
AttributeConverter
Based on the default provider code, this has to be done automatically.
Additional Information/Context
I'm not using annotations due to introspection problems and compatibility with Micronaut and GraalVM. Using the
TableSchema.fromClass(Transaction.class)
gets this field right without problems.AWS Java SDK version used
2.17.271
JDK version used
openjdk version "11.0.15"
Operating System and version
Linux
The text was updated successfully, but these errors were encountered: