[
https://issues.apache.org/jira/browse/GROOVY-9636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17156175#comment-17156175
]
Paul King commented on GROOVY-9636:
-----------------------------------
It was done for various Java integration reasons, e.g. so that Java classes can
extend Groovy classes in various scenarios. See GROOVY-8495 and the various
related linked issues. Typically it relates back to {{GroovyObject}} being in
the inheritance hierarchy, so Java would expect to be able to have access to
all that interface's methods but won't find them if they are synthetic. We have
marked all such methods with {{@Internal}}, so the sandbox app should look for
that annotation instead of synthetic. The {{@Internal}} annotation has been
back-ported to 2.5, so cross version workarounds should be possible.
We may also provide an annotation in the future which would allow the
{{GroovyObject}} interface to be dropped (see
https://github.com/apache/groovy/pull/54). If we go ahead with this, it would
likely not be before Groovy 4.
> Inconsistent behaviour of isSynthetic between Groovy version 2.* and 3.*
> ------------------------------------------------------------------------
>
> Key: GROOVY-9636
> URL: https://issues.apache.org/jira/browse/GROOVY-9636
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 3.0.4
> Reporter: Dmitriy Neretin
> Priority: Major
>
> Following steps are needed to reproduce the issue:
> * Checkout [https://github.com/dimarzio/groovy_sandbox]
> * Current groovy dependency in the project build file is 3.0.4
> * Run the App class
> ** Which obtains a class literal, takes a getMetaClass method and executes
> isSynthetic() on it
> * isSynthetic() returns false, which is not right (at least my assumption!)
> and leads to the failed assertion
> * Now, change the groovy version in the build.gradle to 2.5.8
> * Run the App class again
> * isSynthetic() returns true, which is right, assertion will be passed
> The problem described above leads to problems in the reflection-based bean
> processors like in the AWS DynamoDB SDK. The processor for example recognizes
> getMetaClass as a DynamodDB table property and tries to convert it as a
> proper table property.
> But there are theoretically infinite amount of other problems.
> Java version: OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.7+10)
>
> Current workaround - Groovy version 2.* can be used.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)