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

FP on S2637: static field should not be reported

    Details

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

      Description

      import javax.annotation.Nonnull;
      
      public final class SonarS2637 {
      
         private static final Integer STATIC_FIELD; // false positive as it is initialized in static block
      
         static {
            STATIC_FIELD = 1;
         }
      
         public SonarS2637() {
      
         }
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                christophe.zurn Christophe Zurn
                Reporter:
                nicolas.peru Nicolas Peru
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: