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/com/jogamp/gluegen/runtime | |
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/com/jogamp/gluegen/runtime')
-rw-r--r-- | src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java | 28 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java | 8 |
2 files changed, 18 insertions, 18 deletions
diff --git a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java index 9b57a2f2d..34ab3df9e 100644 --- a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java +++ b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java @@ -72,19 +72,19 @@ public class GLNameResolver { }; - public static final boolean isGLFunction(String str) { + public static final boolean isGLFunction(final String str) { return str.startsWith("gl") || /* str.startsWith("glu") || str.startsWith("glX") || */ str.startsWith("egl") || str.startsWith("wgl") || str.startsWith("agl") || str.startsWith("cgl") ; } - public static final boolean isGLEnumeration(String str) { + public static final boolean isGLEnumeration(final String str) { return str.startsWith("GL_") || str.startsWith("GLU_") || str.startsWith("GLX_") || str.startsWith("EGL_") || str.startsWith("WGL_") || str.startsWith("AGL_") || str.startsWith("CGL_") ; } - public static final int getExtensionIdx(String[] extensions, String str, boolean isGLFunc) { + public static final int getExtensionIdx(final String[] extensions, final String str, final boolean isGLFunc) { if(isGLFunc) { for(int i = extensions.length - 1 ; i>=0 ; i--) { if( str.endsWith(extensions[i]) ) { @@ -101,11 +101,11 @@ public class GLNameResolver { return -1; } - public static final boolean isExtension(String[] extensions, String str, boolean isGLFunc) { + public static final boolean isExtension(final String[] extensions, final String str, final boolean isGLFunc) { return getExtensionIdx(extensions, str, isGLFunc)>=0; } - public static final String getExtensionSuffix(String str, boolean isGLFunc) { + public static final String getExtensionSuffix(final String str, final boolean isGLFunc) { int idx = getExtensionIdx(extensionsARB, str, isGLFunc); if(idx>=0) { return extensionsARB[idx]; @@ -117,7 +117,7 @@ public class GLNameResolver { return null; } - public static final String normalize(String[] extensions, String str, boolean isGLFunc) { + public static final String normalize(final String[] extensions, String str, final boolean isGLFunc) { boolean touched = false; for(int i = extensions.length - 1 ; !touched && i>=0 ; i--) { if(isGLFunc) { @@ -136,19 +136,19 @@ public class GLNameResolver { } return str; } - public static final String normalizeARB(String str, boolean isGLFunc) { + public static final String normalizeARB(final String str, final boolean isGLFunc) { return normalize(extensionsARB, str, isGLFunc); } - public static final boolean isExtensionARB(String str, boolean isGLFunc) { + public static final boolean isExtensionARB(final String str, final boolean isGLFunc) { return isExtension(extensionsARB, str, isGLFunc); } - public static final String normalizeVEN(String str, boolean isGLFunc) { + public static final String normalizeVEN(final String str, final boolean isGLFunc) { return normalize(extensionsVEN, str, isGLFunc); } - public static final boolean isExtensionVEN(String str, boolean isGLFunc) { + public static final boolean isExtensionVEN(final String str, final boolean isGLFunc) { return isExtension(extensionsVEN, str, isGLFunc); } - public static final String normalize(String str, boolean isGLFunc) { + public static final String normalize(final String str, final boolean isGLFunc) { if (isExtensionARB(str, isGLFunc)) { return normalizeARB(str, isGLFunc); } @@ -157,12 +157,12 @@ public class GLNameResolver { } return str; } - public static final boolean isExtension(String str, boolean isGLFunc) { + public static final boolean isExtension(final String str, final boolean isGLFunc) { return isExtension(extensionsARB, str, isGLFunc) || isExtension(extensionsVEN, str, isGLFunc); } - public static final int getFuncNamePermutationNumber(String name) { + public static final int getFuncNamePermutationNumber(final String name) { if(isExtensionARB(name, true) || isExtensionVEN(name, true)) { // no name permutation, if it's already a known extension return 1; @@ -170,7 +170,7 @@ public class GLNameResolver { return 1 + extensionsARB.length + extensionsVEN.length; } - public static final String getFuncNamePermutation(String name, int i) { + public static final String getFuncNamePermutation(final String name, int i) { // identity if(i==0) { return name; diff --git a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java index 3fb315c99..23d4fc3cf 100644 --- a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java +++ b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java @@ -43,16 +43,16 @@ public class GLProcAddressResolver implements FunctionAddressResolver { public static final boolean DEBUG = false; @Override - public long resolve(String name, DynamicLookupHelper lookup) { + public long resolve(final String name, final DynamicLookupHelper lookup) { long newProcAddress = 0; - int permutations = GLNameResolver.getFuncNamePermutationNumber(name); + final int permutations = GLNameResolver.getFuncNamePermutationNumber(name); for (int i = 0; 0 == newProcAddress && i < permutations; i++) { - String funcName = GLNameResolver.getFuncNamePermutation(name, i); + final String funcName = GLNameResolver.getFuncNamePermutation(name, i); try { newProcAddress = lookup.dynamicLookupFunction(funcName); - } catch (Exception e) { + } catch (final Exception e) { if (DEBUG) { e.printStackTrace(); } |