diff options
author | Sven Gothel <[email protected]> | 2014-07-03 16:21:36 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-03 16:21:36 +0200 |
commit | 556d92b63555a085b25e32b1cd55afce24edd07a (patch) | |
tree | 6be2b02c62a77d5aba81ffbe34c46960608be163 /src/jogl/classes/jogamp/opengl/ThreadingImpl.java | |
parent | a90f4a51dffec3247278e3c683ed4462b1dd9ab5 (diff) |
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type
- Change indirect accesses to static members to direct accesses (accesses through subtypes)
- Add final modifier to private fields
- Add final modifier to method parameters
- Add final modifier to local variables
- Remove unnecessary casts
- Remove unnecessary '$NON-NLS$' tags
- Remove trailing white spaces on all lines
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/ThreadingImpl.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/ThreadingImpl.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java index bf700d970..2b017e8e9 100644 --- a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java +++ b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java @@ -43,6 +43,7 @@ import javax.media.opengl.GLException; import javax.media.opengl.GLProfile; import com.jogamp.common.JogampRuntimeException; +import com.jogamp.common.util.PropertyAccess; import com.jogamp.common.util.ReflectionUtil; /** Implementation of the {@link javax.media.opengl.Threading} class. */ @@ -53,7 +54,7 @@ public class ThreadingImpl { public final int id; - Mode(int id){ + Mode(final int id){ this.id = id; } } @@ -76,10 +77,10 @@ public class ThreadingImpl { public ToolkitThreadingPlugin run() { final String singleThreadProp; { - final String w = Debug.getProperty("jogl.1thread", true); + final String w = PropertyAccess.getProperty("jogl.1thread", true); singleThreadProp = null != w ? w.toLowerCase() : null; } - ClassLoader cl = ThreadingImpl.class.getClassLoader(); + final ClassLoader cl = ThreadingImpl.class.getClassLoader(); // Default to using the AWT thread on all platforms except // Windows. On OS X there is instability apparently due to // using the JAWT on non-AWT threads. On X11 platforms there @@ -121,7 +122,7 @@ public class ThreadingImpl { Exception error=null; try { threadingPlugin = (ToolkitThreadingPlugin) ReflectionUtil.createInstance("jogamp.opengl.awt.AWTThreadingPlugin", cl); - } catch (JogampRuntimeException jre) { error = jre; } + } catch (final JogampRuntimeException jre) { error = jre; } if( Mode.ST_AWT == mode && null==threadingPlugin ) { throw new GLException("Mode is AWT, but class 'jogamp.opengl.awt.AWTThreadingPlugin' is not available", error); } @@ -201,7 +202,7 @@ public class ThreadingImpl { false). It is up to the end user to check to see whether the current thread is the OpenGL thread and either execute the Runnable directly or perform the work inside it. */ - public static final void invokeOnOpenGLThread(boolean wait, Runnable r) throws GLException { + public static final void invokeOnOpenGLThread(final boolean wait, final Runnable r) throws GLException { if(null!=threadingPlugin) { threadingPlugin.invokeOnOpenGLThread(wait, r); return; @@ -217,13 +218,13 @@ public class ThreadingImpl { } } - public static final void invokeOnWorkerThread(boolean wait, Runnable r) throws GLException { + public static final void invokeOnWorkerThread(final boolean wait, final Runnable r) throws GLException { GLWorkerThread.start(); // singleton start via volatile-dbl-checked-locking try { GLWorkerThread.invoke(wait, r); - } catch (InvocationTargetException e) { + } catch (final InvocationTargetException e) { throw new GLException(e.getTargetException()); - } catch (InterruptedException e) { + } catch (final InterruptedException e) { throw new GLException(e); } } |