[forge-issues] [JBoss JIRA] (ROASTER-46) addAnnotation should add automatically import

George Gastaldi (JIRA) issues at jboss.org
Thu Nov 20 09:28:39 EST 2014


     [ https://issues.jboss.org/browse/ROASTER-46?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

George Gastaldi updated ROASTER-46:
-----------------------------------
    Steps to Reproduce: 
 {code:java}
@Test
    public void test()
    {
        JavaClassSource src = Roaster.create(JavaClassSource.class);

        PropertySource<JavaClassSource> propertySource =    src.addProperty(String.class, "text");

        AnnotationSource<JavaClassSource> annotationSource = propertySource.getField().addAnnotation();

        annotationSource.setName("javax.persistence.Column");

        assertEquals("Column", propertySource.getField().getAnnotation("Column").getName());
    }
{code}

  was:
 {code:java}
@Test
    public void test()
    {
        JavaClassSource src = Roaster.create(JavaClassSource.class);

        PropertySource<JavaClassSource> propertySource =    src.addProperty(String.class, "text");

        AnnotationSource<JavaClassSource> annotationSource = propertySource.getField().addAnnotation();

        annotationSource.setName("javax.persistance.Column");

        assertEquals("Column", propertySource.getField().getAnnotation("Column").getName());
    }
{code}



> addAnnotation should add automatically import
> ---------------------------------------------
>
>                 Key: ROASTER-46
>                 URL: https://issues.jboss.org/browse/ROASTER-46
>             Project: Roaster
>          Issue Type: Bug
>          Components: JDT
>    Affects Versions: 2.9.0.Final
>         Environment: Window 7 x86_64
>            Reporter: Nicolas Challut
>             Fix For: 2.x Future
>
>
> It would be nice if the AnnotationSource could automatically import the Annotation class when setName is called. Also, a {{setName(Class<? extends Annotation>)}} should be provided



--
This message was sent by Atlassian JIRA
(v6.3.8#6338)


More information about the forge-issues mailing list