Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-4768

java stub contains "AnnotationNode" string instead of an annotation within an annotation

    Details

      Description

      My groovy method has an annotation that some hibernate users will recognize:

         @JoinTable(name = "join_table",
            inverseJoinColumns = @JoinColumn(name = "otherEntity_id"),
            joinColumns = @JoinColumn(name = "myEntity_id"))
         Set<OtherEntity> getOthers() {
            others
         }
      

      When I compile with just groovy, no problem. But in joint compilation mode, the java compiler gets confused by the appearance of a String instead of an annotation in the stub:

        [groovyc] C:\DOCUME~1\cyrus\LOCALS~1\Temp\groovy-generated-5778051423738941844-java-source\MyEntity.java:18: annotation value must be an annotation
        [groovyc] @javax.persistence.OneToMany(targetEntity=OtherEntity.class) @javax.persistence.JoinTable(inverseJoinColumns="org.codehaus.groovy.ast.AnnotationNode@d4d66b", name="join_table", joinColumns="org.codehaus.groovy.ast.AnnotationNode@149105b") public  java.util.Set<OtherEntity> getOthers() { return (java.util.Set<OtherEntity>)null;}
        [groovyc]                                                                          

      I've attached a simple ant project to reproduce this problem. (To save space, I excluded the groovy jar.)

        Attachments

        1. project.zip
          228 kB
          Laura Dean

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              lgdean Laura Dean
            • Votes:
              4 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: