diff options
author | Harvey Harrison <[email protected]> | 2012-03-05 10:46:40 -0800 |
---|---|---|
committer | Harvey Harrison <[email protected]> | 2012-03-05 10:46:40 -0800 |
commit | 3470738aa142bbc0330ed16f543f80ad4e75bfda (patch) | |
tree | a3130625160fd34cdd3a2c973a211323b737d4bb | |
parent | bd7b118718284396c8bf6b0613a3843689410309 (diff) |
j3dcore: annotate PhysicalEnvironment static hashmap
Signed-off-by: Harvey Harrison <[email protected]>
-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: |