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

    • Type: Sub-task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.8.0
    • Fix Version/s: None
    • Component/s: Compiler
    • Labels:
      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

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

              Dates

              • Created:
                Updated: