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

The print statement overrides parent print methods

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-5
    • 1.0-JSR-1
    • parser
    • None

    Description

      Base.java:
      public abstract class Base extends Base2
      {
      }

      Base2.java:
      public class Base2
      {
      public void print(Object out)

      { System.out.println("Base:"+out); }

      }

      Simple.groovy
      class Simple extends Base
      {
      static void main(args)

      { simple = new Simple() simple.process() }

      void process()

      { print("ok") }

      }

      prints out "ok" instead of "Base:ok"

      Trying with Simple.java:
      public class Simple extends Base
      {
      public static void main(String[] args)

      { Simple simple = new Simple(); simple.process(); }

      public void process()

      { print("ok"); }

      }

      behaves correctly

      Attachments

        Issue Links

          Activity

            People

              blackdrag Jochen Theodorou
              gbevin Geert Bevin
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: