diff options
-rw-r--r-- | src/classes/share/javax/media/j3d/MasterControl.java | 7 | ||||
-rw-r--r-- | src/classes/share/javax/media/j3d/PhysicalEnvironment.java | 7 |
2 files changed, 8 insertions, 6 deletions
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<PhysicalEnvironment> 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<InputDevice> devices = new Vector<InputDevice>(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<PhysicalEnvironment, InputDeviceScheduler> physicalEnvMap; +static { + physicalEnvMap = new Hashtable<PhysicalEnvironment, InputDeviceScheduler>(); +} /** * Constructs a PhysicalEnvironment object with default parameters. * The default values are as follows: |