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

Missing line/col information when using wrong constructors

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-4
    • 1.0-RC-1
    • None
    • None

    Description

      When compiling and running this sample, you'll get an exception missing line / col information:

      import org.codehaus.groovy.runtime.InvokerHelper

      class SomeObject {
      @Property closure =

      { println this.foo }

      }

      class SomeMetaClass extends MetaClassImpl {

      Map closureProps = [:]

      SomeMetaClass(Class c)

      { super(InvokerHelper.getInstance().getMetaRegistry()) }

      void setProperty(Object object, String property, Object newValue)

      { println "setProp" closureProps[property, newValue] }

      Object getProperty(Object object, String property)

      { println "getProp" closureProps[property] }

      }

      println "new"
      def obj = new SomeObject()
      obj.metaClass = new SomeMetaClass()
      println "setting foo"
      obj.closure.foo = 345
      println "executing closure"
      obj.closure()

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            guillaume Guillaume Sauthier
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: