Inspectopedia
 
2024.3

Result of object allocation ignored

Warning
Last modified: 03 December 2024

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.

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