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

S3516 FP on method with java.lang.Void return type

    Details

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

      Description

      False positive on rule :  "Methods returns should not be invariant" : 

          public Void call() throws Exception { // false positive : using early return is fine, and only one value can be returned for Void methods.
              if (a) {
                return null;
              }
              return null;
            }
      
          } 

       

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: