mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
23 lines
727 B
HTML
23 lines
727 B
HTML
<html>
|
|
<body>
|
|
Reports suspicious calls to <code>System.arraycopy()</code>.
|
|
<p>Such calls are suspicious when:</p>
|
|
<ul>
|
|
<li>the source or destination is not of an array type
|
|
<li>the source and destination are of different types
|
|
<li>the copied chunk length is greater than <code>src.length - srcPos</code>
|
|
<li>the copied chunk length is greater than <code>dest.length - destPos</code>
|
|
<li>the ranges always intersect when the source and destination are the same array
|
|
</ul>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
void foo() {
|
|
int[] src = new int[] { 1, 2, 3, 4 };
|
|
System.arraycopy(src, 0, src, 1, 2); // warning: Copying to the same array with intersecting ranges
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>
|
|
|
|
</body>
|
|
</html> |