Groovy
  1. Groovy
  2. GROOVY-1058

Can't set the vaule of an attribute on a superclass

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-JSR-3
    • Fix Version/s: 1.0-JSR-4
    • Component/s: None
    • Labels:
      None

      Description

      public class Test {
      public String x = "hello";

      public static void main(String[] args) {
      final Test t1 = new Test();
      final Test t2 = new Test() {}; // subclass of Test

      InvokerHelper.getMetaClass(t1).setAttribute(t1, "x", "a");
      InvokerHelper.getMetaClass(t2).setAttribute(t2, "x", "a");
      }
      }

      produces:
      Exception in thread "main" groovy.lang.MissingFieldException: No such field: x for class: Test$1
      at groovy.lang.MetaClass.setAttribute(MetaClass.java:1138)
      at Test.main(Test.java:35)

        Activity

        John Wilson created issue -
        Show
        Jochen Theodorou added a comment - http://cvs.codehaus.org/changelog/groovy?cs=MAIN:blackdrag:20050913111139
        Jochen Theodorou made changes -
        Field Original Value New Value
        Resolution Fixed [ 1 ]
        Fix Version/s 1.0-JSR-4 [ 11905 ]
        Status Open [ 1 ] Closed [ 6 ]
        Jochen Theodorou made changes -
        Assignee Dierk Koenig [ codevise ] Jochen Theodorou [ blackdrag ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Mark Thomas made changes -
        Workflow jira [ 12730204 ] Default workflow, editable Closed status [ 12742165 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12968631 ] Default workflow, editable Closed status [ 12976358 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        41m 1 Jochen Theodorou 13/Sep/05 07:48

          People

          • Assignee:
            Jochen Theodorou
            Reporter:
            John Wilson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development