Back to Intellij Community

UnqualifiedInnerClassAccess

java/java-impl/resources/inspectionDescriptions/UnqualifiedInnerClassAccess.html

2025.3-rc-2470 B
Original Source

Reports references to inner classes that are not qualified with the name of the enclosing class.

Example:

import foo.Foo.Bar;

  class Foo {
    class Bar {}
  }

  class Baz {
    void f(Bar bar) {}
  }

After the quick-fix is applied:

class Foo {
    class Bar {}
  }

  class Baz {
    void f(Foo.Bar bar) {}
  }

Use the inspection settings to ignore references to inner classes within the same class, which therefore do not require an import.