Groovy
  1. Groovy
  2. GROOVY-1632

"Duplicate class definiton" error with interfaces

    Details

    • Type: Bug Bug
    • Status: 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)

      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

        Martin C. Martin created issue -
        Guillaume Delcroix made changes -
        Field Original Value New Value
        Assignee Guillaume Laforge [ guillaume ] Jochen Theodorou [ blackdrag ]
        Hide
        Jochen Theodorou added a comment -

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

        Show
        Jochen Theodorou added a comment - looks like it was a sorting problem only. (remember compile interfaces before classes...)
        Jochen Theodorou made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Fix Version/s 1.0-RC-3 [ 13116 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Mark Thomas made changes -
        Workflow jira [ 12730762 ] Default workflow, editable Closed status [ 12742580 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12968973 ] Default workflow, editable Closed status [ 12976708 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        16h 33m 1 Jochen Theodorou 02/Jan/07 11:23

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development