mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
20 lines
962 B
HTML
20 lines
962 B
HTML
<html>
|
|
<body>
|
|
Reports construction of sorted collections, for example <code>TreeSet</code>, that rely on natural ordering,
|
|
whose element type doesn't implement the <code>Comparable</code> interface.
|
|
<p>It's unlikely that such a collection will work properly.</p>
|
|
<p>
|
|
A false positive is possible if the collection element type is a non-comparable super-type,
|
|
but the collection is intended to only hold comparable sub-types. Even if this is the case,
|
|
it's better to narrow the collection element type or declare the super-type as <code>Comparable</code> because the mentioned approach is error-prone.
|
|
</p>
|
|
<!-- tooltip end -->
|
|
<p>
|
|
The inspection also reports cases when the collection element is a type parameter which is not declared as <code>extends Comparable</code>.
|
|
You can suppress the warnings on type parameters using the provided option (for example, to keep the API compatibility).
|
|
</p>
|
|
<p>
|
|
<small>New in 2018.3</small>
|
|
</p>
|
|
</body>
|
|
</html> |