diff options
author | Harvey Harrison <[email protected]> | 2012-06-23 23:14:24 -0700 |
---|---|---|
committer | Harvey Harrison <[email protected]> | 2012-06-23 23:14:24 -0700 |
commit | 547efe024e4ba74280c4dbfed23ad8782ca8d02d (patch) | |
tree | e11d8b163913c9ecdf99a342c211e63099f70ace /src/classes/share | |
parent | 2363196916c21661365cdc1d445ced92385c7683 (diff) |
j3dcore: annotate some priviledged actions with return types
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src/classes/share')
-rw-r--r-- | src/classes/share/javax/media/j3d/MasterControl.java | 76 |
1 files changed, 35 insertions, 41 deletions
diff --git a/src/classes/share/javax/media/j3d/MasterControl.java b/src/classes/share/javax/media/j3d/MasterControl.java index c711588..66e482f 100644 --- a/src/classes/share/javax/media/j3d/MasterControl.java +++ b/src/classes/share/javax/media/j3d/MasterControl.java @@ -615,14 +615,12 @@ class MasterControl { // Get the maximum number of concurrent threads (CPUs) final int defaultThreadLimit = getNumberOfProcessors() + 1; - Integer threadLimit = - (Integer) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Object run() { - return Integer.getInteger("j3d.threadLimit", - defaultThreadLimit); + Integer threadLimit = java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction<Integer>() { + public Integer run() { + return Integer.getInteger("j3d.threadLimit", defaultThreadLimit); } - }); + }); cpuLimit = threadLimit.intValue(); if (cpuLimit < 1) @@ -633,13 +631,12 @@ class MasterControl { } // Get the input device scheduler sampling time - Integer samplingTime = - (Integer) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Object run() { - return Integer.getInteger("j3d.deviceSampleTime", 0); + Integer samplingTime = java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction<Integer>() { + public Integer run() { + return Integer.getInteger("j3d.deviceSampleTime", 0); } - }); + }); if (samplingTime.intValue() > 0) { InputDeviceScheduler.samplingTime = @@ -650,14 +647,13 @@ class MasterControl { // Get the glslVertexAttrOffset final int defaultGLSLVertexAttrOffset = glslVertexAttrOffset; - Integer vattrOffset = - (Integer) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Object run() { - return Integer.getInteger("j3d.glslVertexAttrOffset", - defaultGLSLVertexAttrOffset); + Integer vattrOffset = java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction<Integer>() { + public Integer run() { + return Integer.getInteger("j3d.glslVertexAttrOffset", + defaultGLSLVertexAttrOffset); } - }); + }); glslVertexAttrOffset = vattrOffset.intValue(); if (glslVertexAttrOffset < 1) { @@ -820,14 +816,14 @@ class MasterControl { return coreLoggerEnabled && coreLogger.isLoggable(level); } - private static String getProperty(final String prop) { - return (String) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Object run() { - return System.getProperty(prop); - } - }); - } +private static String getProperty(final String prop) { + return java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction<String>() { + public String run() { + return System.getProperty(prop); + } + }); +} static boolean getBooleanProperty(String prop, boolean defaultValue, @@ -924,19 +920,17 @@ class MasterControl { InputDeviceBlockingThread getInputDeviceBlockingThread( final InputDevice device) { - return (InputDeviceBlockingThread) - java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Object run() { - synchronized (rootThreadGroup) { - Thread thread = new InputDeviceBlockingThread( - rootThreadGroup, device); - thread.setPriority(threadPriority); - return thread; - } - } - } - ); + return java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction<InputDeviceBlockingThread>() { + public InputDeviceBlockingThread run() { + synchronized (rootThreadGroup) { + InputDeviceBlockingThread thread = new InputDeviceBlockingThread( + rootThreadGroup, device); + thread.setPriority(threadPriority); + return thread; + } + } + }); } /** |