From 1ae355b8e4ec376fe398cd24a9ca14431160276c Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Wed, 27 Jun 2012 00:08:58 -0700 Subject: j3dcore: annotate a list of GeometryAtoms, use ArrayList.toArray instead of a for() loop Signed-off-by: Harvey Harrison --- .../share/javax/media/j3d/BackgroundRetained.java | 56 +++++++++++----------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/src/classes/share/javax/media/j3d/BackgroundRetained.java b/src/classes/share/javax/media/j3d/BackgroundRetained.java index e3c97c4..adc471f 100644 --- a/src/classes/share/javax/media/j3d/BackgroundRetained.java +++ b/src/classes/share/javax/media/j3d/BackgroundRetained.java @@ -97,14 +97,14 @@ ArrayList lights = new ArrayList(); // list of fog nodes for background geometry ArrayList fogs = new ArrayList(); - // a list of background geometry atoms - ArrayList bgGeometryAtomList = new ArrayList(); +// a list of background geometry atoms +ArrayList bgGeometryAtomList = new ArrayList(); - // false is background geometry atoms list has changed - boolean bgGeometryAtomListDirty = true; +// false is background geometry atoms list has changed +boolean bgGeometryAtomListDirty = true; - // an array of background geometry atoms - GeometryAtom[] bgGeometryAtoms = null; +// an array of background geometry atoms +GeometryAtom[] bgGeometryAtoms = null; // Target threads to be notified when light changes // Note, the rendering env structure only get notified @@ -734,31 +734,29 @@ ArrayList fogs = new ArrayList(); VirtualUniverse.mc.processMessage(createMessage); } - void addBgGeometryAtomList(GeometryAtom geomAtom) { - bgGeometryAtomList.add(geomAtom); - bgGeometryAtomListDirty = true; - } +void addBgGeometryAtomList(GeometryAtom geomAtom) { + bgGeometryAtomList.add(geomAtom); + bgGeometryAtomListDirty = true; +} - void removeBgGeometryAtomList(GeometryAtom geomAtom) { - bgGeometryAtomList.remove(bgGeometryAtomList.indexOf(geomAtom)); - bgGeometryAtomListDirty = true; - } +void removeBgGeometryAtomList(GeometryAtom geomAtom) { + bgGeometryAtomList.remove(geomAtom); + bgGeometryAtomListDirty = true; +} - GeometryAtom[] getBackgroundGeometryAtoms() { - if (bgGeometryAtomListDirty) { - int nAtoms = bgGeometryAtomList.size(); - if (nAtoms == 0) { - bgGeometryAtoms = null; - } else { - bgGeometryAtoms = new GeometryAtom[nAtoms]; - for (int i=0; i