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

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.5.6
    • Fix Version/s: 1.5.7, 1.6-beta-2
    • Component/s: syntax
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: