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

S2333 supports redundant modifiers on nested interfaces and classes

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.9
    • Component/s: Rules
    • Labels:
      None

      Description

      Nested interface modifiers are redundant:

      • when nested in an interface, public and static are redundant
      • when nested in a class, static is redundant
      public interface Foo {
          public static interface Baz {}  // public, static redundant 
          public static final class InnerClass {}  // public, static redundant 
      }
      public class Bar {
          public static interface Baz {}  // static redundant 
          public static final class InnerClass {}  // nothing redundant 
      }
      

      We should extend S2333 to reports such cases.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: