Inspectopedia Help

Result of object allocation ignored

Reports object allocations where the allocated object is ignored and neither assigned to a variable nor used in another way.

Such allocation expressions are legal in Java, but are usually either unintended, or evidence of a very odd object initialization strategy.

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.

ResultOfObjectAllocationIgnored
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 | Probable bugs

Use the options to list classes whose allocations should be ignored by this inspection.

Inspection options

Here you can find the description of settings available for the Result of object allocation ignored inspection, and the reference of their default values.

Ignored classes

Empty

Availability

By default bundled with

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin

Java, 241.18072

Last modified: 18 June 2024