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

Using super.propertyName gives a MissingMethodException when the property is a boolean and uses the "isPropertyName" naming convention.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.3
    • 4.0.0-rc-2
    • groovy-jdk
    • None
    • Windows 7, Java 1.6, Groovy 2.1.3

    Description

      See the following code:

      MyClass.groovy
      class MyClass extends MySuperClass {
          public static void main(String[] args) {
              new MyClass()
          }
      
          MyClass() {
              println booleanProp // prints true
              println this.booleanProp // prints true
              println super.booleanProp // MissingMethodException
          }
      }
      
      class MySuperClass {
          boolean booleanProp
      
          boolean isBooleanProp() {
              return true
          }
      }
      

      Attachments

        1. MyClass.groovy
          0.6 kB
          Brett Borchardt

        Activity

          People

            emilles Eric Milles
            bborchardt Brett Borchardt
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: