Back to Intellij Community

UnnecessaryQualifierForThis

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

2025.3-rc-2503 B
Original Source

Reports unnecessary qualification of this or super.

Using a qualifier on this or super to disambiguate a code reference may easily become unnecessary via automatic refactorings and should be deleted for clarity.

Example:

class Foo {
    void foo() {}
  }

  class Bar extends Foo {
    void bar() {
      Bar.super.foo();
    }
  }

After the quick-fix is applied:

class Foo {
    void foo() {}
  }

  class Bar extends Foo {
    void bar() {
      super.foo();
    }
  }