From 3470738aa142bbc0330ed16f543f80ad4e75bfda Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Mon, 5 Mar 2012 10:46:40 -0800 Subject: j3dcore: annotate PhysicalEnvironment static hashmap Signed-off-by: Harvey Harrison --- src/classes/share/javax/media/j3d/MasterControl.java | 7 +++---- src/classes/share/javax/media/j3d/PhysicalEnvironment.java | 7 +++++-- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/classes/share') diff --git a/src/classes/share/javax/media/j3d/MasterControl.java b/src/classes/share/javax/media/j3d/MasterControl.java index 272bcb4..a64c77d 100644 --- a/src/classes/share/javax/media/j3d/MasterControl.java +++ b/src/classes/share/javax/media/j3d/MasterControl.java @@ -2080,11 +2080,10 @@ class MasterControl { // remove all InputDeviceScheduler if this is the last View UnorderList list = new UnorderList(1, PhysicalEnvironment.class); - for (Enumeration e = PhysicalEnvironment.physicalEnvMap.keys(); + for (Enumeration e = PhysicalEnvironment.physicalEnvMap.keys(); e.hasMoreElements(); ) { - PhysicalEnvironment phyEnv = (PhysicalEnvironment) e.nextElement(); - InputDeviceScheduler sched = (InputDeviceScheduler) - PhysicalEnvironment.physicalEnvMap.get(phyEnv); + PhysicalEnvironment phyEnv = e.nextElement(); + InputDeviceScheduler sched = PhysicalEnvironment.physicalEnvMap.get(phyEnv); for (i=phyEnv.users.size()-1; i>=0; i--) { if (views.contains(phyEnv.users.get(i))) { // at least one register view refer to it. diff --git a/src/classes/share/javax/media/j3d/PhysicalEnvironment.java b/src/classes/share/javax/media/j3d/PhysicalEnvironment.java index eea58ff..63ac34a 100644 --- a/src/classes/share/javax/media/j3d/PhysicalEnvironment.java +++ b/src/classes/share/javax/media/j3d/PhysicalEnvironment.java @@ -138,9 +138,12 @@ Vector devices = new Vector(1); // Number of active view users int activeViewRef = 0; - // Hashtable that maps a PhysicalEnvironment to its InputDeviceScheduler - static Hashtable physicalEnvMap = new Hashtable(); +// Hashtable that maps a PhysicalEnvironment to its InputDeviceScheduler +static final Hashtable physicalEnvMap; +static { + physicalEnvMap = new Hashtable(); +} /** * Constructs a PhysicalEnvironment object with default parameters. * The default values are as follows: -- cgit v1.2.3