Inspectopedia 2025.2 Help

Method can be made 'static'

Reports methods that can safely be made static. Making methods static when possible can reduce memory consumption and improve your code quality.

A method can be static if:

  • it is not synchronized, native or abstract,

  • does not reference any of non-static methods and non-static fields from the containing class,

  • is not an override and is not overridden in a subclass.

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.

MethodMayBeStatic
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 | Performance

Use the following options to configure the inspection:

  • Whether to report only private and final methods, which increases the performance of this inspection.

  • Whether to ignore empty methods.

  • Whether to ignore default methods in interface when using Java 8 or higher.

  • Whether to let the quick-fix replace instance qualifiers with class references in calls to methods which are made static, that is, call myClass.m() would be replaced with MyClass.m().

Inspection options

Here you can find the description of settings available for the Method can be made 'static' inspection, and the reference of their default values.

Only check 'private' or 'final' methods

Default value:

Not selected
Ignore empty methods

Default value:

Selected
Ignore 'default' methods

Default value:

Selected
Quick-fix replaces instance qualifiers with class references

Default value:

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 MethodMayBeStatic

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