From 267f859834bbbe3febd64feb53bfbd243e43382e Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Mon, 1 Jul 2013 14:25:32 -0700 Subject: j3dcore: use Arrays.copyOf instead of clone on an int[] Signed-off-by: Harvey Harrison --- src/classes/share/javax/media/j3d/GeometryArrayRetained.java | 5 +++-- src/classes/share/javax/media/j3d/SwitchRetained.java | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/classes/share/javax/media/j3d/GeometryArrayRetained.java b/src/classes/share/javax/media/j3d/GeometryArrayRetained.java index d037c4f..f4d20fa 100644 --- a/src/classes/share/javax/media/j3d/GeometryArrayRetained.java +++ b/src/classes/share/javax/media/j3d/GeometryArrayRetained.java @@ -31,6 +31,7 @@ import java.nio.ByteBuffer; import java.nio.DoubleBuffer; import java.nio.FloatBuffer; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -1596,7 +1597,7 @@ ArrayList> morphUserLists = null; this.texCoordSetMap = null; } else { - this.texCoordSetMap = (int[])texCoordSetMap.clone(); + this.texCoordSetMap = Arrays.copyOf(texCoordSetMap, texCoordSetMap.length); } this.vertexAttrCount = vertexAttrCount; @@ -1604,7 +1605,7 @@ ArrayList> morphUserLists = null; this.vertexAttrSizes = null; } else { - this.vertexAttrSizes = (int[])vertexAttrSizes.clone(); + this.vertexAttrSizes = Arrays.copyOf(vertexAttrSizes, vertexAttrSizes.length); } this.vertexAttrStride = this.vertexAttrStride(); diff --git a/src/classes/share/javax/media/j3d/SwitchRetained.java b/src/classes/share/javax/media/j3d/SwitchRetained.java index c82d810..1a79136 100644 --- a/src/classes/share/javax/media/j3d/SwitchRetained.java +++ b/src/classes/share/javax/media/j3d/SwitchRetained.java @@ -27,6 +27,7 @@ package javax.media.j3d; import java.util.ArrayList; +import java.util.Arrays; import java.util.BitSet; /** @@ -357,7 +358,7 @@ void updateSwitchChild(int child, boolean switchOn, ArrayList updat // update setLiveState for this node s.closestSwitchParents = (SwitchRetained[]) savedClosestSwitchParents.clone(); - s.closestSwitchIndices = (int[])savedClosestSwitchIndices.clone(); + s.closestSwitchIndices = Arrays.copyOf(savedClosestSwitchIndices, savedClosestSwitchIndices.length); // Note that s.containsNodesList is updated in super.setLive // Note that s.closestSwitchIndices is updated in super.setLive -- cgit v1.2.3