Files
openide/java/java-impl/resources/inspectionDescriptions/OverwrittenKey.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

17 lines
606 B
HTML

<html>
<body>
Reports code that overwrites a <code>Map</code> key, a <code>Set</code> element, or an array element in a sequence of
<code>add</code>/<code>put</code> calls or using a Java 9 factory method like <code>Set.of</code> (which will result in runtime exception).
<p>This usually occurs due to a copy-paste error.</p>
<p><b>Example:</b></p>
<pre><code>
map.put("A", 1);
map.put("B", 2);
map.put("C", 3);
map.put("D", 4);
map.put("A", 5); // duplicating key "A", overwrites the previously written entry
</code></pre>
<!-- tooltip end -->
<p><small>New in 2017.3</small></p>
</body>
</html>