Uploaded image for project: 'SonarJava'
  1. SonarJava
  2. SONARJAVA-1584

Prefering method without var args first

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.11
    • Fix Version/s: 3.12
    • Component/s: Semantic
    • Labels:
      None

      Description

      class A {
         void foo(Object o) {}
      }
      
      class B extends A {
        void foo(String s, Object... o) {}
      
         void test() {
            foo(null);
            foo("");  // Those call should be resolved to the method defined in A and not the one defined in B.
         }
      }
      

        Attachments

          Activity

            People

            • Assignee:
              nicolas.peru Nicolas Peru
              Reporter:
              nicolas.peru Nicolas Peru
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: