Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5989 Inner Class Issues
  3. GROOVY-4913

Inner class overridden setProperty() calls outer class setProperty()

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.8.0
    • None
    • Compiler
    • None

    Description

      It's all in the test case:

      class InnerClassSetPropertyBugTest extends GroovyTestCase {
          def someProperty
      
          class InnerObject {
              def someProperty
              void setProperty(String property, Object newValue) {
                  super.setProperty(property, newValue)
              }
          }
      
          void test() {
              def innerObject = new InnerObject()
      
              innerObject.someProperty = "abc"
      
              assert null == innerObject.someProperty 
              assert "abc" == someProperty
          }
      
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            mojojojo Nikita Y Volkov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: