Groovy
  1. Groovy
  2. GROOVY-3276

Enums in 1.6-RC-1 no longer work with constructors with multiple parameters

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.6-rc-1
    • Fix Version/s: 1.6-rc-2, 1.5.8, 1.7-beta-1
    • Component/s: None
    • Labels:
      None
    • Environment:
      XP, cygwin,
      java version "1.6.0"
      Java(TM) SE Runtime Environment (build 1.6.0-b105)
      Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode)

      Description

      In 1.6 RC1 it seems to no longer be possible for an enum constructor to take more than one parameter. This works fine in 1.5.7:

      enum Foo {
      A(1,2),
      B(3,4)

      Foo(int xx, int yy)

      { x=xx y=yy }

      public int x
      public int y
      }

      Foo.A.x

      gives:

      Exception thrown: null

      java.lang.ExceptionInInitializerError

      at ConsoleScript38.class$(ConsoleScript38)

      at ConsoleScript38.$get$$class$Foo(ConsoleScript38)

      at ConsoleScript38.run(ConsoleScript38:14)

      Caused by: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: Foo(java.lang.String, java.lang.Integer, java.util.ArrayList)

      at Foo.$INIT(ConsoleScript38)

      at Foo.<clinit>(ConsoleScript38:3)

      ... 3 more

        Activity

        Chris Currivan created issue -
        Guillaume Delcroix made changes -
        Field Original Value New Value
        Fix Version/s 1.6 [ 13832 ]
        Fix Version/s 1.7-beta-1 [ 14014 ]
        Roshan Dawrani made changes -
        Assignee Roshan Dawrani [ roshandawrani ]
        Hide
        Roshan Dawrani added a comment -

        Fixed

        Show
        Roshan Dawrani added a comment - Fixed
        Roshan Dawrani made changes -
        Resolution Fixed [ 1 ]
        Fix Version/s 1.5.8 [ 14630 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Hide
        Guillaume Delcroix added a comment -

        The problem is also present in 1.6/1.7?

        Show
        Guillaume Delcroix added a comment - The problem is also present in 1.6/1.7?
        Hide
        Roshan Dawrani added a comment -

        I am not sure I understand the question. it was present on all 3 branches - 1.5.x, 1.6.x and trunk and on all 3 I have fixed and marked so.

        Show
        Roshan Dawrani added a comment - I am not sure I understand the question. it was present on all 3 branches - 1.5.x, 1.6.x and trunk and on all 3 I have fixed and marked so.
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Mark Thomas made changes -
        Workflow jira [ 12732273 ] Default workflow, editable Closed status [ 12744085 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12970114 ] Default workflow, editable Closed status [ 12977896 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        16h 32m 1 Roshan Dawrani 13/Jan/09 14:34
        Resolved Resolved Closed Closed
        9d 7h 1 Paul King 22/Jan/09 21:34

          People

          • Assignee:
            Roshan Dawrani
            Reporter:
            Chris Currivan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development