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

S1170 should not raise an issue when the initializer contains "this" or "super"

    Details

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

      Description

      Rule S1170 raises a false positive when initialization is done with `this`.

      public abstract class C
      {
          private final C c = this; // FP
          private final int i = super.foo; // FP
          private final String s = "abcdef"; // Correctly raise an issue!
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                quentin.jaquier Quentin Jaquier
                Reporter:
                nicolas.harraudeau Nicolas Harraudeau (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: