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

S1905 raises FP on generic method return value

    XMLWordPrintable

    Details

    • Type: False-Positive
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0
    • Component/s: Rules, Semantic

      Description

      The following snippet will raise an FP on RSPEC-1905

       

      abstract class Discuss {
        
        abstract <M> M getMeta();
        
        void foo() {
          int  i = ((String) getMeta()).length(); // FP raised
        }
      }
       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              michael.gumowski Michael Gumowski
              Reporter:
              tibor.blenessy Tibor Blenessy
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: