Inspectopedia
 
2024.3

Overwritten Map, Set, or array element

Warning
New
Last modified: 03 December 2024

Reports code that overwrites a Map key, a Set element, or an array element in a sequence of add/put calls or using a Java 9 factory method like Set.of (which will result in runtime exception).

This usually occurs due to a copy-paste error.

Example:

New in 2017.3