Inspectopedia 2025.3 Help

Empty method

Reports empty methods that can be removed.

Methods are considered empty if they are empty themselves and if they are overridden or implemented by empty methods only. Note that methods containing only comments and the super() call with own parameters are also considered empty.

The inspection ignores methods with special annotations, for example, the javax.ejb.Init and javax.ejb.Remove EJB annotations .

The quick-fix safely removes unnecessary methods.

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.

EmptyMethod
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 | JVM languages

Configure the inspection:

  • Use the Comments and javadoc count as content option to select whether methods with comments should be treated as non-empty.

  • Use the Additional special annotations option to configure additional annotations that should be ignored by this inspection.

Inspection ID: EmptyMethod

Inspection options

Here you can find the description of settings available for the Empty method inspection, and the reference of their default values.

Comments and javadoc count as content

Option ID:

commentsAreContent

Default value:

Not selected
Additional special annotations

Option ID:

EXCLUDE_ANNOS

Default value:

None

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 EmptyMethod

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.3, Qodana for JVM 2025.3,

Last modified: 03 December 2025