aws-sdk-java-v2 icon indicating copy to clipboard operation
aws-sdk-java-v2 copied to clipboard

DynamoDB SDK Groovy 3 compatibility

Open dimarzio opened this issue 6 years ago • 2 comments

Unfortunately the dynamodb-sdk version 1.* and also version 2.* is no longer compatible with Groovy 3.*

Describe the Feature

It would be great if the dynamodb SDK was compatible with Groovy 3.

Is your Feature Request related to a problem?

Yes. Detailed description see here: https://issues.apache.org/jira/browse/GROOVY-9636. Generally speaking it is no longer possible to model DynamoDB beans using Groovy 3.*. Because every object created in groovy environment is a subclass of GroovyObject it inherit all methods from it's parent. These are for example getMetaClass/setMetaClass properties. These methods will be recognized as a dynamodb bean property and the exception will be thrown.

Proposed Solution

The GroovyObject "internal" methods are annotated with Internal annotation. So this additional check would solve the problem. The responsibility is in the JDK 1.* the StandardBeanProperties.BeanMap#canMap class and in the SDK 2.* BeanTableSchema#isMappableProperty class

Describe alternatives you've considered

A possible workaround is to stick with the Groovy 2.* version(s).

Additional Context

No additional context. Maybe the only question: Does it make sense to introduce a hard dependency on a particular JVM language.

Your Environment

  • AWS Java SDK version used: 1.11.820 and 2.13.54
  • JDK version used: OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.7+10)
  • Operating System and version: Mac OS 10.14.6

dimarzio avatar Jul 13 '20 12:07 dimarzio

Hi @dimarzio thank you for bringing this to our attention. I transferred it to Java SDK v2 repo because it's very unlikely this change will be made in v1.

This is not high in our priority list right now, considering the requested features in the v2 backlog. If anybody is affected by this and want us to support it, please +1 the original issue to help us with prioritization.

debora-ito avatar Jul 14 '20 00:07 debora-ito

You can use the StaticTableSchema as a workaround for this until we can make the BeanTableSchema compatible with groovy (or provide a groovy-equivalent).

millems avatar Jul 21 '21 22:07 millems