groovy
  1. groovy
  2. GROOVY-1632

"Duplicate class definiton" error with interfaces

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.0-RC-2
    • Fix Version/s: 1.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows XP
      java version "1.5.0_09"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b03)
      Java HotSpot(TM) Client VM (build 1.5.0_09-b03, mixed mode, sharing)
    • Number of attachments :
      0

      Description

      In file bug16Interface.groovy put:

      interface bug16Interface { }

      In file bug16.groovy put:

      class bug16 implements bug16Interface {}

      Typing "groovy -d bug16.groovy" gives:

      $ groovy -d bug16.groovy
      Caught: java.lang.LinkageError: duplicate class definition: bug16Interface
      java.lang.LinkageError: duplicate class definition: bug16Interface
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
      at groovy.lang.GroovyClassLoader.access$300(GroovyClassLoader.java:92)
      at groovy.lang.GroovyClassLoader$ClassCollector.createClass(GroovyClassLoader.java:457)
      at groovy.lang.GroovyClassLoader$ClassCollector.onClassNode(GroovyClassLoader.java:475)
      at groovy.lang.GroovyClassLoader$ClassCollector.call(GroovyClassLoader.java:479)
      at org.codehaus.groovy.control.CompilationUnit$9.call(CompilationUnit.java:757)
      at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:932)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:478)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:306)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:275)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:221)
      at groovy.lang.GroovyShell$2.run(GroovyShell.java:230)
      at java.security.AccessController.doPrivileged(Native Method)
      at groovy.lang.GroovyShell.run(GroovyShell.java:228)
      at groovy.lang.GroovyShell.run(GroovyShell.java:173)
      at groovy.ui.GroovyMain.processOnce(GroovyMain.java:483)
      at groovy.ui.GroovyMain.run(GroovyMain.java:293)
      at groovy.ui.GroovyMain.process(GroovyMain.java:279)
      at groovy.ui.GroovyMain.main(GroovyMain.java:145)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:131)
      at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:160)

        Activity

        Guillaume Laforge made changes -
        Field Original Value New Value
        Assignee Guillaume Laforge [ guillaume ] Jochen Theodorou [ blackdrag ]
        Hide
        blackdrag blackdrag added a comment -

        looks like it was a sorting problem only. (remember compile interfaces before classes...)

        Show
        blackdrag blackdrag added a comment - looks like it was a sorting problem only. (remember compile interfaces before classes...)
        blackdrag blackdrag made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Fix Version/s 1.0-RC-3 [ 13116 ]

          People

          • Assignee:
            blackdrag blackdrag
            Reporter:
            Martin C. Martin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: