groovy
  1. groovy
  2. GROOVY-1058

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

    Details

    • Type: Bug Bug
    • Status: Closed 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
    • Number of attachments :
      0

      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

        Show
        blackdrag blackdrag added a comment - http://cvs.codehaus.org/changelog/groovy?cs=MAIN:blackdrag:20050913111139

          People

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

            Dates

            • Created:
              Updated:
              Resolved: