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

Incorrect byte code produced, error "groovy.lang.MissingPropertyException: No such property: param0"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • None
    • None
    • None
    • None
    • Grails 2.0 RC1/2/3 Mac OS X Lion, Java 1.6.0_29

    Description

      Since upgrading to Grails 2 which brings a newer release of groovy compared to grails 1.3.7 we started getting the error:

      groovy.lang.MissingPropertyException: No such property: param0
      

      ...inside some of our tests.

      If you look at the code causing this:

      https://github.com/jCatalog/weceem-plugin/blob/master/grails-app/domain/org/weceem/content/WcmContent.groovy#L254

      ... you can see there is code copying "this" to a local var "c" and then on the line that fails "this.ident()" is used. This causes the "bad bytecode". If you change it to "c.ident()" it works.

      "But how can reproduce this?!" I hear you ask enthusiastically.

      The answer: https://github.com/jCatalog/weceem-plugin

      Check out the code, then grails test-app using Grails 2 RC2 or higher.

      Open the test reports in ./target/test-reports/html/index.html

      Many tests fail due to other changes in Grails, but the test you are interested in is "SecurityServiceTests"

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            marc@anyware.co.uk Marc Palmer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: