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

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>