You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Basil Peace (Jira)" <ji...@apache.org> on 2019/11/04 02:59:00 UTC

[jira] [Commented] (GROOVY-8825) CLONE - Conflict between @Generated and @Delegate

    [ https://issues.apache.org/jira/browse/GROOVY-8825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16966379#comment-16966379 ] 

Basil Peace commented on GROOVY-8825:
-------------------------------------

I have the similar issue with Gradle.

Class with method/property marked with {{@Delegate(methodAnnotations = true)}} can't be instantiated by Gradle (as task or extension), with error:
{noformat}
Caused by:
 org.gradle.internal.instantiation.ClassGenerationException: Could not generate a decorated class for class org.fidata.gradle.svgo.Svgo.
 ...
Caused by:
 java.lang.annotation.AnnotationFormatError: Duplicate annotation for class: interface groovy.transform.Generated: @groovy.transform.Generated()
 at org.gradle.internal.instantiation.AbstractClassGenerator$DisabledAnnotationValidator.validateMethod(AbstractClassGenerator.java:1186)
 at org.gradle.internal.instantiation.AbstractClassGenerator.inspectType(AbstractClassGenerator.java:255)
 at org.gradle.internal.instantiation.AbstractClassGenerator.generateUnderLock(AbstractClassGenerator.java:191)
 ... 33 more 


{noformat}
I'm not sure whether Gradle uses Groovy's code or has its own. But maybe this could help to reproduce.

> CLONE - Conflict between @Generated and @Delegate
> -------------------------------------------------
>
>                 Key: GROOVY-8825
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8825
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.5.3
>            Reporter: François Guillot
>            Priority: Major
>
> I cloned the issue to try to find a suitable test. There is now an extra guard which should prevent the problem in case I envisage.
> ORIGINAL BELOW:
> I get 
> java.lang.annotation.AnnotationFormatError: Duplicate annotation for class: interface groovy.transform.Generated: @groovy.transform.Generated()
> On a class with a field declared with @Delegate
>  
> Removing @Delegate works around the problem



--
This message was sent by Atlassian Jira
(v8.3.4#803005)