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

@Property causes ClassCastException in constructor

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-6, 1.0-JSR-1
    • 1.0-JSR-2
    • None
    • None
    • Windows XP, JDK 1.4.2_08, ASM 1.5.2, BEA WLS 8.1SP3, Tapestry 3.0.3

    Description

      Define a class in Groovy with:

      @Property String[] fieldNames = [ 'street1', 'street2', 'city', 'state', 'zip', 'country' ];

      GroovyClassLoader parses this successfully. However, calling Class.newInstance() will throw ClassCastException from within the Groovy object's constructor. Removing that property from the class causes the exception to go away, so I'm certain it is the cause of the problem.

      The same problem exists on 1.0-jsr-1 and 1.0-beta-6.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            phkim Kim, Pilho
            ben@jetpen.com Ben Eng
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment