From 547efe024e4ba74280c4dbfed23ad8782ca8d02d Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Sat, 23 Jun 2012 23:14:24 -0700 Subject: j3dcore: annotate some priviledged actions with return types Signed-off-by: Harvey Harrison --- .../share/javax/media/j3d/MasterControl.java | 76 ++++++++++------------ 1 file changed, 35 insertions(+), 41 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 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() { + 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() { + 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() { + 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() { + 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() { + public InputDeviceBlockingThread run() { + synchronized (rootThreadGroup) { + InputDeviceBlockingThread thread = new InputDeviceBlockingThread( + rootThreadGroup, device); + thread.setPriority(threadPriority); + return thread; + } + } + }); } /** -- cgit v1.2.3