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

Property not found for GroovyRowResult in nested .with

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.2.1
    • None
    • groovy-jdk, SQL processing
    • None
    • Windows

    Description

      Within nested .with blocks, calling a method of the wrapper class fails with a missing property exception.

      Example:

      import groovy.sql.*
      
      class Foo {}
      
      class Test extends GroovyTestCase {
         void test() {
            new Foo().with {
               def result = new GroovyRowResult([:])
      
               result.with {
                  assertEquals("1:", 1, 1)
               }
            }
         }
      }
      
      new Test().test()
      

      Result:

      groovy.lang.MissingPropertyException: assertEquals
      

      Note: Remove 'new Foo().with' and the code works. Also, the code works in Groovy 1.8.

      Attachments

        Activity

          People

            Unassigned Unassigned
            bigtrose Thornton Rose
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: