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

Groovy calls wrong method if they are the same name and an Array attribut

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.5.6
    • 1.5.7, 1.6-beta-2
    • syntax
    • None

    Description

      This is an example :

      public class Test{
      public Object getReturnValue(Object a, int b)

      { return "h"; }

      private Object getReturnValue(Integer a, int b,
      Object[] arr)

      { return "i"; }

      }

      if in the script we call the first method, groovy calls directly the second...

      x = new Test();
      x.getReturnValue(new Integer(1),1)

      returns "i".

      If the last arg is not an array it's ok.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            diabolick Martin Andre
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: