Inspectopedia 2025.2 Help

Unqualified static access

Reports usage of static members that is not qualified with the class name.

This is legal if the static member is in the same class, but may be confusing.

Example:

class Foo { static void foo() {} static int x; void bar() { foo(); System.out.println(x); } static void baz() { foo(); } }

After the quick-fix is applied:

class Foo { static void foo() {} static int x; void bar() { Foo.foo(); System.out.println(Foo.x); } static void baz() { Foo.foo(); } }

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

UnqualifiedStaticUsage
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | Java | Code style issues

Use the inspection settings to toggle the reporting for the following items:

  • static fields access

    void bar() { System.out.println(x); }

  • calls to static methods

    void bar() { foo(); }

    static void baz() { foo(); }

You can also configure the inspection to only report static member usage from a non-static context. In the above example, static void baz() { foo(); } will not be reported.

Inspection options

Here you can find the description of settings available for the Unqualified static access inspection, and the reference of their default values.

Ignore unqualified field accesses

Default value:

Not selected
Ignore unqualified method calls

Default value:

Not selected
Only report static access from a non-static context

Default value:

Not selected

Suppressing Inspection

You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:

//noinspection UnqualifiedStaticUsage

More detailed instructions as well as other ways and options that you have can be found in the product documentation:

Inspection Details

By default bundled with:

IntelliJ IDEA 2025.2, Qodana for JVM 2025.2,

Last modified: 18 September 2025