Inspectopedia 2025.2 Help

Deprecated API usage

Reports usages of deprecated classes, fields, and methods. A quick-fix is available to automatically convert the deprecated usage, when the necessary information can be extracted from the Javadoc of the deprecated member.

Example:

class Interesting { /** * @deprecated Use {@link #newHotness()} instead */ @Deprecated public void oldAndBusted() {} public void newHotness() {} } class ElseWhere { void x(Interesting i) { i.oldAndBusted(); // deprecated warning here } }

After the quick-fix is applied:

class Interesting { /** * @deprecated Use {@link #newHotness()} instead */ @Deprecated public void oldAndBusted() {} public void newHotness() {} } class ElseWhere { void x(Interesting i) { i.newHotness(); } }

By default, the inspection doesn't produce a warning if it's impossible or hard to avoid it. For example, the following code won't be reported:

abstract class A { //library code @Deprecated abstract void m(); } class B extends A { //project code @Override void m() { //doSmth; } }

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.

deprecation
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 maturity

Configure the inspection:

Use the options to disable this inspection inside deprecated members, overrides of abstract deprecated methods, non-static import statements, methods of deprecated classes, or same top-level classes.

Inspection options

Here you can find the description of settings available for the Deprecated API usage inspection, and the reference of their default values.

Ignore inside deprecated members

Default value:

Selected
Ignore inside non-static imports

Default value:

Selected
Ignore overrides of deprecated abstract methods from non-deprecated supers

Default value:

Selected
Ignore members of deprecated classes

Default value:

Selected
Ignore in the same outermost class

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 deprecation

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 2024.3, Qodana for JVM 2024.3,

Last modified: 18 September 2025