mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -1,8 +1,22 @@
|
||||
<html>
|
||||
<body>
|
||||
Reports two types of suspicious calls to <b>Collection.toArray()</b>.
|
||||
The first type is calls where the type of the specified array argument is not of the same type as the array type to which the result is casted.
|
||||
The second type is calls where the type of the specified array argument does not match the type parameter of the collection declaration.
|
||||
The first type is any calls where the type of the specified array argument is not of the same type as the array type to which the result is casted.
|
||||
Example:
|
||||
<pre><code>
|
||||
void m(List list) {
|
||||
Number[] ns = (Number[])
|
||||
list.toArray(new String[list.size()]);
|
||||
}
|
||||
</code></pre>
|
||||
The second type is any calls where the type of the specified array argument does not match the type parameter of the collection declaration.
|
||||
Example:
|
||||
<pre><code>
|
||||
void m(List<Number> list) {
|
||||
Number[] ns =
|
||||
list.toArray(new String[list.size()]);
|
||||
}
|
||||
</code></pre>
|
||||
<!-- tooltip end -->
|
||||
<p>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user