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

Joint compiler incorrectly assumes that subclass is a Java class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.4
    • 1.5.5, 1.6-beta-1
    • None
    • None
    • Running under JDK 5 or 6

    Description

      NoClassDefFoundError is thrown when compiling source - FooClass is a Groovy class that extends a Java class. This happens when an incremental build is done, never on a full build.

      [groovyc] Compiling 6 source files to /workspace/myproject/build/classes
      [groovyc] /workspace/myproject/com/myproject/internals/SomeClass.groovy
      [groovyc]
      /workspace/myproject/com/myproject/internals/SomeOtherClass.groovy
      [groovyc]
      /workspace/myproject/com/myproject/internals/YetAnotherClass.groovy
      [groovyc] /workspace/myproject/com/myproject/mode/FooClass.groovy
      [groovyc] /workspace/myproject/com/myproject/mode/DonkeyClass.groovy
      [groovyc] /workspace/myproject/com/myproject/mode/BarClass.groovy
      [groovyc] Exception in thread "main" java.lang.NoClassDefFoundError:
      com/myproject/mode/FooClass
      [groovyc] at java.lang.Class.getDeclaredFields0(Native Method)
      [groovyc] at java.lang.Class.privateGetDeclaredFields(Class.java:2259)
      [groovyc] at java.lang.Class.getDeclaredFields(Class.java:1715)
      [groovyc] at
      org.codehaus.groovy.ast.ClassNode.lazyClassInit(ClassNode.java:213)
      [groovyc] at
      org.codehaus.groovy.ast.ClassNode.getUnresolvedSuperClass(ClassNode.java:766)
      [groovyc] at
      org.codehaus.groovy.ast.ClassNode.getUnresolvedSuperClass(ClassNode.java:760)
      [groovyc] at
      org.codehaus.groovy.ast.ClassNode.getSuperClass(ClassNode.java:754)
      [groovyc] at
      org.codehaus.groovy.control.CompilationUnit.sortClasses(CompilationUnit.java:480)
      [groovyc] at
      org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:453)
      [groovyc] at
      org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:417)
      [groovyc] at org.codehaus.groovy.ant.Groovyc.compile(Groovyc.java:685)
      [groovyc] at org.codehaus.groovy.ant.Groovyc.execute(Groovyc.java:541)
      [groovyc] at org.codehaus.groovy.ant.Groovyc.main(Groovyc.java:841)

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            dwatson dwatson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: