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

S1604: don't report method with annotations

    Details

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

      Description

       

      return runnable -> {
      	return new Runnable() { // S1604 flagged here
      		@CustomAnnotation
      		@Override
      		public void run() {
      			// Some logic
      			runnable.run();
      		}
      	}
      };
      

      S1604 advises to replace this code by a lambda, but it is not possible due to the custom annotation. We should not report an issue when the method has an annotation other than @Override.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                quentin.jaquier Quentin Jaquier
                Reporter:
                quentin.jaquier Quentin Jaquier
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: