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

Type substitution is incomplete when resolving type of method

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.5
    • Fix Version/s: 3.6
    • Component/s: Semantic
    • Labels:
      None

      Description

      When calling an inherited method from a parametrized type the type substitution is incomplete and can lead to false positive in UnusedPrivateMethod check.

      interface A extends B {}
      interface B extends C<String> {}
      interface C<T> extends D<T> {}
      interface D<E> {
        E get();
      }
      ... 
      A a;
      a.get(); // type of this expression is not properly resolved as String. 
      ...
      

        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: