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

If a class has a property and an attribute with the same name then getProperty always reruens the attribute

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-3
    • 1.0-JSR-4
    • None
    • None

    Description

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

      public String getX()

      { return "goodby"; }

      public static void main(String[] args)

      { final Test t1 = new Test(); System.out.println(InvokerHelper.getMetaClass(t1).getAttribute(t1, "x")); System.out.println(InvokerHelper.getMetaClass(t1).getProperty(t1, "x")); }

      }

      prints
      hello
      hello

      it should print
      hello
      goodby

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            tug John Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: