Stop using the check style tool.
Use System.arraycopy, which is specially optimised and may be faster than your loop. That is actually a good suggestion from the check style tool.
But remember, check style warnings are only suggestions, which you are not obliged to follow.
By the way, it’s not arrayCopy. Please always use copy-and-paste as suggested here, which is more accurate (and faster) than copying error messages by hand.
Read the documentation and try it. If you still have problems, come back with what you tried and explain the problems you're having. This site is NotACodeMill (←click).
Bats fly at night, 'cause they aren't we. And if we tried, we'd hit a tree -- Ogden Nash (or should've been).
Articles by Winston can be found here
Joined: Mar 05, 2008
Actually, now that I look at what's being "copied", I don't think it's possible - you're changing the values as they're "copied", so they aren't really copied, so System.arraycopy() won't work. I suggest disabling the inspection, at least for this particular bit of code, or just ignoring it.