diff options
author | Harvey Harrison <[email protected]> | 2012-01-08 00:28:29 -0800 |
---|---|---|
committer | Harvey Harrison <[email protected]> | 2012-01-08 00:28:29 -0800 |
commit | 1eef41dcc6b25a0ec8f5ab1f148f285d17201f48 (patch) | |
tree | 9153d5bd50cac990904d549e16dc6728312de37b /src/classes/share | |
parent | 644d08af95cf6d0e008763965ac1af3cd7127f6b (diff) |
j3dcore: pass ArrayList directly to j3dQueryProps rather than a temp array
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src/classes/share')
-rw-r--r-- | src/classes/share/javax/media/j3d/Canvas3D.java | 8 | ||||
-rw-r--r-- | src/classes/share/javax/media/j3d/J3dQueryProps.java | 7 | ||||
-rw-r--r-- | src/classes/share/javax/media/j3d/VirtualUniverse.java | 12 |
3 files changed, 12 insertions, 15 deletions
diff --git a/src/classes/share/javax/media/j3d/Canvas3D.java b/src/classes/share/javax/media/j3d/Canvas3D.java index a6d54b5..0a525f5 100644 --- a/src/classes/share/javax/media/j3d/Canvas3D.java +++ b/src/classes/share/javax/media/j3d/Canvas3D.java @@ -3708,8 +3708,8 @@ public class Canvas3D extends Canvas { */ private void createQueryProps() { // Create lists of keys and values - ArrayList keys = new ArrayList(); - ArrayList values = new ArrayList(); + ArrayList<String> keys = new ArrayList<String>(); + ArrayList<Object> values = new ArrayList<Object>(); int pass = 0; // properties not associated with graphics context @@ -3852,9 +3852,7 @@ public class Canvas3D extends Canvas { values.add(nativeGraphicsRenderer); // Now Create read-only properties object - queryProps = - new J3dQueryProps((String[]) keys.toArray(new String[0]), - values.toArray()); + queryProps = new J3dQueryProps(keys, values); } diff --git a/src/classes/share/javax/media/j3d/J3dQueryProps.java b/src/classes/share/javax/media/j3d/J3dQueryProps.java index 4d33419..b4467ba 100644 --- a/src/classes/share/javax/media/j3d/J3dQueryProps.java +++ b/src/classes/share/javax/media/j3d/J3dQueryProps.java @@ -33,6 +33,7 @@ package javax.media.j3d; import java.util.AbstractMap; import java.util.AbstractSet; +import java.util.ArrayList; import java.util.Hashtable; import java.util.Iterator; import java.util.Set; @@ -52,10 +53,10 @@ class J3dQueryProps extends AbstractMap { * array of keys and the specified values. The arrays must be * the same size. */ - J3dQueryProps(String[] keys, Object[] values) { + J3dQueryProps(ArrayList<String> keys, ArrayList<Object> values) { table = new Hashtable(); - for (int i = 0; i < keys.length; i++) { - table.put(keys[i], values[i]); + for (int i = 0; i < keys.size(); i++) { + table.put(keys.get(i), values.get(i)); } } diff --git a/src/classes/share/javax/media/j3d/VirtualUniverse.java b/src/classes/share/javax/media/j3d/VirtualUniverse.java index 96bac95..b8fd79a 100644 --- a/src/classes/share/javax/media/j3d/VirtualUniverse.java +++ b/src/classes/share/javax/media/j3d/VirtualUniverse.java @@ -582,9 +582,9 @@ public Enumeration<Locale> getAllLocales() { */ public static final Map getProperties() { if (properties == null) { - // Create lists of keys and values - ArrayList keys = new ArrayList(); - ArrayList values = new ArrayList(); + // Create lists of keys and values + ArrayList<String> keys = new ArrayList<String>(); + ArrayList<Object> values = new ArrayList<Object>(); // Implementation version string is obtained from the // ImplementationVersion class. @@ -606,10 +606,8 @@ public Enumeration<Locale> getAllLocales() { keys.add("j3d.pipeline"); values.add(Pipeline.getPipeline().getPipelineName()); - // Now Create read-only properties object - properties = - new J3dQueryProps((String[]) keys.toArray(new String[0]), - values.toArray()); + // Now Create read-only properties object + properties = new J3dQueryProps(keys, values); } return properties; } |