You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Christopher Smith (Jira)" <ji...@apache.org> on 2022/04/05 22:19:00 UTC

[jira] [Created] (GROOVY-10571) Stub generator misses sibling classes in annotation

Christopher Smith created GROOVY-10571:
------------------------------------------

             Summary: Stub generator misses sibling classes in annotation
                 Key: GROOVY-10571
                 URL: https://issues.apache.org/jira/browse/GROOVY-10571
             Project: Groovy
          Issue Type: Bug
          Components: Stub generator / Joint compiler
    Affects Versions: 4.0.1
            Reporter: Christopher Smith


To work around [a DynamoDB SDK bug that just turned one|https://github.com/aws/aws-sdk-java-v2/issues/2347], I created an attribute converter that ignores {{MetaClass}} and an {{AnnotationCollector}} that applies it to record classes with some other usual POJO bits.

The annotation collector is in the same package as the converter-prvider Java class. Running the stub generator produces this output (line breaks added):

{code}
@groovy.transform.AnnotationCollector()
@software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean(converterProviders={IgnoreMetaClassAttributeConverterProvider,software.amazon.awssdk.enhanced.dynamodb.DefaultAttributeConverterProvider.class})
@groovy.transform.stc.POJO()
@java.lang.annotation.Retention(value=java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target(value=java.lang.annotation.ElementType.TYPE) public @interface DynamoDbRecord2{;}
{code}

Note the missing {{.class}} on the first class argument (which is not imported and is present in the same package, but is a Java file).



--
This message was sent by Atlassian Jira
(v8.20.1#820001)