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

FN S1128/UselessImportCheck: import of nested class of superclass

    XMLWordPrintable

    Details

    • Type: False Negative
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Rules
    • Labels:
      None

      Description

      package a.b;
      
      public class SuperClass {
        public enum Nested{
          something; 
        } 
      }
      
      package a.b.c;
      
      import a.b.SuperClass;
      import a.b.SuperClass.Nested; // FN, this import is useless
      
      class MyClass extends SuperClass {
        Nested getNested() {
          return Nested.something;
        }
      }
      
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              elena.vilchik Elena Vilchik
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: