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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.6-rc-1
    • 1.6-rc-2, 1.5.8, 1.7-beta-1
    • None
    • None
    • 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

      Attachments

        Activity

          People

            roshandawrani Roshan Dawrani
            cityhall Chris Currivan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: