Replaced Arrays.copyof with custom implementation for Java 5 compatibility.
Authored by: spasi 2011-08-13
Parent: [r3611]
Child: [r3613]