summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-07-03 16:06:47 +0200
committerSven Gothel <[email protected]>2014-07-03 16:06:47 +0200
commitdf9ff7f340a5ab4e07efc613f5f264eeae63d4c7 (patch)
tree239ae276b82024b140428e6c0fe5d739fdd686a4 /src/java/com/jogamp/common
parenteb47aaba63e3b1bf55f274a0f338f1010a017ae4 (diff)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
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/java/com/jogamp/common')
-rw-r--r--src/java/com/jogamp/common/GlueGenVersion.java4
-rw-r--r--src/java/com/jogamp/common/JogampRuntimeException.java6
-rw-r--r--src/java/com/jogamp/common/jvm/JNILibLoaderBase.java58
-rw-r--r--src/java/com/jogamp/common/net/AssetURLConnection.java2
-rw-r--r--src/java/com/jogamp/common/net/AssetURLContext.java22
-rw-r--r--src/java/com/jogamp/common/net/AssetURLStreamHandler.java4
-rw-r--r--src/java/com/jogamp/common/net/GenericURLStreamHandlerFactory.java10
-rw-r--r--src/java/com/jogamp/common/net/PiggybackURLConnection.java2
-rw-r--r--src/java/com/jogamp/common/net/URIQueryProps.java10
-rw-r--r--src/java/com/jogamp/common/net/asset/Handler.java2
-rw-r--r--src/java/com/jogamp/common/nio/AbstractBuffer.java4
-rw-r--r--src/java/com/jogamp/common/nio/Buffers.java160
-rw-r--r--src/java/com/jogamp/common/nio/CachedBufferFactory.java78
-rw-r--r--src/java/com/jogamp/common/nio/PointerBuffer.java44
-rw-r--r--src/java/com/jogamp/common/nio/StructAccessor.java68
-rw-r--r--src/java/com/jogamp/common/os/AndroidVersion.java24
-rw-r--r--src/java/com/jogamp/common/os/DynamicLibraryBundle.java26
-rw-r--r--src/java/com/jogamp/common/os/MachineDescription.java54
-rw-r--r--src/java/com/jogamp/common/os/NativeLibrary.java80
-rw-r--r--src/java/com/jogamp/common/os/Platform.java25
-rw-r--r--src/java/com/jogamp/common/util/ArrayHashSet.java54
-rw-r--r--src/java/com/jogamp/common/util/Bitstream.java2
-rw-r--r--src/java/com/jogamp/common/util/FloatStack.java18
-rw-r--r--src/java/com/jogamp/common/util/FunctionTask.java14
-rw-r--r--src/java/com/jogamp/common/util/HashUtil.java8
-rw-r--r--src/java/com/jogamp/common/util/IOUtil.java118
-rw-r--r--src/java/com/jogamp/common/util/IntBitfield.java16
-rw-r--r--src/java/com/jogamp/common/util/IntIntHashMap.java54
-rw-r--r--src/java/com/jogamp/common/util/JarUtil.java76
-rw-r--r--src/java/com/jogamp/common/util/JogampVersion.java34
-rw-r--r--src/java/com/jogamp/common/util/LFRingbuffer.java36
-rw-r--r--src/java/com/jogamp/common/util/PropertyAccess.java18
-rw-r--r--src/java/com/jogamp/common/util/ReflectionUtil.java84
-rw-r--r--src/java/com/jogamp/common/util/RunnableExecutor.java2
-rw-r--r--src/java/com/jogamp/common/util/RunnableTask.java12
-rw-r--r--src/java/com/jogamp/common/util/SecurityUtil.java16
-rw-r--r--src/java/com/jogamp/common/util/SyncedRingbuffer.java36
-rw-r--r--src/java/com/jogamp/common/util/TaskBase.java8
-rw-r--r--src/java/com/jogamp/common/util/ValueConv.java40
-rw-r--r--src/java/com/jogamp/common/util/VersionNumber.java16
-rw-r--r--src/java/com/jogamp/common/util/VersionNumberString.java4
-rw-r--r--src/java/com/jogamp/common/util/VersionUtil.java26
-rw-r--r--src/java/com/jogamp/common/util/awt/AWTEDTExecutor.java12
-rw-r--r--src/java/com/jogamp/common/util/cache/TempFileCache.java60
-rw-r--r--src/java/com/jogamp/common/util/cache/TempJarCache.java26
-rw-r--r--src/java/com/jogamp/common/util/locks/LockFactory.java4
-rw-r--r--src/java/com/jogamp/common/util/locks/SingletonInstance.java14
47 files changed, 747 insertions, 744 deletions
diff --git a/src/java/com/jogamp/common/GlueGenVersion.java b/src/java/com/jogamp/common/GlueGenVersion.java
index a20b153..f97aba6 100644
--- a/src/java/com/jogamp/common/GlueGenVersion.java
+++ b/src/java/com/jogamp/common/GlueGenVersion.java
@@ -36,7 +36,7 @@ public class GlueGenVersion extends JogampVersion {
protected static volatile GlueGenVersion jogampCommonVersionInfo;
- protected GlueGenVersion(String packageName, Manifest mf) {
+ protected GlueGenVersion(final String packageName, final Manifest mf) {
super(packageName, mf);
}
@@ -59,7 +59,7 @@ public class GlueGenVersion extends JogampVersion {
return jogampCommonVersionInfo;
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
System.err.println(VersionUtil.getPlatformInfo());
System.err.println(GlueGenVersion.getInstance());
}
diff --git a/src/java/com/jogamp/common/JogampRuntimeException.java b/src/java/com/jogamp/common/JogampRuntimeException.java
index 7298812..d33d498 100644
--- a/src/java/com/jogamp/common/JogampRuntimeException.java
+++ b/src/java/com/jogamp/common/JogampRuntimeException.java
@@ -40,19 +40,19 @@ public class JogampRuntimeException extends RuntimeException {
/** Constructs a JogampRuntimeException object with the specified detail
message. */
- public JogampRuntimeException(String message) {
+ public JogampRuntimeException(final String message) {
super(message);
}
/** Constructs a JogampRuntimeException object with the specified detail
message and root cause. */
- public JogampRuntimeException(String message, Throwable cause) {
+ public JogampRuntimeException(final String message, final Throwable cause) {
super(message, cause);
}
/** Constructs a JogampRuntimeException object with the specified root
cause. */
- public JogampRuntimeException(Throwable cause) {
+ public JogampRuntimeException(final Throwable cause) {
super(cause);
}
}
diff --git a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java
index 673300d..1f11e9e 100644
--- a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java
+++ b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java
@@ -89,7 +89,7 @@ public class JNILibLoaderBase {
private static class DefaultAction implements LoaderAction {
@Override
- public boolean loadLibrary(String libname, boolean ignoreError, ClassLoader cl) {
+ public boolean loadLibrary(final String libname, final boolean ignoreError, final ClassLoader cl) {
boolean res = true;
if(!isLoaded(libname)) {
try {
@@ -98,7 +98,7 @@ public class JNILibLoaderBase {
if(DEBUG) {
System.err.println("JNILibLoaderBase: loaded "+libname);
}
- } catch (UnsatisfiedLinkError e) {
+ } catch (final UnsatisfiedLinkError e) {
res = false;
if(DEBUG) {
e.printStackTrace();
@@ -112,7 +112,7 @@ public class JNILibLoaderBase {
}
@Override
- public void loadLibrary(String libname, String[] preload, boolean preloadIgnoreError, ClassLoader cl) {
+ public void loadLibrary(final String libname, final String[] preload, final boolean preloadIgnoreError, final ClassLoader cl) {
if(!isLoaded(libname)) {
if (null!=preload) {
for (int i=0; i<preload.length; i++) {
@@ -127,11 +127,11 @@ public class JNILibLoaderBase {
private static final HashSet<String> loaded = new HashSet<String>();
private static LoaderAction loaderAction = new DefaultAction();
- public static boolean isLoaded(String libName) {
+ public static boolean isLoaded(final String libName) {
return loaded.contains(libName);
}
- public static void addLoaded(String libName) {
+ public static void addLoaded(final String libName) {
loaded.add(libName);
if(DEBUG) {
System.err.println("JNILibLoaderBase: Loaded Native Library: "+libName);
@@ -146,7 +146,7 @@ public class JNILibLoaderBase {
setLoadingAction(new DefaultAction());
}
- public static synchronized void setLoadingAction(LoaderAction action) {
+ public static synchronized void setLoadingAction(final LoaderAction action) {
loaderAction = action;
}
@@ -162,7 +162,7 @@ public class JNILibLoaderBase {
* @throws SecurityException
* @throws URISyntaxException
*/
- /* pp */ static final boolean addNativeJarLibsImpl(Class<?> classFromJavaJar, URI classJarURI, String jarBasename, String nativeJarBasename, StringBuilder msg)
+ /* pp */ static final boolean addNativeJarLibsImpl(final Class<?> classFromJavaJar, final URI classJarURI, final String jarBasename, final String nativeJarBasename, final StringBuilder msg)
throws IOException, SecurityException, URISyntaxException
{
msg.setLength(0); // reset
@@ -223,14 +223,14 @@ public class JNILibLoaderBase {
* @param nativeJarBasename jogl-all
* @return true if the native JAR file loaded successful or were loaded already, false in case of an error
*/
- public static final boolean addNativeJarLibs(Class<?> classFromJavaJar, String nativeJarBasename) {
+ public static final boolean addNativeJarLibs(final Class<?> classFromJavaJar, final String nativeJarBasename) {
if(TempJarCache.isInitialized()) {
final StringBuilder msg = new StringBuilder();
try {
final URI classJarURI = JarUtil.getJarURI(classFromJavaJar.getName(), classFromJavaJar.getClassLoader());
final String jarName = JarUtil.getJarBasename(classJarURI);
return addNativeJarLibsImpl(classFromJavaJar, classJarURI, jarName, nativeJarBasename+"-natives-"+PlatformPropsImpl.os_and_arch+".jar", msg);
- } catch (Exception e0) {
+ } catch (final Exception e0) {
// IllegalArgumentException, IOException
System.err.println("Caught "+e0.getClass().getSimpleName()+": "+e0.getMessage()+", while "+msg.toString());
if(DEBUG) {
@@ -345,7 +345,7 @@ public class JNILibLoaderBase {
* @return true if either the 'all-in-one' native JAR or all native JARs loaded successful or were loaded already,
* false in case of an error
*/
- public static boolean addNativeJarLibs(Class<?>[] classesFromJavaJars, String singleJarMarker, String[] stripBasenameSuffixes) {
+ public static boolean addNativeJarLibs(final Class<?>[] classesFromJavaJars, final String singleJarMarker, final String[] stripBasenameSuffixes) {
if(DEBUG) {
System.err.println("JNILibLoaderBase: addNativeJarLibs0(classesFromJavaJars "+Arrays.asList(classesFromJavaJars)+", singleJarMarker "+singleJarMarker+", stripBasenameSuffixes "+(null!=stripBasenameSuffixes?Arrays.asList(stripBasenameSuffixes):"none"));
}
@@ -372,7 +372,7 @@ public class JNILibLoaderBase {
}
}
}
- } catch (Exception e0) {
+ } catch (final Exception e0) {
// IllegalArgumentException, IOException
System.err.println("Caught "+e0.getClass().getSimpleName()+": "+e0.getMessage()+", while "+msg.toString());
if(DEBUG) {
@@ -389,10 +389,10 @@ public class JNILibLoaderBase {
return ok;
}
- private static final String stripName(String name, String[] suffixes) {
+ private static final String stripName(final String name, final String[] suffixes) {
if(null != suffixes) {
for(int i=0; i<suffixes.length && null != suffixes[i]; i++) {
- int idx = name.indexOf(suffixes[i]);
+ final int idx = name.indexOf(suffixes[i]);
if(0 < idx) {
return name.substring(0, idx);
}
@@ -409,7 +409,7 @@ public class JNILibLoaderBase {
* @param cl optional ClassLoader, used to locate the library
* @return true if library loaded successful
*/
- protected static synchronized boolean loadLibrary(String libname, boolean ignoreError, ClassLoader cl) {
+ protected static synchronized boolean loadLibrary(final String libname, final boolean ignoreError, final ClassLoader cl) {
if (loaderAction != null) {
return loaderAction.loadLibrary(libname, ignoreError, cl);
}
@@ -425,7 +425,7 @@ public class JNILibLoaderBase {
* @param preloadIgnoreError if true, errors during loading the preload-libraries should be ignored
* @param cl optional ClassLoader, used to locate the library
*/
- protected static synchronized void loadLibrary(String libname, String[] preload, boolean preloadIgnoreError, ClassLoader cl) {
+ protected static synchronized void loadLibrary(final String libname, final String[] preload, final boolean preloadIgnoreError, final ClassLoader cl) {
if (loaderAction != null) {
loaderAction.loadLibrary(libname, preload, preloadIgnoreError, cl);
}
@@ -442,7 +442,7 @@ public class JNILibLoaderBase {
@Override
public Method run() {
// FIXME: remove
- final boolean usingJNLPAppletLauncher = Debug.getBooleanProperty(sunAppletLauncherProperty, true);
+ final boolean usingJNLPAppletLauncher = PropertyAccess.getBooleanProperty(sunAppletLauncherProperty, true);
Class<?> launcherClass = null;
Method loadLibraryMethod = null;
@@ -450,18 +450,18 @@ public class JNILibLoaderBase {
if (usingJNLPAppletLauncher) {
try {
launcherClass = Class.forName(sunAppletLauncherClassName);
- } catch (ClassNotFoundException cnfe) {
+ } catch (final ClassNotFoundException cnfe) {
// oops .. look like JNLPAppletLauncher doesn't exist, despite property
// this may happen if a previous applet was using JNLPAppletLauncher in the same JVM
System.err.println("JNILibLoaderBase: <"+sunAppletLauncherClassName+"> not found, despite enabled property <"+sunAppletLauncherProperty+">, JNLPAppletLauncher was probably used before");
System.setProperty(sunAppletLauncherProperty, Boolean.FALSE.toString());
- } catch (LinkageError le) {
+ } catch (final LinkageError le) {
throw le;
}
if(null != launcherClass) {
try {
loadLibraryMethod = launcherClass.getDeclaredMethod("loadLibrary", new Class[] { String.class });
- } catch (NoSuchMethodException ex) {
+ } catch (final NoSuchMethodException ex) {
if(DEBUG) {
ex.printStackTrace();
}
@@ -470,16 +470,16 @@ public class JNILibLoaderBase {
}
}
if(null==launcherClass) {
- String launcherClassName = PropertyAccess.getProperty("jnlp.launcher.class", false);
+ final String launcherClassName = PropertyAccess.getProperty("jnlp.launcher.class", false);
if(null!=launcherClassName) {
try {
launcherClass = Class.forName(launcherClassName);
loadLibraryMethod = launcherClass.getDeclaredMethod("loadLibrary", new Class[] { String.class });
- } catch (ClassNotFoundException ex) {
+ } catch (final ClassNotFoundException ex) {
if(DEBUG) {
ex.printStackTrace();
}
- } catch (NoSuchMethodException ex) {
+ } catch (final NoSuchMethodException ex) {
if(DEBUG) {
ex.printStackTrace();
}
@@ -492,7 +492,7 @@ public class JNILibLoaderBase {
customLoadLibraryMethod = loadLibraryMethod;
}
- private static void loadLibraryInternal(String libraryName, ClassLoader cl) {
+ private static void loadLibraryInternal(final String libraryName, final ClassLoader cl) {
// Note: special-casing JAWT which is built in to the JDK
int mode = 0; // 1 - custom, 2 - System.load( TempJarCache ), 3 - System.loadLibrary( name ), 4 - System.load( enumLibNames )
if (null!=customLoadLibraryMethod && !libraryName.equals("jawt")) {
@@ -503,7 +503,7 @@ public class JNILibLoaderBase {
try {
customLoadLibraryMethod.invoke(null, new Object[] { libraryName });
mode = 1;
- } catch (Exception e) {
+ } catch (final Exception e) {
Throwable t = e;
if (t instanceof InvocationTargetException) {
t = ((InvocationTargetException) t).getTargetException();
@@ -536,21 +536,21 @@ public class JNILibLoaderBase {
try {
System.loadLibrary(libraryName);
mode = 3;
- } catch (UnsatisfiedLinkError ex1) {
+ } catch (final UnsatisfiedLinkError ex1) {
if(DEBUG) {
System.err.println("ERROR (retry w/ enumLibPath) - "+ex1.getMessage());
}
- List<String> possiblePaths = NativeLibrary.enumerateLibraryPaths(libraryName, libraryName, libraryName, true, cl);
+ final List<String> possiblePaths = NativeLibrary.enumerateLibraryPaths(libraryName, libraryName, libraryName, true, cl);
// Iterate down these and see which one if any we can actually find.
- for (Iterator<String> iter = possiblePaths.iterator(); 0 == mode && iter.hasNext(); ) {
- String path = iter.next();
+ for (final Iterator<String> iter = possiblePaths.iterator(); 0 == mode && iter.hasNext(); ) {
+ final String path = iter.next();
if (DEBUG) {
System.err.println("JNILibLoaderBase: System.load("+path+") - mode 4");
}
try {
System.load(path);
mode = 4;
- } catch (UnsatisfiedLinkError ex2) {
+ } catch (final UnsatisfiedLinkError ex2) {
if(DEBUG) {
System.err.println("n/a - "+ex2.getMessage());
}
diff --git a/src/java/com/jogamp/common/net/AssetURLConnection.java b/src/java/com/jogamp/common/net/AssetURLConnection.java
index 4f2a412..908e329 100644
--- a/src/java/com/jogamp/common/net/AssetURLConnection.java
+++ b/src/java/com/jogamp/common/net/AssetURLConnection.java
@@ -71,7 +71,7 @@ import java.net.URL;
*/
public class AssetURLConnection extends PiggybackURLConnection<AssetURLContext> {
- public AssetURLConnection(URL url, AssetURLContext implHelper) {
+ public AssetURLConnection(final URL url, final AssetURLContext implHelper) {
super(url, implHelper);
}
diff --git a/src/java/com/jogamp/common/net/AssetURLContext.java b/src/java/com/jogamp/common/net/AssetURLContext.java
index 38691e8..2ada3c6 100644
--- a/src/java/com/jogamp/common/net/AssetURLContext.java
+++ b/src/java/com/jogamp/common/net/AssetURLContext.java
@@ -59,7 +59,7 @@ public abstract class AssetURLContext implements PiggybackURLContext {
* @return
* @throws MalformedURLException
*/
- public static URL createURL(String path, ClassLoader cl) throws MalformedURLException {
+ public static URL createURL(final String path, final ClassLoader cl) throws MalformedURLException {
return new URL(null, path.startsWith(asset_protocol_prefix) ? path : asset_protocol_prefix + path, createHandler(cl));
}
@@ -75,7 +75,7 @@ public abstract class AssetURLContext implements PiggybackURLContext {
* @return
* @throws MalformedURLException
*/
- public static URL createURL(String path) throws MalformedURLException {
+ public static URL createURL(final String path) throws MalformedURLException {
return new URL(path.startsWith(asset_protocol_prefix) ? path : asset_protocol_prefix + path);
}
@@ -94,7 +94,7 @@ public abstract class AssetURLContext implements PiggybackURLContext {
*
* @return true if successful, otherwise false
*/
- public static boolean registerHandler(ClassLoader cl) {
+ public static boolean registerHandler(final ClassLoader cl) {
final GenericURLStreamHandlerFactory f = GenericURLStreamHandlerFactory.register();
if( null != f ) {
f.setHandler(asset_protocol, createHandler(cl));
@@ -141,11 +141,11 @@ public abstract class AssetURLContext implements PiggybackURLContext {
* </p>
**/
@Override
- public URLConnection resolve(String path) throws IOException {
+ public URLConnection resolve(final String path) throws IOException {
return resolve(path, getClassLoader());
}
- public static URLConnection resolve(String path, ClassLoader cl) throws IOException {
+ public static URLConnection resolve(String path, final ClassLoader cl) throws IOException {
URL url = null;
URLConnection conn = null;
int type = -1;
@@ -155,7 +155,7 @@ public abstract class AssetURLContext implements PiggybackURLContext {
}
try {
path = IOUtil.cleanPathString(path);
- } catch (URISyntaxException uriEx) {
+ } catch (final URISyntaxException uriEx) {
throw new IOException(uriEx);
}
@@ -164,7 +164,7 @@ public abstract class AssetURLContext implements PiggybackURLContext {
url = new URL(path);
conn = open(url);
type = null != conn ? 1 : -1;
- } catch(MalformedURLException e1) { if(DEBUG) { System.err.println("ERR(0): "+e1.getMessage()); } }
+ } catch(final MalformedURLException e1) { if(DEBUG) { System.err.println("ERR(0): "+e1.getMessage()); } }
if(null == conn && null != cl) {
// lookup via ClassLoader .. cleanup leading '/'
@@ -183,13 +183,13 @@ public abstract class AssetURLContext implements PiggybackURLContext {
if(null == conn) {
// lookup as File
try {
- File file = new File(path);
+ final File file = new File(path);
if(file.exists()) {
url = IOUtil.toURISimple(file).toURL();
conn = open(url);
type = null != conn ? 3 : -1;
}
- } catch (Throwable e) { if(DEBUG) { System.err.println("ERR(1): "+e.getMessage()); } }
+ } catch (final Throwable e) { if(DEBUG) { System.err.println("ERR(1): "+e.getMessage()); } }
}
if(DEBUG) {
@@ -201,7 +201,7 @@ public abstract class AssetURLContext implements PiggybackURLContext {
return conn;
}
- private static URLConnection open(URL url) {
+ private static URLConnection open(final URL url) {
if(null==url) {
return null;
}
@@ -209,7 +209,7 @@ public abstract class AssetURLContext implements PiggybackURLContext {
final URLConnection c = url.openConnection();
c.connect(); // redundant
return c;
- } catch (IOException ioe) { if(DEBUG) { System.err.println("ERR: "+ioe.getMessage()); } }
+ } catch (final IOException ioe) { if(DEBUG) { System.err.println("ERR: "+ioe.getMessage()); } }
return null;
}
diff --git a/src/java/com/jogamp/common/net/AssetURLStreamHandler.java b/src/java/com/jogamp/common/net/AssetURLStreamHandler.java
index 6760646..88cedbb 100644
--- a/src/java/com/jogamp/common/net/AssetURLStreamHandler.java
+++ b/src/java/com/jogamp/common/net/AssetURLStreamHandler.java
@@ -22,12 +22,12 @@ import com.jogamp.common.net.AssetURLConnection;
public class AssetURLStreamHandler extends URLStreamHandler {
AssetURLContext ctx;
- public AssetURLStreamHandler(AssetURLContext ctx) {
+ public AssetURLStreamHandler(final AssetURLContext ctx) {
this.ctx = ctx;
}
@Override
- protected URLConnection openConnection(URL u) throws IOException {
+ protected URLConnection openConnection(final URL u) throws IOException {
final AssetURLConnection c = new AssetURLConnection(u, ctx);
c.connect();
return c;
diff --git a/src/java/com/jogamp/common/net/GenericURLStreamHandlerFactory.java b/src/java/com/jogamp/common/net/GenericURLStreamHandlerFactory.java
index b5c5177..185142f 100644
--- a/src/java/com/jogamp/common/net/GenericURLStreamHandlerFactory.java
+++ b/src/java/com/jogamp/common/net/GenericURLStreamHandlerFactory.java
@@ -22,7 +22,7 @@ public class GenericURLStreamHandlerFactory implements URLStreamHandlerFactory {
*
* @return the previous set <code>handler</code>, or null if none was set.
*/
- public synchronized final URLStreamHandler setHandler(String protocol, URLStreamHandler handler) {
+ public synchronized final URLStreamHandler setHandler(final String protocol, final URLStreamHandler handler) {
return protocolHandlers.put(protocol, handler);
}
@@ -30,12 +30,12 @@ public class GenericURLStreamHandlerFactory implements URLStreamHandlerFactory {
* Returns the <code>protocol</code> handler previously set via {@link #setHandler(String, URLStreamHandler)},
* or null if none was set.
*/
- public synchronized final URLStreamHandler getHandler(String protocol) {
+ public synchronized final URLStreamHandler getHandler(final String protocol) {
return protocolHandlers.get(protocol);
}
@Override
- public synchronized final URLStreamHandler createURLStreamHandler(String protocol) {
+ public synchronized final URLStreamHandler createURLStreamHandler(final String protocol) {
return getHandler(protocol);
}
@@ -52,11 +52,11 @@ public class GenericURLStreamHandlerFactory implements URLStreamHandlerFactory {
@Override
public GenericURLStreamHandlerFactory run() {
boolean ok = false;
- GenericURLStreamHandlerFactory f = new GenericURLStreamHandlerFactory();
+ final GenericURLStreamHandlerFactory f = new GenericURLStreamHandlerFactory();
try {
URL.setURLStreamHandlerFactory(f);
ok = true;
- } catch (Throwable e) {
+ } catch (final Throwable e) {
System.err.println("GenericURLStreamHandlerFactory: Setting URLStreamHandlerFactory failed: "+e.getMessage());
}
return ok ? f : null;
diff --git a/src/java/com/jogamp/common/net/PiggybackURLConnection.java b/src/java/com/jogamp/common/net/PiggybackURLConnection.java
index 3b774e8..6f5f4f0 100644
--- a/src/java/com/jogamp/common/net/PiggybackURLConnection.java
+++ b/src/java/com/jogamp/common/net/PiggybackURLConnection.java
@@ -24,7 +24,7 @@ public abstract class PiggybackURLConnection<I extends PiggybackURLContext> exte
* @param url the specific URL for this instance
* @param context the piggyback context, defining state independent code and constants
*/
- protected PiggybackURLConnection(URL url, I context) {
+ protected PiggybackURLConnection(final URL url, final I context) {
super(url);
this.context = context;
}
diff --git a/src/java/com/jogamp/common/net/URIQueryProps.java b/src/java/com/jogamp/common/net/URIQueryProps.java
index fd91b9b..138ff9b 100644
--- a/src/java/com/jogamp/common/net/URIQueryProps.java
+++ b/src/java/com/jogamp/common/net/URIQueryProps.java
@@ -53,7 +53,7 @@ public class URIQueryProps {
private final HashMap<String, String> properties = new HashMap<String, String>();
- private URIQueryProps(char querySeparator) {
+ private URIQueryProps(final char querySeparator) {
query_separator = String.valueOf(querySeparator);
}
@@ -72,7 +72,7 @@ public class URIQueryProps {
needsSep = true;
}
}
- Iterator<Entry<String, String>> entries = properties.entrySet().iterator();
+ final Iterator<Entry<String, String>> entries = properties.entrySet().iterator();
while(entries.hasNext()) {
if(needsSep) {
sb.append(query_separator);
@@ -87,7 +87,7 @@ public class URIQueryProps {
return sb.toString();
}
- public final URI appendQuery(URI base) throws URISyntaxException {
+ public final URI appendQuery(final URI base) throws URISyntaxException {
return new URI(base.getScheme(),
base.getRawUserInfo(), base.getHost(), base.getPort(),
base.getRawPath(), appendQuery(base.getRawQuery()), base.getRawFragment());
@@ -100,7 +100,7 @@ public class URIQueryProps {
* @return
* @throws IllegalArgumentException if <code>querySeparator</code> is illegal, i.e. neither <i>;</i> nor <i>&</i>
*/
- public static final URIQueryProps create(URI uri, char querySeparator) throws IllegalArgumentException {
+ public static final URIQueryProps create(final URI uri, final char querySeparator) throws IllegalArgumentException {
if( ';' != querySeparator && '&' != querySeparator ) {
throw new IllegalArgumentException("querySeparator is invalid: "+querySeparator);
}
@@ -109,7 +109,7 @@ public class URIQueryProps {
final int q_l = null != q ? q.length() : -1;
int q_e = -1;
while(q_e < q_l) {
- int q_b = q_e + 1; // next term
+ final int q_b = q_e + 1; // next term
q_e = q.indexOf(querySeparator, q_b);
if(0 == q_e) {
// single separator
diff --git a/src/java/com/jogamp/common/net/asset/Handler.java b/src/java/com/jogamp/common/net/asset/Handler.java
index d622221..74fb015 100644
--- a/src/java/com/jogamp/common/net/asset/Handler.java
+++ b/src/java/com/jogamp/common/net/asset/Handler.java
@@ -29,7 +29,7 @@ public class Handler extends URLStreamHandler {
}
@Override
- protected URLConnection openConnection(URL u) throws IOException {
+ protected URLConnection openConnection(final URL u) throws IOException {
final AssetURLConnection c = new AssetURLConnection(u, localCL);
c.connect();
return c;
diff --git a/src/java/com/jogamp/common/nio/AbstractBuffer.java b/src/java/com/jogamp/common/nio/AbstractBuffer.java
index 1be279b..2da6440 100644
--- a/src/java/com/jogamp/common/nio/AbstractBuffer.java
+++ b/src/java/com/jogamp/common/nio/AbstractBuffer.java
@@ -60,7 +60,7 @@ public abstract class AbstractBuffer<B extends AbstractBuffer> implements Native
* @param elementSize the target element size in bytes.
* @param capacity the target capacity in elements of size <code>elementSize</code>.
*/
- protected AbstractBuffer(Buffer buffer, int elementSize, int capacity) {
+ protected AbstractBuffer(final Buffer buffer, final int elementSize, final int capacity) {
this.buffer = buffer;
this.elementSize = elementSize;
this.capacity = capacity;
@@ -89,7 +89,7 @@ public abstract class AbstractBuffer<B extends AbstractBuffer> implements Native
}
@Override
- public final B position(int newPos) {
+ public final B position(final int newPos) {
if (0 > newPos || newPos >= capacity) {
throw new IndexOutOfBoundsException("Sorry to interrupt, but the position "+newPos+" was out of bounds. " +
"My capacity is "+capacity()+".");
diff --git a/src/java/com/jogamp/common/nio/Buffers.java b/src/java/com/jogamp/common/nio/Buffers.java
index 2a37e47..8fff30e 100644
--- a/src/java/com/jogamp/common/nio/Buffers.java
+++ b/src/java/com/jogamp/common/nio/Buffers.java
@@ -69,19 +69,19 @@ public class Buffers {
* elements. The returned buffer will have its byte order set to
* the host platform's native byte order.
*/
- public static ByteBuffer newDirectByteBuffer(int numElements) {
+ public static ByteBuffer newDirectByteBuffer(final int numElements) {
return nativeOrder(ByteBuffer.allocateDirect(numElements));
}
- public static ByteBuffer newDirectByteBuffer(byte[] values, int offset, int length) {
+ public static ByteBuffer newDirectByteBuffer(final byte[] values, final int offset, final int length) {
return (ByteBuffer)newDirectByteBuffer(length).put(values, offset, length).rewind();
}
- public static ByteBuffer newDirectByteBuffer(byte[] values, int offset) {
+ public static ByteBuffer newDirectByteBuffer(final byte[] values, final int offset) {
return newDirectByteBuffer(values, offset, values.length-offset);
}
- public static ByteBuffer newDirectByteBuffer(byte[] values) {
+ public static ByteBuffer newDirectByteBuffer(final byte[] values) {
return newDirectByteBuffer(values, 0);
}
@@ -90,19 +90,19 @@ public class Buffers {
* elements. The returned buffer will have its byte order set to
* the host platform's native byte order.
*/
- public static DoubleBuffer newDirectDoubleBuffer(int numElements) {
+ public static DoubleBuffer newDirectDoubleBuffer(final int numElements) {
return newDirectByteBuffer(numElements * SIZEOF_DOUBLE).asDoubleBuffer();
}
- public static DoubleBuffer newDirectDoubleBuffer(double[] values, int offset, int length) {
+ public static DoubleBuffer newDirectDoubleBuffer(final double[] values, final int offset, final int length) {
return (DoubleBuffer)newDirectDoubleBuffer(length).put(values, offset, length).rewind();
}
- public static DoubleBuffer newDirectDoubleBuffer(double[] values, int offset) {
+ public static DoubleBuffer newDirectDoubleBuffer(final double[] values, final int offset) {
return newDirectDoubleBuffer(values, offset, values.length - offset);
}
- public static DoubleBuffer newDirectDoubleBuffer(double[] values) {
+ public static DoubleBuffer newDirectDoubleBuffer(final double[] values) {
return newDirectDoubleBuffer(values, 0);
}
@@ -111,19 +111,19 @@ public class Buffers {
* elements. The returned buffer will have its byte order set to
* the host platform's native byte order.
*/
- public static FloatBuffer newDirectFloatBuffer(int numElements) {
+ public static FloatBuffer newDirectFloatBuffer(final int numElements) {
return newDirectByteBuffer(numElements * SIZEOF_FLOAT).asFloatBuffer();
}
- public static FloatBuffer newDirectFloatBuffer(float[] values, int offset, int length) {
+ public static FloatBuffer newDirectFloatBuffer(final float[] values, final int offset, final int length) {
return (FloatBuffer)newDirectFloatBuffer(length).put(values, offset, length).rewind();
}
- public static FloatBuffer newDirectFloatBuffer(float[] values, int offset) {
+ public static FloatBuffer newDirectFloatBuffer(final float[] values, final int offset) {
return newDirectFloatBuffer(values, offset, values.length - offset);
}
- public static FloatBuffer newDirectFloatBuffer(float[] values) {
+ public static FloatBuffer newDirectFloatBuffer(final float[] values) {
return newDirectFloatBuffer(values, 0);
}
@@ -132,19 +132,19 @@ public class Buffers {
* elements. The returned buffer will have its byte order set to
* the host platform's native byte order.
*/
- public static IntBuffer newDirectIntBuffer(int numElements) {
+ public static IntBuffer newDirectIntBuffer(final int numElements) {
return newDirectByteBuffer(numElements * SIZEOF_INT).asIntBuffer();
}
- public static IntBuffer newDirectIntBuffer(int[] values, int offset, int length) {
+ public static IntBuffer newDirectIntBuffer(final int[] values, final int offset, final int length) {
return (IntBuffer)newDirectIntBuffer(length).put(values, offset, length).rewind();
}
- public static IntBuffer newDirectIntBuffer(int[] values, int offset) {
+ public static IntBuffer newDirectIntBuffer(final int[] values, final int offset) {
return newDirectIntBuffer(values, offset, values.length - offset);
}
- public static IntBuffer newDirectIntBuffer(int[] values) {
+ public static IntBuffer newDirectIntBuffer(final int[] values) {
return newDirectIntBuffer(values, 0);
}
@@ -153,19 +153,19 @@ public class Buffers {
* elements. The returned buffer will have its byte order set to
* the host platform's native byte order.
*/
- public static LongBuffer newDirectLongBuffer(int numElements) {
+ public static LongBuffer newDirectLongBuffer(final int numElements) {
return newDirectByteBuffer(numElements * SIZEOF_LONG).asLongBuffer();
}
- public static LongBuffer newDirectLongBuffer(long[] values, int offset, int length) {
+ public static LongBuffer newDirectLongBuffer(final long[] values, final int offset, final int length) {
return (LongBuffer)newDirectLongBuffer(length).put(values, offset, length).rewind();
}
- public static LongBuffer newDirectLongBuffer(long[] values, int offset) {
+ public static LongBuffer newDirectLongBuffer(final long[] values, final int offset) {
return newDirectLongBuffer(values, offset, values.length - offset);
}
- public static LongBuffer newDirectLongBuffer(long[] values) {
+ public static LongBuffer newDirectLongBuffer(final long[] values) {
return newDirectLongBuffer(values, 0);
}
@@ -174,19 +174,19 @@ public class Buffers {
* elements. The returned buffer will have its byte order set to
* the host platform's native byte order.
*/
- public static ShortBuffer newDirectShortBuffer(int numElements) {
+ public static ShortBuffer newDirectShortBuffer(final int numElements) {
return newDirectByteBuffer(numElements * SIZEOF_SHORT).asShortBuffer();
}
- public static ShortBuffer newDirectShortBuffer(short[] values, int offset, int length) {
+ public static ShortBuffer newDirectShortBuffer(final short[] values, final int offset, final int length) {
return (ShortBuffer)newDirectShortBuffer(length).put(values, offset, length).rewind();
}
- public static ShortBuffer newDirectShortBuffer(short[] values, int offset) {
+ public static ShortBuffer newDirectShortBuffer(final short[] values, final int offset) {
return newDirectShortBuffer(values, offset, values.length - offset);
}
- public static ShortBuffer newDirectShortBuffer(short[] values) {
+ public static ShortBuffer newDirectShortBuffer(final short[] values) {
return newDirectShortBuffer(values, 0);
}
@@ -195,19 +195,19 @@ public class Buffers {
* elements. The returned buffer will have its byte order set to
* the host platform's native byte order.
*/
- public static CharBuffer newDirectCharBuffer(int numElements) {
+ public static CharBuffer newDirectCharBuffer(final int numElements) {
return newDirectByteBuffer(numElements * SIZEOF_SHORT).asCharBuffer();
}
- public static CharBuffer newDirectCharBuffer(char[] values, int offset, int length) {
+ public static CharBuffer newDirectCharBuffer(final char[] values, final int offset, final int length) {
return (CharBuffer)newDirectCharBuffer(length).put(values, offset, length).rewind();
}
- public static CharBuffer newDirectCharBuffer(char[] values, int offset) {
+ public static CharBuffer newDirectCharBuffer(final char[] values, final int offset) {
return newDirectCharBuffer(values, offset, values.length - offset);
}
- public static CharBuffer newDirectCharBuffer(char[] values) {
+ public static CharBuffer newDirectCharBuffer(final char[] values) {
return newDirectCharBuffer(values, 0);
}
@@ -216,7 +216,7 @@ public class Buffers {
* @see #slice(java.nio.Buffer, int, int)
*/
@SuppressWarnings("unchecked")
- public static <B extends Buffer> B slice(B buffer) {
+ public static <B extends Buffer> B slice(final B buffer) {
if (buffer instanceof ByteBuffer) {
final ByteBuffer bb = (ByteBuffer) buffer;
return (B) bb.slice().order(bb.order()); // slice and duplicate may change byte order
@@ -242,9 +242,9 @@ public class Buffers {
* Concurrency warning: this method changes the buffers position and limit but
* will restore it before return.
*/
- public static <B extends Buffer> B slice(B buffer, int offset, int size) {
- int pos = buffer.position();
- int limit = buffer.limit();
+ public static <B extends Buffer> B slice(final B buffer, final int offset, final int size) {
+ final int pos = buffer.position();
+ final int limit = buffer.limit();
B slice = null;
try {
@@ -280,7 +280,7 @@ public class Buffers {
* @param floatSize {@link Buffers#SIZEOF_FLOAT} size
* @return FloatBuffer w/ native byte order as given ByteBuffer
*/
- public static final FloatBuffer slice2Float(Buffer buf, int floatStartPos, int floatSize) {
+ public static final FloatBuffer slice2Float(final Buffer buf, final int floatStartPos, final int floatSize) {
final int pos;
final int limit;
if(null != buf) {
@@ -293,12 +293,12 @@ public class Buffers {
final FloatBuffer res;
try {
if(buf instanceof ByteBuffer) {
- ByteBuffer bb = (ByteBuffer) buf;
+ final ByteBuffer bb = (ByteBuffer) buf;
bb.position( floatStartPos * Buffers.SIZEOF_FLOAT );
bb.limit( (floatStartPos + floatSize) * Buffers.SIZEOF_FLOAT );
res = bb.slice().order(bb.order()).asFloatBuffer(); // slice and duplicate may change byte order
} else if(buf instanceof FloatBuffer) {
- FloatBuffer fb = (FloatBuffer) buf;
+ final FloatBuffer fb = (FloatBuffer) buf;
fb.position( floatStartPos );
fb.limit( floatStartPos + floatSize );
res = fb.slice(); // slice and duplicate may change byte order
@@ -335,7 +335,7 @@ public class Buffers {
* @param floatSize {@link Buffers#SIZEOF_FLOAT} size
* @return FloatBuffer w/ native byte order as given ByteBuffer
*/
- public static final FloatBuffer slice2Float(float[] backing, int floatStartPos, int floatSize) {
+ public static final FloatBuffer slice2Float(final float[] backing, final int floatStartPos, final int floatSize) {
return (FloatBuffer) FloatBuffer.wrap(backing, floatStartPos, floatSize).mark();
}
@@ -345,7 +345,7 @@ public class Buffers {
* that operation is supported by the underlying NIO
* implementation.
*/
- public static ByteBuffer nativeOrder(ByteBuffer buf) {
+ public static ByteBuffer nativeOrder(final ByteBuffer buf) {
return buf.order(ByteOrder.nativeOrder());
}
@@ -353,7 +353,7 @@ public class Buffers {
* Returns the size of a single element of the given buffer in bytes
* or <code>0</code> if the given buffer is <code>null</code>.
*/
- public static int sizeOfBufferElem(Object buffer) {
+ public static int sizeOfBufferElem(final Object buffer) {
if (buffer == null) {
return 0;
}
@@ -384,7 +384,7 @@ public class Buffers {
* @return If <code>buffer</code> is null, returns <code>0<code>, otherwise the remaining size in elements.
* @throws IllegalArgumentException if <code>buffer</code> is of invalid type.
*/
- public static int remainingElem(Object buffer) throws IllegalArgumentException {
+ public static int remainingElem(final Object buffer) throws IllegalArgumentException {
if (buffer == null) {
return 0;
}
@@ -404,13 +404,13 @@ public class Buffers {
* @return If <code>buffer</code> is null, returns <code>0<code>, otherwise the remaining size in bytes.
* @throws IllegalArgumentException if <code>buffer</code> is of invalid type.
*/
- public static int remainingBytes(Object buffer) throws IllegalArgumentException {
+ public static int remainingBytes(final Object buffer) throws IllegalArgumentException {
if (buffer == null) {
return 0;
}
final int bytesRemaining;
if (buffer instanceof Buffer) {
- int elementsRemaining = ((Buffer) buffer).remaining();
+ final int elementsRemaining = ((Buffer) buffer).remaining();
if (buffer instanceof ByteBuffer) {
bytesRemaining = elementsRemaining;
} else if (buffer instanceof FloatBuffer) {
@@ -441,7 +441,7 @@ public class Buffers {
* Helper routine to tell whether a buffer is direct or not. Null
* pointers <b>are</b> considered direct.
*/
- public static boolean isDirect(Object buf) {
+ public static boolean isDirect(final Object buf) {
if (buf == null) {
return true;
}
@@ -478,7 +478,7 @@ public class Buffers {
* account the Buffer position and the underlying type. This is
* the total offset for Direct Buffers.
*/
- public static int getDirectBufferByteOffset(Object buf) {
+ public static int getDirectBufferByteOffset(final Object buf) {
if (buf == null) {
return 0;
}
@@ -513,7 +513,7 @@ public class Buffers {
* @throws UnsupportedOperationException if the passed Object does not have an array backing store
* @throws IllegalArgumentException if the passed Object is neither of type {@link java.nio.Buffer} or {@link NativeBuffer}.
*/
- public static Object getArray(Object buf) throws UnsupportedOperationException, IllegalArgumentException {
+ public static Object getArray(final Object buf) throws UnsupportedOperationException, IllegalArgumentException {
if (buf == null) {
return null;
}
@@ -532,7 +532,7 @@ public class Buffers {
* object. The array offset also includes the position offset
* within the buffer, in addition to any array offset.
*/
- public static int getIndirectBufferByteOffset(Object buf) {
+ public static int getIndirectBufferByteOffset(final Object buf) {
if (buf == null) {
return 0;
}
@@ -573,9 +573,9 @@ public class Buffers {
* order. The position of the newly-allocated buffer will be zero,
* and the position of the passed buffer is unchanged.
*/
- public static ByteBuffer copyByteBuffer(ByteBuffer orig) {
+ public static ByteBuffer copyByteBuffer(final ByteBuffer orig) {
final int op0 = orig.position();
- ByteBuffer dest = newDirectByteBuffer(orig.remaining());
+ final ByteBuffer dest = newDirectByteBuffer(orig.remaining());
dest.put(orig);
dest.rewind();
orig.position(op0);
@@ -590,7 +590,7 @@ public class Buffers {
* order. The position of the newly-allocated buffer will be zero,
* and the position of the passed buffer is unchanged.
*/
- public static FloatBuffer copyFloatBuffer(FloatBuffer orig) {
+ public static FloatBuffer copyFloatBuffer(final FloatBuffer orig) {
return copyFloatBufferAsByteBuffer(orig).asFloatBuffer();
}
@@ -602,7 +602,7 @@ public class Buffers {
* order. The position of the newly-allocated buffer will be zero,
* and the position of the passed buffer is unchanged.
*/
- public static IntBuffer copyIntBuffer(IntBuffer orig) {
+ public static IntBuffer copyIntBuffer(final IntBuffer orig) {
return copyIntBufferAsByteBuffer(orig).asIntBuffer();
}
@@ -614,7 +614,7 @@ public class Buffers {
* order. The position of the newly-allocated buffer will be zero,
* and the position of the passed buffer is unchanged.
*/
- public static ShortBuffer copyShortBuffer(ShortBuffer orig) {
+ public static ShortBuffer copyShortBuffer(final ShortBuffer orig) {
return copyShortBufferAsByteBuffer(orig).asShortBuffer();
}
@@ -629,9 +629,9 @@ public class Buffers {
* order. The position of the newly-allocated buffer will be zero,
* and the position of the passed buffer is unchanged.
*/
- public static ByteBuffer copyFloatBufferAsByteBuffer(FloatBuffer orig) {
+ public static ByteBuffer copyFloatBufferAsByteBuffer(final FloatBuffer orig) {
final int op0 = orig.position();
- ByteBuffer dest = newDirectByteBuffer(orig.remaining() * SIZEOF_FLOAT);
+ final ByteBuffer dest = newDirectByteBuffer(orig.remaining() * SIZEOF_FLOAT);
dest.asFloatBuffer().put(orig);
dest.rewind();
orig.position(op0);
@@ -646,9 +646,9 @@ public class Buffers {
* order. The position of the newly-allocated buffer will be zero,
* and the position of the passed buffer is unchanged.
*/
- public static ByteBuffer copyIntBufferAsByteBuffer(IntBuffer orig) {
+ public static ByteBuffer copyIntBufferAsByteBuffer(final IntBuffer orig) {
final int op0 = orig.position();
- ByteBuffer dest = newDirectByteBuffer(orig.remaining() * SIZEOF_INT);
+ final ByteBuffer dest = newDirectByteBuffer(orig.remaining() * SIZEOF_INT);
dest.asIntBuffer().put(orig);
dest.rewind();
orig.position(op0);
@@ -663,9 +663,9 @@ public class Buffers {
* order. The position of the newly-allocated buffer will be zero,
* and the position of the passed buffer is unchanged.
*/
- public static ByteBuffer copyShortBufferAsByteBuffer(ShortBuffer orig) {
+ public static ByteBuffer copyShortBufferAsByteBuffer(final ShortBuffer orig) {
final int op0 = orig.position();
- ByteBuffer dest = newDirectByteBuffer(orig.remaining() * SIZEOF_SHORT);
+ final ByteBuffer dest = newDirectByteBuffer(orig.remaining() * SIZEOF_SHORT);
dest.asShortBuffer().put(orig);
dest.rewind();
orig.position(op0);
@@ -684,7 +684,7 @@ public class Buffers {
* @param len the payload of elements to be copied, if <code>len < 0</code> then <code>len = source.length - soffset</code>
* @return the passed or newly created target array
*/
- public static float[] getFloatArray(double[] source, int soffset, float[] dest, int doffset, int len) {
+ public static float[] getFloatArray(final double[] source, final int soffset, float[] dest, int doffset, int len) {
if(0>len) {
len = source.length - soffset;
}
@@ -710,7 +710,7 @@ public class Buffers {
* @param dest the target buffer, if null, a new buffer is being created with size </code>source.remaining()</code>
* @return the passed or newly created target buffer
*/
- public static FloatBuffer getFloatBuffer(DoubleBuffer source, FloatBuffer dest) {
+ public static FloatBuffer getFloatBuffer(final DoubleBuffer source, FloatBuffer dest) {
if(null == dest) {
dest = newDirectFloatBuffer(source.remaining());
}
@@ -731,7 +731,7 @@ public class Buffers {
* @param len the payload of elements to be copied, if <code>len < 0</code> then <code>len = source.length - soffset</code>
* @return the passed or newly created target array
*/
- public static double[] getDoubleArray(float[] source, int soffset, double[] dest, int doffset, int len) {
+ public static double[] getDoubleArray(final float[] source, final int soffset, double[] dest, int doffset, int len) {
if(0>len) {
len = source.length - soffset;
}
@@ -757,7 +757,7 @@ public class Buffers {
* @param dest the target buffer, if null, a new buffer is being created with size </code>source.remaining()</code>
* @return the passed or newly created target buffer
*/
- public static DoubleBuffer getDoubleBuffer(FloatBuffer source, DoubleBuffer dest) {
+ public static DoubleBuffer getDoubleBuffer(final FloatBuffer source, DoubleBuffer dest) {
if(null == dest) {
dest = newDirectDoubleBuffer(source.remaining());
}
@@ -776,7 +776,7 @@ public class Buffers {
//
@SuppressWarnings("unchecked")
- public static <B extends Buffer> B put(B dest, Buffer src) {
+ public static <B extends Buffer> B put(final B dest, final Buffer src) {
if ((dest instanceof ByteBuffer) && (src instanceof ByteBuffer)) {
return (B) ((ByteBuffer) dest).put((ByteBuffer) src);
} else if ((dest instanceof ShortBuffer) && (src instanceof ShortBuffer)) {
@@ -796,7 +796,7 @@ public class Buffers {
}
@SuppressWarnings("unchecked")
- public static <B extends Buffer> B putb(B dest, byte v) {
+ public static <B extends Buffer> B putb(final B dest, final byte v) {
if (dest instanceof ByteBuffer) {
return (B) ((ByteBuffer) dest).put(v);
} else if (dest instanceof ShortBuffer) {
@@ -817,7 +817,7 @@ public class Buffers {
}
@SuppressWarnings("unchecked")
- public static <B extends Buffer> B puts(B dest, short v) {
+ public static <B extends Buffer> B puts(final B dest, final short v) {
if (dest instanceof ShortBuffer) {
return (B) ((ShortBuffer) dest).put(v);
} else if (dest instanceof IntBuffer) {
@@ -834,7 +834,7 @@ public class Buffers {
}
@SuppressWarnings("unchecked")
- public static <B extends Buffer> B puti(B dest, int v) {
+ public static <B extends Buffer> B puti(final B dest, final int v) {
if (dest instanceof IntBuffer) {
return (B) ((IntBuffer) dest).put(v);
} else if (dest instanceof FloatBuffer) {
@@ -849,7 +849,7 @@ public class Buffers {
}
@SuppressWarnings("unchecked")
- public static <B extends Buffer> B putf(B dest, float v) {
+ public static <B extends Buffer> B putf(final B dest, final float v) {
if (dest instanceof FloatBuffer) {
return (B) ((FloatBuffer) dest).put(v);
} else if (dest instanceof DoubleBuffer) {
@@ -864,7 +864,7 @@ public class Buffers {
}
@SuppressWarnings("unchecked")
- public static <B extends Buffer> B putd(B dest, double v) {
+ public static <B extends Buffer> B putd(final B dest, final double v) {
if (dest instanceof FloatBuffer) {
return (B) ((FloatBuffer) dest).put((float) v);
} else {
@@ -886,7 +886,7 @@ public class Buffers {
* @param sSigned true if source represents a signed value, false if source represents an unsigned value
*/
@SuppressWarnings("unchecked")
- public static <B extends Buffer> B putNb(B dest, boolean dSigned, byte v, boolean sSigned) {
+ public static <B extends Buffer> B putNb(final B dest, final boolean dSigned, final byte v, final boolean sSigned) {
if (dest instanceof ByteBuffer) {
return (B) ((ByteBuffer) dest).put( v );
} else if (dest instanceof ShortBuffer) {
@@ -910,7 +910,7 @@ public class Buffers {
* @param sSigned true if source represents a signed value, false if source represents an unsigned value
*/
@SuppressWarnings("unchecked")
- public static <B extends Buffer> B putNs(B dest, boolean dSigned, short v, boolean sSigned) {
+ public static <B extends Buffer> B putNs(final B dest, final boolean dSigned, final short v, final boolean sSigned) {
if (dest instanceof ByteBuffer) {
return (B) ((ByteBuffer) dest).put( ValueConv.short_to_byte(v, sSigned, dSigned) );
} else if (dest instanceof ShortBuffer) {
@@ -934,7 +934,7 @@ public class Buffers {
* @param sSigned true if source represents a signed value, false if source represents an unsigned value
*/
@SuppressWarnings("unchecked")
- public static <B extends Buffer> B putNi(B dest, boolean dSigned, int v, boolean sSigned) {
+ public static <B extends Buffer> B putNi(final B dest, final boolean dSigned, final int v, final boolean sSigned) {
if (dest instanceof ByteBuffer) {
return (B) ((ByteBuffer) dest).put( ValueConv.int_to_byte(v, sSigned, dSigned) );
} else if (dest instanceof ShortBuffer) {
@@ -957,7 +957,7 @@ public class Buffers {
* @param v source float value to be put in dest buffer
*/
@SuppressWarnings("unchecked")
- public static <B extends Buffer> B putNf(B dest, boolean dSigned, float v) {
+ public static <B extends Buffer> B putNf(final B dest, final boolean dSigned, final float v) {
if (dest instanceof ByteBuffer) {
return (B) ((ByteBuffer) dest).put( ValueConv.float_to_byte(v, dSigned) );
} else if (dest instanceof ShortBuffer) {
@@ -975,7 +975,7 @@ public class Buffers {
// Range check methods
//
- public static void rangeCheck(byte[] array, int offset, int minElementsRemaining) {
+ public static void rangeCheck(final byte[] array, final int offset, final int minElementsRemaining) {
if (array == null) {
return;
}
@@ -985,7 +985,7 @@ public class Buffers {
}
}
- public static void rangeCheck(char[] array, int offset, int minElementsRemaining) {
+ public static void rangeCheck(final char[] array, final int offset, final int minElementsRemaining) {
if (array == null) {
return;
}
@@ -995,7 +995,7 @@ public class Buffers {
}
}
- public static void rangeCheck(short[] array, int offset, int minElementsRemaining) {
+ public static void rangeCheck(final short[] array, final int offset, final int minElementsRemaining) {
if (array == null) {
return;
}
@@ -1005,7 +1005,7 @@ public class Buffers {
}
}
- public static void rangeCheck(int[] array, int offset, int minElementsRemaining) {
+ public static void rangeCheck(final int[] array, final int offset, final int minElementsRemaining) {
if (array == null) {
return;
}
@@ -1015,7 +1015,7 @@ public class Buffers {
}
}
- public static void rangeCheck(long[] array, int offset, int minElementsRemaining) {
+ public static void rangeCheck(final long[] array, final int offset, final int minElementsRemaining) {
if (array == null) {
return;
}
@@ -1025,7 +1025,7 @@ public class Buffers {
}
}
- public static void rangeCheck(float[] array, int offset, int minElementsRemaining) {
+ public static void rangeCheck(final float[] array, final int offset, final int minElementsRemaining) {
if (array == null) {
return;
}
@@ -1035,7 +1035,7 @@ public class Buffers {
}
}
- public static void rangeCheck(double[] array, int offset, int minElementsRemaining) {
+ public static void rangeCheck(final double[] array, final int offset, final int minElementsRemaining) {
if (array == null) {
return;
}
@@ -1045,7 +1045,7 @@ public class Buffers {
}
}
- public static void rangeCheck(Buffer buffer, int minElementsRemaining) {
+ public static void rangeCheck(final Buffer buffer, final int minElementsRemaining) {
if (buffer == null) {
return;
}
@@ -1061,7 +1061,7 @@ public class Buffers {
* @throws IllegalArgumentException if <code>buffer</code> is of invalid type.
* @throws IndexOutOfBoundsException if {@link #remainingBytes(Object)} is &lt; <code>minBytesRemaining<code>.
*/
- public static void rangeCheckBytes(Object buffer, int minBytesRemaining) throws IllegalArgumentException, IndexOutOfBoundsException {
+ public static void rangeCheckBytes(final Object buffer, final int minBytesRemaining) throws IllegalArgumentException, IndexOutOfBoundsException {
if (buffer == null) {
return;
}
@@ -1080,7 +1080,7 @@ public class Buffers {
* @param buffer Any valid Buffer instance
* @return the modified StringBuilder containing the Buffer details
*/
- public static StringBuilder toString(StringBuilder sb, String f, Buffer buffer) {
+ public static StringBuilder toString(StringBuilder sb, final String f, final Buffer buffer) {
if(null == sb) {
sb = new StringBuilder();
}
diff --git a/src/java/com/jogamp/common/nio/CachedBufferFactory.java b/src/java/com/jogamp/common/nio/CachedBufferFactory.java
index 6ddff4a..073659c 100644
--- a/src/java/com/jogamp/common/nio/CachedBufferFactory.java
+++ b/src/java/com/jogamp/common/nio/CachedBufferFactory.java
@@ -75,7 +75,7 @@ public class CachedBufferFactory {
this(DEFAULT_ALLOCATION_SIZE, DEFAULT_ALLOCATION_SIZE);
}
- private CachedBufferFactory(int initialSize, int allocationSize) {
+ private CachedBufferFactory(final int initialSize, final int allocationSize) {
currentBuffer = Buffers.newDirectByteBuffer(initialSize);
ALLOCATION_SIZE = allocationSize;
}
@@ -93,7 +93,7 @@ public class CachedBufferFactory {
* Creates a factory with the specified initial size. The allocation size is set to
* {@link #DEFAULT_ALLOCATION_SIZE}.
*/
- public static CachedBufferFactory create(int initialSize) {
+ public static CachedBufferFactory create(final int initialSize) {
return new CachedBufferFactory(initialSize, DEFAULT_ALLOCATION_SIZE);
}
@@ -103,14 +103,14 @@ public class CachedBufferFactory {
* @param fixed Creates a fixed size factory which will handle overflows (initial size)
* with RuntimeExceptions.
*/
- public static CachedBufferFactory create(int initialSize, boolean fixed) {
+ public static CachedBufferFactory create(final int initialSize, final boolean fixed) {
return new CachedBufferFactory(initialSize, fixed?-1:DEFAULT_ALLOCATION_SIZE);
}
/**
* Creates a factory with the specified initial size and allocation size.
*/
- public static CachedBufferFactory create(int initialSize, int allocationSize) {
+ public static CachedBufferFactory create(final int initialSize, final int allocationSize) {
return new CachedBufferFactory(initialSize, allocationSize);
}
@@ -125,21 +125,21 @@ public class CachedBufferFactory {
/**
* Synchronized version of {@link #create(int)}.
*/
- public static CachedBufferFactory createSynchronized(int initialSize) {
+ public static CachedBufferFactory createSynchronized(final int initialSize) {
return new SynchronizedCachedBufferFactory(initialSize, DEFAULT_ALLOCATION_SIZE);
}
/**
* Synchronized version of {@link #create(int, boolean)}.
*/
- public static CachedBufferFactory createSynchronized(int initialSize, boolean fixed) {
+ public static CachedBufferFactory createSynchronized(final int initialSize, final boolean fixed) {
return new SynchronizedCachedBufferFactory(initialSize, fixed?-1:DEFAULT_ALLOCATION_SIZE);
}
/**
* Synchronized version of {@link #create(int, int)}.
*/
- public static CachedBufferFactory createSynchronized(int initialSize, int allocationSize) {
+ public static CachedBufferFactory createSynchronized(final int initialSize, final int allocationSize) {
return new CachedBufferFactory(initialSize, allocationSize);
}
@@ -174,7 +174,7 @@ public class CachedBufferFactory {
currentBuffer = null;
}
}
- public ByteBuffer newDirectByteBuffer(int size) {
+ public ByteBuffer newDirectByteBuffer(final int size) {
// if large enough... just create it
if (size > currentBuffer.capacity()) {
@@ -189,123 +189,123 @@ public class CachedBufferFactory {
}
currentBuffer.limit(currentBuffer.position() + size);
- ByteBuffer result = currentBuffer.slice().order(currentBuffer.order());
+ final ByteBuffer result = currentBuffer.slice().order(currentBuffer.order());
currentBuffer.position(currentBuffer.limit());
currentBuffer.limit(currentBuffer.capacity());
return result;
}
- public ByteBuffer newDirectByteBuffer(byte[] values, int offset, int lenght) {
+ public ByteBuffer newDirectByteBuffer(final byte[] values, final int offset, final int lenght) {
return (ByteBuffer)newDirectByteBuffer(lenght).put(values, offset, lenght).rewind();
}
- public ByteBuffer newDirectByteBuffer(byte[] values, int offset) {
+ public ByteBuffer newDirectByteBuffer(final byte[] values, final int offset) {
return newDirectByteBuffer(values, offset, values.length-offset);
}
- public ByteBuffer newDirectByteBuffer(byte[] values) {
+ public ByteBuffer newDirectByteBuffer(final byte[] values) {
return newDirectByteBuffer(values, 0);
}
- public DoubleBuffer newDirectDoubleBuffer(int numElements) {
+ public DoubleBuffer newDirectDoubleBuffer(final int numElements) {
return newDirectByteBuffer(numElements * Buffers.SIZEOF_DOUBLE).asDoubleBuffer();
}
- public DoubleBuffer newDirectDoubleBuffer(double[] values, int offset, int lenght) {
+ public DoubleBuffer newDirectDoubleBuffer(final double[] values, final int offset, final int lenght) {
return (DoubleBuffer)newDirectDoubleBuffer(lenght).put(values, offset, lenght).rewind();
}
- public DoubleBuffer newDirectDoubleBuffer(double[] values, int offset) {
+ public DoubleBuffer newDirectDoubleBuffer(final double[] values, final int offset) {
return newDirectDoubleBuffer(values, offset, values.length - offset);
}
- public DoubleBuffer newDirectDoubleBuffer(double[] values) {
+ public DoubleBuffer newDirectDoubleBuffer(final double[] values) {
return newDirectDoubleBuffer(values, 0);
}
- public FloatBuffer newDirectFloatBuffer(int numElements) {
+ public FloatBuffer newDirectFloatBuffer(final int numElements) {
return newDirectByteBuffer(numElements * Buffers.SIZEOF_FLOAT).asFloatBuffer();
}
- public FloatBuffer newDirectFloatBuffer(float[] values, int offset, int lenght) {
+ public FloatBuffer newDirectFloatBuffer(final float[] values, final int offset, final int lenght) {
return (FloatBuffer)newDirectFloatBuffer(lenght).put(values, offset, lenght).rewind();
}
- public FloatBuffer newDirectFloatBuffer(float[] values, int offset) {
+ public FloatBuffer newDirectFloatBuffer(final float[] values, final int offset) {
return newDirectFloatBuffer(values, offset, values.length - offset);
}
- public FloatBuffer newDirectFloatBuffer(float[] values) {
+ public FloatBuffer newDirectFloatBuffer(final float[] values) {
return newDirectFloatBuffer(values, 0);
}
- public IntBuffer newDirectIntBuffer(int numElements) {
+ public IntBuffer newDirectIntBuffer(final int numElements) {
return newDirectByteBuffer(numElements * Buffers.SIZEOF_INT).asIntBuffer();
}
- public IntBuffer newDirectIntBuffer(int[] values, int offset, int lenght) {
+ public IntBuffer newDirectIntBuffer(final int[] values, final int offset, final int lenght) {
return (IntBuffer)newDirectIntBuffer(lenght).put(values, offset, lenght).rewind();
}
- public IntBuffer newDirectIntBuffer(int[] values, int offset) {
+ public IntBuffer newDirectIntBuffer(final int[] values, final int offset) {
return newDirectIntBuffer(values, offset, values.length - offset);
}
- public IntBuffer newDirectIntBuffer(int[] values) {
+ public IntBuffer newDirectIntBuffer(final int[] values) {
return newDirectIntBuffer(values, 0);
}
- public LongBuffer newDirectLongBuffer(int numElements) {
+ public LongBuffer newDirectLongBuffer(final int numElements) {
return newDirectByteBuffer(numElements * Buffers.SIZEOF_LONG).asLongBuffer();
}
- public LongBuffer newDirectLongBuffer(long[] values, int offset, int lenght) {
+ public LongBuffer newDirectLongBuffer(final long[] values, final int offset, final int lenght) {
return (LongBuffer)newDirectLongBuffer(lenght).put(values, offset, lenght).rewind();
}
- public LongBuffer newDirectLongBuffer(long[] values, int offset) {
+ public LongBuffer newDirectLongBuffer(final long[] values, final int offset) {
return newDirectLongBuffer(values, offset, values.length - offset);
}
- public LongBuffer newDirectLongBuffer(long[] values) {
+ public LongBuffer newDirectLongBuffer(final long[] values) {
return newDirectLongBuffer(values, 0);
}
- public ShortBuffer newDirectShortBuffer(int numElements) {
+ public ShortBuffer newDirectShortBuffer(final int numElements) {
return newDirectByteBuffer(numElements * Buffers.SIZEOF_SHORT).asShortBuffer();
}
- public ShortBuffer newDirectShortBuffer(short[] values, int offset, int lenght) {
+ public ShortBuffer newDirectShortBuffer(final short[] values, final int offset, final int lenght) {
return (ShortBuffer)newDirectShortBuffer(lenght).put(values, offset, lenght).rewind();
}
- public ShortBuffer newDirectShortBuffer(short[] values, int offset) {
+ public ShortBuffer newDirectShortBuffer(final short[] values, final int offset) {
return newDirectShortBuffer(values, offset, values.length - offset);
}
- public ShortBuffer newDirectShortBuffer(short[] values) {
+ public ShortBuffer newDirectShortBuffer(final short[] values) {
return newDirectShortBuffer(values, 0);
}
- public CharBuffer newDirectCharBuffer(int numElements) {
+ public CharBuffer newDirectCharBuffer(final int numElements) {
return newDirectByteBuffer(numElements * Buffers.SIZEOF_SHORT).asCharBuffer();
}
- public CharBuffer newDirectCharBuffer(char[] values, int offset, int lenght) {
+ public CharBuffer newDirectCharBuffer(final char[] values, final int offset, final int lenght) {
return (CharBuffer)newDirectCharBuffer(lenght).put(values, offset, lenght).rewind();
}
- public CharBuffer newDirectCharBuffer(char[] values, int offset) {
+ public CharBuffer newDirectCharBuffer(final char[] values, final int offset) {
return newDirectCharBuffer(values, offset, values.length - offset);
}
- public CharBuffer newDirectCharBuffer(char[] values) {
+ public CharBuffer newDirectCharBuffer(final char[] values) {
return newDirectCharBuffer(values, 0);
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (obj == null) {
return false;
}
@@ -335,12 +335,12 @@ public class CachedBufferFactory {
super();
}
- private SynchronizedCachedBufferFactory(int size, int step) {
+ private SynchronizedCachedBufferFactory(final int size, final int step) {
super(size, step);
}
@Override
- public synchronized ByteBuffer newDirectByteBuffer(int size) {
+ public synchronized ByteBuffer newDirectByteBuffer(final int size) {
return super.newDirectByteBuffer(size);
}
diff --git a/src/java/com/jogamp/common/nio/PointerBuffer.java b/src/java/com/jogamp/common/nio/PointerBuffer.java
index 5d470d5..e9138ac 100644
--- a/src/java/com/jogamp/common/nio/PointerBuffer.java
+++ b/src/java/com/jogamp/common/nio/PointerBuffer.java
@@ -57,17 +57,17 @@ public class PointerBuffer extends AbstractBuffer<PointerBuffer> {
}
/** no backup array, use for direct usage only */
- static PointerBuffer create(ByteBuffer bb) {
+ static PointerBuffer create(final ByteBuffer bb) {
return Platform.is32Bit() ? new PointerBuffer( bb.asIntBuffer() ) : new PointerBuffer( bb.asLongBuffer() );
}
/** supports backup array */
- PointerBuffer(IntBuffer b) {
+ PointerBuffer(final IntBuffer b) {
super(b, ELEMENT_SIZE, b.capacity());
}
/** supports backup array */
- PointerBuffer(LongBuffer b) {
+ PointerBuffer(final LongBuffer b) {
super(b, ELEMENT_SIZE, b.capacity());
}
@@ -79,7 +79,7 @@ public class PointerBuffer extends AbstractBuffer<PointerBuffer> {
}
/** Returns a non direct PointerBuffer in native order, having a backup array */
- public static PointerBuffer allocate(int size) {
+ public static PointerBuffer allocate(final int size) {
if (Platform.is32Bit()) {
return new PointerBuffer(IntBuffer.wrap(new int[size]));
} else {
@@ -88,11 +88,11 @@ public class PointerBuffer extends AbstractBuffer<PointerBuffer> {
}
/** Returns a direct PointerBuffer in native order, w/o backup array */
- public static PointerBuffer allocateDirect(int size) {
+ public static PointerBuffer allocateDirect(final int size) {
return create(Buffers.newDirectByteBuffer(ELEMENT_SIZE * size));
}
- public static PointerBuffer wrap(ByteBuffer src) {
+ public static PointerBuffer wrap(final ByteBuffer src) {
return create(src);
}
@@ -118,7 +118,7 @@ public class PointerBuffer extends AbstractBuffer<PointerBuffer> {
* Relative bulk get method. Copy the source values <code> src[position .. capacity] [</code>
* to this buffer and increment the position by <code>capacity-position</code>. */
@Override
- public final PointerBuffer put(PointerBuffer src) {
+ public final PointerBuffer put(final PointerBuffer src) {
if (remaining() < src.remaining()) {
throw new IndexOutOfBoundsException();
}
@@ -132,7 +132,7 @@ public class PointerBuffer extends AbstractBuffer<PointerBuffer> {
final long addr = src.get();
put(addr);
if( null != src.dataMap) {
- Buffer bb = (Buffer) src.dataMap.get(addr);
+ final Buffer bb = (Buffer) src.dataMap.get(addr);
if(null!=bb) {
validateDataMap();
dataMap.put(addr, bb);
@@ -150,19 +150,19 @@ public class PointerBuffer extends AbstractBuffer<PointerBuffer> {
/** Relative get method. Get the pointer value at the current position and increment the position by one. */
@Override
public final long get() {
- long r = get(position);
+ final long r = get(position);
position++;
return r;
}
/** Absolute get method. Get the pointer value at the given index */
@Override
- public final long get(int idx) {
+ public final long get(final int idx) {
if (0 > idx || idx >= capacity) {
throw new IndexOutOfBoundsException();
}
if (Platform.is32Bit()) {
- return (long) ((IntBuffer) buffer).get(idx) & 0x00000000FFFFFFFFL;
+ return ((IntBuffer) buffer).get(idx) & 0x00000000FFFFFFFFL;
} else {
return ((LongBuffer) buffer).get(idx);
}
@@ -172,7 +172,7 @@ public class PointerBuffer extends AbstractBuffer<PointerBuffer> {
* Relative bulk get method. Copy the pointer values <code> [ position .. position+length [</code>
* to the destination array <code> [ dest[offset] .. dest[offset+length] [ </code>
* and increment the position by <code>length</code>. */
- public final PointerBuffer get(long[] dest, int offset, int length) {
+ public final PointerBuffer get(final long[] dest, int offset, int length) {
if (dest.length<offset+length) {
throw new IndexOutOfBoundsException();
}
@@ -188,7 +188,7 @@ public class PointerBuffer extends AbstractBuffer<PointerBuffer> {
/** Absolute put method. Put the pointer value at the given index */
@Override
- public final PointerBuffer put(int idx, long v) {
+ public final PointerBuffer put(final int idx, final long v) {
if (0 > idx || idx >= capacity) {
throw new IndexOutOfBoundsException();
}
@@ -202,7 +202,7 @@ public class PointerBuffer extends AbstractBuffer<PointerBuffer> {
/** Relative put method. Put the pointer value at the current position and increment the position by one. */
@Override
- public final PointerBuffer put(long value) {
+ public final PointerBuffer put(final long value) {
put(position, value);
position++;
return this;
@@ -211,7 +211,7 @@ public class PointerBuffer extends AbstractBuffer<PointerBuffer> {
/**
* Relative bulk put method. Put the pointer values <code> [ src[offset] .. src[offset+length] [</code>
* at the current position and increment the position by <code>length</code>. */
- public final PointerBuffer put(long[] src, int offset, int length) {
+ public final PointerBuffer put(final long[] src, int offset, int length) {
if (src.length<offset+length) {
throw new IndexOutOfBoundsException();
}
@@ -231,15 +231,15 @@ public class PointerBuffer extends AbstractBuffer<PointerBuffer> {
@throws IllegalArgumentException if bb is null or not a direct buffer
*/
- public final PointerBuffer referenceBuffer(int index, Buffer bb) {
+ public final PointerBuffer referenceBuffer(final int index, final Buffer bb) {
if(null==bb) {
throw new IllegalArgumentException("Buffer is null");
}
if(!Buffers.isDirect(bb)) {
throw new IllegalArgumentException("Buffer is not direct");
}
- long mask = Platform.is32Bit() ? 0x00000000FFFFFFFFL : 0xFFFFFFFFFFFFFFFFL ;
- long bbAddr = getDirectBufferAddressImpl(bb) & mask;
+ final long mask = Platform.is32Bit() ? 0x00000000FFFFFFFFL : 0xFFFFFFFFFFFFFFFFL ;
+ final long bbAddr = getDirectBufferAddressImpl(bb) & mask;
if(0==bbAddr) {
throw new RuntimeException("Couldn't determine native address of given Buffer: "+bb);
}
@@ -252,22 +252,22 @@ public class PointerBuffer extends AbstractBuffer<PointerBuffer> {
/** Put the address of the given direct Buffer at the end
of this pointer array.
Adding a reference of the given direct Buffer to this object. */
- public final PointerBuffer referenceBuffer(Buffer bb) {
+ public final PointerBuffer referenceBuffer(final Buffer bb) {
referenceBuffer(position, bb);
position++;
return this;
}
- public final Buffer getReferencedBuffer(int index) {
+ public final Buffer getReferencedBuffer(final int index) {
if(null != dataMap) {
- long addr = get(index);
+ final long addr = get(index);
return (Buffer) dataMap.get(addr);
}
return null;
}
public final Buffer getReferencedBuffer() {
- Buffer bb = getReferencedBuffer(position);
+ final Buffer bb = getReferencedBuffer(position);
position++;
return bb;
}
diff --git a/src/java/com/jogamp/common/nio/StructAccessor.java b/src/java/com/jogamp/common/nio/StructAccessor.java
index b1593fe..af7b6d1 100644
--- a/src/java/com/jogamp/common/nio/StructAccessor.java
+++ b/src/java/com/jogamp/common/nio/StructAccessor.java
@@ -48,7 +48,7 @@ public class StructAccessor {
private final ByteBuffer bb;
- public StructAccessor(ByteBuffer bb) {
+ public StructAccessor(final ByteBuffer bb) {
// Setting of byte order is concession to native code which needs
// to instantiate these
this.bb = bb.order(ByteOrder.nativeOrder());
@@ -64,7 +64,7 @@ public class StructAccessor {
* bytes. Note that this method is not thread-safe with respect to
* the other methods in this class.
*/
- public final ByteBuffer slice(int byteOffset, int byteLength) {
+ public final ByteBuffer slice(final int byteOffset, final int byteLength) {
bb.position(byteOffset);
bb.limit(byteOffset + byteLength);
final ByteBuffer newBuf = bb.slice().order(bb.order()); // slice and duplicate may change byte order
@@ -74,47 +74,47 @@ public class StructAccessor {
}
/** Retrieves the byte at the specified byteOffset. */
- public final byte getByteAt(int byteOffset) {
+ public final byte getByteAt(final int byteOffset) {
return bb.get(byteOffset);
}
/** Puts a byte at the specified byteOffset. */
- public final void setByteAt(int byteOffset, byte v) {
+ public final void setByteAt(final int byteOffset, final byte v) {
bb.put(byteOffset, v);
}
/** Retrieves the char at the specified byteOffset. */
- public final char getCharAt(int byteOffset) {
+ public final char getCharAt(final int byteOffset) {
return bb.getChar(byteOffset);
}
/** Puts a char at the specified byteOffset. */
- public final void setCharAt(int byteOffset, char v) {
+ public final void setCharAt(final int byteOffset, final char v) {
bb.putChar(byteOffset, v);
}
/** Retrieves the short at the specified byteOffset. */
- public final short getShortAt(int byteOffset) {
+ public final short getShortAt(final int byteOffset) {
return bb.getShort(byteOffset);
}
/** Puts a short at the specified byteOffset. */
- public final void setShortAt(int byteOffset, short v) {
+ public final void setShortAt(final int byteOffset, final short v) {
bb.putShort(byteOffset, v);
}
/** Retrieves the int at the specified byteOffset. */
- public final int getIntAt(int byteOffset) {
+ public final int getIntAt(final int byteOffset) {
return bb.getInt(byteOffset);
}
/** Puts a int at the specified byteOffset. */
- public final void setIntAt(int byteOffset, int v) {
+ public final void setIntAt(final int byteOffset, final int v) {
bb.putInt(byteOffset, v);
}
/** Retrieves the int at the specified byteOffset. */
- public final int getIntAt(int byteOffset, int nativeSizeInBytes) {
+ public final int getIntAt(final int byteOffset, final int nativeSizeInBytes) {
switch(nativeSizeInBytes) {
case 2:
return bb.getShort(byteOffset) & 0x0000FFFF ;
@@ -128,7 +128,7 @@ public class StructAccessor {
}
/** Puts a int at the specified byteOffset. */
- public final void setIntAt(int byteOffset, int v, int nativeSizeInBytes) {
+ public final void setIntAt(final int byteOffset, final int v, final int nativeSizeInBytes) {
switch(nativeSizeInBytes) {
case 2:
bb.putShort(byteOffset, (short) ( v & 0x0000FFFF ) );
@@ -145,37 +145,37 @@ public class StructAccessor {
}
/** Retrieves the float at the specified byteOffset. */
- public final float getFloatAt(int byteOffset) {
+ public final float getFloatAt(final int byteOffset) {
return bb.getFloat(byteOffset);
}
/** Puts a float at the specified byteOffset. */
- public final void setFloatAt(int byteOffset, float v) {
+ public final void setFloatAt(final int byteOffset, final float v) {
bb.putFloat(byteOffset, v);
}
/** Retrieves the double at the specified byteOffset. */
- public final double getDoubleAt(int byteOffset) {
+ public final double getDoubleAt(final int byteOffset) {
return bb.getDouble(byteOffset);
}
/** Puts a double at the specified byteOffset. */
- public final void setDoubleAt(int byteOffset, double v) {
+ public final void setDoubleAt(final int byteOffset, final double v) {
bb.putDouble(byteOffset, v);
}
/** Retrieves the long at the specified byteOffset. */
- public final long getLongAt(int byteOffset) {
+ public final long getLongAt(final int byteOffset) {
return bb.getLong(byteOffset);
}
/** Puts a long at the specified byteOffset. */
- public final void setLongAt(int byteOffset, long v) {
+ public final void setLongAt(final int byteOffset, final long v) {
bb.putLong(byteOffset, v);
}
/** Retrieves the long at the specified byteOffset. */
- public final long getLongAt(int byteOffset, int nativeSizeInBytes) {
+ public final long getLongAt(final int byteOffset, final int nativeSizeInBytes) {
switch(nativeSizeInBytes) {
case 4:
return bb.getInt(byteOffset) & 0x00000000FFFFFFFFL;
@@ -187,7 +187,7 @@ public class StructAccessor {
}
/** Puts a long at the specified byteOffset. */
- public final void setLongAt(int byteOffset, long v, int nativeSizeInBytes) {
+ public final void setLongAt(final int byteOffset, final long v, final int nativeSizeInBytes) {
switch(nativeSizeInBytes) {
case 4:
bb.putInt(byteOffset, (int) ( v & 0x00000000FFFFFFFFL ) );
@@ -200,91 +200,91 @@ public class StructAccessor {
}
}
- public final void setBytesAt(int byteOffset, byte[] v) {
+ public final void setBytesAt(int byteOffset, final byte[] v) {
for (int i = 0; i < v.length; i++) {
bb.put(byteOffset++, v[i]);
}
}
- public final byte[] getBytesAt(int byteOffset, byte[] v) {
+ public final byte[] getBytesAt(int byteOffset, final byte[] v) {
for (int i = 0; i < v.length; i++) {
v[i] = bb.get(byteOffset++);
}
return v;
}
- public final void setCharsAt(int byteOffset, char[] v) {
+ public final void setCharsAt(int byteOffset, final char[] v) {
for (int i = 0; i < v.length; i++, byteOffset+=2) {
bb.putChar(byteOffset, v[i]);
}
}
- public final char[] getCharsAt(int byteOffset, char[] v) {
+ public final char[] getCharsAt(int byteOffset, final char[] v) {
for (int i = 0; i < v.length; i++, byteOffset+=2) {
v[i] = bb.getChar(byteOffset);
}
return v;
}
- public final void setShortsAt(int byteOffset, short[] v) {
+ public final void setShortsAt(int byteOffset, final short[] v) {
for (int i = 0; i < v.length; i++, byteOffset+=2) {
bb.putShort(byteOffset, v[i]);
}
}
- public final short[] getShortsAt(int byteOffset, short[] v) {
+ public final short[] getShortsAt(int byteOffset, final short[] v) {
for (int i = 0; i < v.length; i++, byteOffset+=2) {
v[i] = bb.getShort(byteOffset);
}
return v;
}
- public final void setIntsAt(int byteOffset, int[] v) {
+ public final void setIntsAt(int byteOffset, final int[] v) {
for (int i = 0; i < v.length; i++, byteOffset+=4) {
bb.putInt(byteOffset, v[i]);
}
}
- public final int[] getIntsAt(int byteOffset, int[] v) {
+ public final int[] getIntsAt(int byteOffset, final int[] v) {
for (int i = 0; i < v.length; i++, byteOffset+=4) {
v[i] = bb.getInt(byteOffset);
}
return v;
}
- public final void setFloatsAt(int byteOffset, float[] v) {
+ public final void setFloatsAt(int byteOffset, final float[] v) {
for (int i = 0; i < v.length; i++, byteOffset+=4) {
bb.putFloat(byteOffset, v[i]);
}
}
- public final float[] getFloatsAt(int byteOffset, float[] v) {
+ public final float[] getFloatsAt(int byteOffset, final float[] v) {
for (int i = 0; i < v.length; i++, byteOffset+=4) {
v[i] = bb.getFloat(byteOffset);
}
return v;
}
- public final void setDoublesAt(int byteOffset, double[] v) {
+ public final void setDoublesAt(int byteOffset, final double[] v) {
for (int i = 0; i < v.length; i++, byteOffset+=8) {
bb.putDouble(byteOffset, v[i]);
}
}
- public final double[] getDoublesAt(int byteOffset, double[] v) {
+ public final double[] getDoublesAt(int byteOffset, final double[] v) {
for (int i = 0; i < v.length; i++, byteOffset+=8) {
v[i] = bb.getDouble(byteOffset);
}
return v;
}
- public final void setLongsAt(int byteOffset, long[] v) {
+ public final void setLongsAt(int byteOffset, final long[] v) {
for (int i = 0; i < v.length; i++, byteOffset+=8) {
bb.putLong(byteOffset, v[i]);
}
}
- public final long[] getLongsAt(int byteOffset, long[] v) {
+ public final long[] getLongsAt(int byteOffset, final long[] v) {
for (int i = 0; i < v.length; i++, byteOffset+=8) {
v[i] = bb.getLong(byteOffset);
}
diff --git a/src/java/com/jogamp/common/os/AndroidVersion.java b/src/java/com/jogamp/common/os/AndroidVersion.java
index edf2229..adfb1ef 100644
--- a/src/java/com/jogamp/common/os/AndroidVersion.java
+++ b/src/java/com/jogamp/common/os/AndroidVersion.java
@@ -82,7 +82,7 @@ public class AndroidVersion {
* </pre>
* </p>
*/
- private static final CPUType getCPUTypeImpl(String cpuABI) {
+ private static final CPUType getCPUTypeImpl(final String cpuABI) {
if( null == cpuABI ) {
return null;
} else if( cpuABI.equals("armeabi-v7a") ) {
@@ -98,7 +98,7 @@ public class AndroidVersion {
return null;
}
}
- private static final ABIType getABITypeImpl(final CPUType cpuType, String cpuABI) {
+ private static final ABIType getABITypeImpl(final CPUType cpuType, final String cpuABI) {
if( null == cpuType || null == cpuABI ) {
return null;
} else if( CPUFamily.ARM != cpuType.family ) {
@@ -122,7 +122,7 @@ public class AndroidVersion {
abvObject = abvClass.newInstance();
abvcClass = ReflectionUtil.getClass(androidBuildVersionCodes, true, cl);
abvcObject = abvcClass.newInstance();
- } catch (Exception e) { /* n/a */ }
+ } catch (final Exception e) { /* n/a */ }
isAvailable = null != abObject && null != abvObject && null != abvcObject;
if(isAvailable) {
CPU_ABI = getString(abClass, abObject, "CPU_ABI", true);
@@ -149,38 +149,38 @@ public class AndroidVersion {
ABI_TYPE2 = getABITypeImpl(CPU_TYPE2, CPU_ABI2);
}
- private static final IntObjectHashMap getVersionCodes(Class<?> cls, Object obj) {
+ private static final IntObjectHashMap getVersionCodes(final Class<?> cls, final Object obj) {
final Field[] fields = cls.getFields();
- IntObjectHashMap map = new IntObjectHashMap( 3 * fields.length / 2, 0.75f );
+ final IntObjectHashMap map = new IntObjectHashMap( 3 * fields.length / 2, 0.75f );
for(int i=0; i<fields.length; i++) {
try {
final int version = fields[i].getInt(obj);
final String version_name = fields[i].getName();
// System.err.println(i+": "+version+": "+version_name);
map.put(new Integer(version), version_name);
- } catch (Exception e) { e.printStackTrace(); /* n/a */ }
+ } catch (final Exception e) { e.printStackTrace(); /* n/a */ }
}
return map;
}
- private static final String getString(Class<?> cls, Object obj, String name, boolean lowerCase) {
+ private static final String getString(final Class<?> cls, final Object obj, final String name, final boolean lowerCase) {
try {
- Field f = cls.getField(name);
+ final Field f = cls.getField(name);
final String s = (String) f.get(obj);
if( lowerCase && null != s ) {
return s.toLowerCase();
} else {
return s;
}
- } catch (Exception e) { e.printStackTrace(); /* n/a */ }
+ } catch (final Exception e) { e.printStackTrace(); /* n/a */ }
return null;
}
- private static final int getInt(Class<?> cls, Object obj, String name) {
+ private static final int getInt(final Class<?> cls, final Object obj, final String name) {
try {
- Field f = cls.getField(name);
+ final Field f = cls.getField(name);
return f.getInt(obj);
- } catch (Exception e) { e.printStackTrace(); /* n/a */ }
+ } catch (final Exception e) { e.printStackTrace(); /* n/a */ }
return -1;
}
diff --git a/src/java/com/jogamp/common/os/DynamicLibraryBundle.java b/src/java/com/jogamp/common/os/DynamicLibraryBundle.java
index 4013203..ec76154 100644
--- a/src/java/com/jogamp/common/os/DynamicLibraryBundle.java
+++ b/src/java/com/jogamp/common/os/DynamicLibraryBundle.java
@@ -88,7 +88,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
* is being used to help locating the native libraries.
* </p>
*/
- public DynamicLibraryBundle(DynamicLibraryBundleInfo info) {
+ public DynamicLibraryBundle(final DynamicLibraryBundleInfo info) {
if(null==info) {
throw new RuntimeException("Null DynamicLibraryBundleInfo");
}
@@ -191,7 +191,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
return 0 < toolLibLoadedNumber;
}
- public final boolean isToolLibLoaded(int i) {
+ public final boolean isToolLibLoaded(final int i) {
if(0 <= i && i < toolLibLoaded.length) {
return toolLibLoaded[i];
}
@@ -217,7 +217,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
return 0 == getGlueLibNumber() || isGlueLibLoaded(getGlueLibNumber() - 1);
}
- public final boolean isGlueLibLoaded(int i) {
+ public final boolean isGlueLibLoaded(final int i) {
if(0 <= i && i < glueLibLoaded.length) {
return glueLibLoaded[i];
}
@@ -241,7 +241,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
return aptr;
}
- protected final NativeLibrary loadFirstAvailable(List<String> libNames, ClassLoader loader, boolean global) {
+ protected final NativeLibrary loadFirstAvailable(final List<String> libNames, final ClassLoader loader, final boolean global) {
for (int i=0; i < libNames.size(); i++) {
final NativeLibrary lib = NativeLibrary.open(libNames.get(i), loader, global);
if (lib != null) {
@@ -285,14 +285,14 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
glueLibLoadedNumber = 0;
for (i=0; i < glueLibNames.size(); i++) {
final String libName = glueLibNames.get(i);
- boolean ignoreError = true;
+ final boolean ignoreError = true;
boolean res;
try {
res = GlueJNILibLoader.loadLibrary(libName, ignoreError, cl);
if(DEBUG && !res) {
System.err.println("Info: Could not load JNI/Glue library: "+libName);
}
- } catch (UnsatisfiedLinkError e) {
+ } catch (final UnsatisfiedLinkError e) {
res = false;
if(DEBUG) {
System.err.println("Unable to load JNI/Glue library: "+libName);
@@ -306,7 +306,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
}
}
- private final long dynamicLookupFunctionOnLibs(String funcName) {
+ private final long dynamicLookupFunctionOnLibs(final String funcName) {
if(!isToolLibLoaded() || null==funcName) {
if(DEBUG_LOOKUP && !isToolLibLoaded()) {
System.err.println("Lookup-Native: <" + funcName + "> ** FAILED ** Tool native library not loaded");
@@ -326,7 +326,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
addr = lib.dynamicLookupFunction(funcName);
}
if(DEBUG_LOOKUP) {
- String libName = ( null == lib ) ? "GLOBAL" : lib.toString();
+ final String libName = ( null == lib ) ? "GLOBAL" : lib.toString();
if(0!=addr) {
System.err.println("Lookup-Native: <" + funcName + "> 0x" + Long.toHexString(addr) + " in lib " + libName );
} else {
@@ -336,9 +336,9 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
return addr;
}
- private final long toolDynamicLookupFunction(String funcName) {
+ private final long toolDynamicLookupFunction(final String funcName) {
if(0 != toolGetProcAddressHandle) {
- long addr = info.toolGetProcAddress(toolGetProcAddressHandle, funcName);
+ final long addr = info.toolGetProcAddress(toolGetProcAddressHandle, funcName);
if(DEBUG_LOOKUP) {
if(0!=addr) {
System.err.println("Lookup-Tool: <"+funcName+"> 0x"+Long.toHexString(addr));
@@ -350,7 +350,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
}
@Override
- public final long dynamicLookupFunction(String funcName) {
+ public final long dynamicLookupFunction(final String funcName) {
if(!isToolLibLoaded() || null==funcName) {
if(DEBUG_LOOKUP && !isToolLibLoaded()) {
System.err.println("Lookup: <" + funcName + "> ** FAILED ** Tool native library not loaded");
@@ -378,13 +378,13 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
}
@Override
- public final boolean isFunctionAvailable(String funcName) {
+ public final boolean isFunctionAvailable(final String funcName) {
return 0 != dynamicLookupFunction(funcName);
}
/** Inherit access */
static final class GlueJNILibLoader extends JNILibLoaderBase {
- protected static synchronized boolean loadLibrary(String libname, boolean ignoreError, ClassLoader cl) {
+ protected static synchronized boolean loadLibrary(final String libname, final boolean ignoreError, final ClassLoader cl) {
return JNILibLoaderBase.loadLibrary(libname, ignoreError, cl);
}
}
diff --git a/src/java/com/jogamp/common/os/MachineDescription.java b/src/java/com/jogamp/common/os/MachineDescription.java
index 8ff3ff7..ca9819a 100644
--- a/src/java/com/jogamp/common/os/MachineDescription.java
+++ b/src/java/com/jogamp/common/os/MachineDescription.java
@@ -64,7 +64,7 @@ public class MachineDescription {
public final Platform.CPUType cpu;
- ID(Platform.CPUType cpu){
+ ID(final Platform.CPUType cpu){
this.cpu = cpu;
}
}
@@ -106,7 +106,7 @@ public class MachineDescription {
public final ID id;
public final MachineDescription md;
- StaticConfig(ID id, boolean littleEndian, int[] sizes, int[] alignments) {
+ StaticConfig(final ID id, final boolean littleEndian, final int[] sizes, final int[] alignments) {
this.id = id;
int i=0, j=0;
this.md = new MachineDescription(false, littleEndian,
@@ -174,27 +174,27 @@ public class MachineDescription {
final private int ldoubleAlignmentInBytes;
final private int pointerAlignmentInBytes;
- public MachineDescription(boolean runtimeValidated,
- boolean littleEndian,
-
- int intSizeInBytes,
- int longSizeInBytes,
- int floatSizeInBytes,
- int doubleSizeInBytes,
- int ldoubleSizeInBytes,
- int pointerSizeInBytes,
- int pageSizeInBytes,
-
- int int8AlignmentInBytes,
- int int16AlignmentInBytes,
- int int32AlignmentInBytes,
- int int64AlignmentInBytes,
- int intAlignmentInBytes,
- int longAlignmentInBytes,
- int floatAlignmentInBytes,
- int doubleAlignmentInBytes,
- int ldoubleAlignmentInBytes,
- int pointerAlignmentInBytes) {
+ public MachineDescription(final boolean runtimeValidated,
+ final boolean littleEndian,
+
+ final int intSizeInBytes,
+ final int longSizeInBytes,
+ final int floatSizeInBytes,
+ final int doubleSizeInBytes,
+ final int ldoubleSizeInBytes,
+ final int pointerSizeInBytes,
+ final int pageSizeInBytes,
+
+ final int int8AlignmentInBytes,
+ final int int16AlignmentInBytes,
+ final int int32AlignmentInBytes,
+ final int int64AlignmentInBytes,
+ final int intAlignmentInBytes,
+ final int longAlignmentInBytes,
+ final int floatAlignmentInBytes,
+ final int doubleAlignmentInBytes,
+ final int ldoubleAlignmentInBytes,
+ final int pointerAlignmentInBytes) {
this.runtimeValidated = runtimeValidated;
this.littleEndian = littleEndian;
@@ -273,14 +273,14 @@ public class MachineDescription {
/**
* @return number of pages required for size in bytes
*/
- public int pageCount(int size) {
+ public int pageCount(final int size) {
return ( size + ( pageSizeInBytes - 1) ) / pageSizeInBytes ; // integer arithmetic
}
/**
* @return page aligned size in bytes
*/
- public int pageAlignedSize(int size) {
+ public int pageAlignedSize(final int size) {
return pageCount(size) * pageSizeInBytes;
}
@@ -292,7 +292,7 @@ public class MachineDescription {
* otherwise <code>false</code>.
*/
@Override
- public final boolean equals(Object obj) {
+ public final boolean equals(final Object obj) {
if (this == obj) { return true; }
if ( !(obj instanceof MachineDescription) ) { return false; }
final MachineDescription md = (MachineDescription) obj;
@@ -308,7 +308,7 @@ public class MachineDescription {
* @return <code>true</code> if the two MachineDescription are equal;
* otherwise <code>false</code>.
*/
- public final boolean compatible(MachineDescription md) {
+ public final boolean compatible(final MachineDescription md) {
return littleEndian == md.littleEndian &&
intSizeInBytes == md.intSizeInBytes &&
diff --git a/src/java/com/jogamp/common/os/NativeLibrary.java b/src/java/com/jogamp/common/os/NativeLibrary.java
index b6ed7ad..e54f5e6 100644
--- a/src/java/com/jogamp/common/os/NativeLibrary.java
+++ b/src/java/com/jogamp/common/os/NativeLibrary.java
@@ -123,7 +123,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
private final boolean global;
// Private constructor to prevent arbitrary instances from floating around
- private NativeLibrary(long libraryHandle, String libraryPath, boolean global) {
+ private NativeLibrary(final long libraryHandle, final String libraryPath, final boolean global) {
this.libraryHandle = libraryHandle;
this.libraryPath = libraryPath;
this.global = global;
@@ -141,7 +141,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
name on all platforms, looking first in the system's search
path, and in the context of the specified ClassLoader, which is
used to help find the library in the case of e.g. Java Web Start. */
- public static final NativeLibrary open(String libName, ClassLoader loader) {
+ public static final NativeLibrary open(final String libName, final ClassLoader loader) {
return open(libName, libName, libName, true, loader, true);
}
@@ -149,7 +149,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
name on all platforms, looking first in the system's search
path, and in the context of the specified ClassLoader, which is
used to help find the library in the case of e.g. Java Web Start. */
- public static final NativeLibrary open(String libName, ClassLoader loader, boolean global) {
+ public static final NativeLibrary open(final String libName, final ClassLoader loader, final boolean global) {
return open(libName, libName, libName, true, loader, global);
}
@@ -168,27 +168,27 @@ public final class NativeLibrary implements DynamicLookupHelper {
dynamic loading facility is used correctly the version number
will be irrelevant.
*/
- public static final NativeLibrary open(String windowsLibName,
- String unixLibName,
- String macOSXLibName,
- boolean searchSystemPathFirst,
- ClassLoader loader) {
+ public static final NativeLibrary open(final String windowsLibName,
+ final String unixLibName,
+ final String macOSXLibName,
+ final boolean searchSystemPathFirst,
+ final ClassLoader loader) {
return open(windowsLibName, unixLibName, macOSXLibName, searchSystemPathFirst, loader, true);
}
- public static final NativeLibrary open(String windowsLibName,
- String unixLibName,
- String macOSXLibName,
- boolean searchSystemPathFirst,
- ClassLoader loader, boolean global) {
- List<String> possiblePaths = enumerateLibraryPaths(windowsLibName,
+ public static final NativeLibrary open(final String windowsLibName,
+ final String unixLibName,
+ final String macOSXLibName,
+ final boolean searchSystemPathFirst,
+ final ClassLoader loader, final boolean global) {
+ final List<String> possiblePaths = enumerateLibraryPaths(windowsLibName,
unixLibName,
macOSXLibName,
searchSystemPathFirst,
loader);
Platform.initSingleton(); // loads native gluegen-rt library
// Iterate down these and see which one if any we can actually find.
- for (Iterator<String> iter = possiblePaths.iterator(); iter.hasNext(); ) {
+ for (final Iterator<String> iter = possiblePaths.iterator(); iter.hasNext(); ) {
final String path = iter.next();
if (DEBUG) {
System.err.println("NativeLibrary.open(global "+global+"): Trying to load " + path);
@@ -201,7 +201,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
} else {
res = dynLink.openLibraryLocal(path, DEBUG);
}
- } catch (Throwable t1) {
+ } catch (final Throwable t1) {
t = t1;
res = 0;
}
@@ -214,7 +214,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
String errstr;
try {
errstr = dynLink.getLastError();
- } catch (Throwable t2) { errstr=null; }
+ } catch (final Throwable t2) { errstr=null; }
System.err.println("NativeLibrary.open: Last error "+errstr);
if( null != t ) {
t.printStackTrace();
@@ -233,7 +233,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
}
@Override
- public final long dynamicLookupFunction(String funcName) {
+ public final long dynamicLookupFunction(final String funcName) {
if ( 0 == libraryHandle ) {
throw new RuntimeException("Library is not open");
}
@@ -241,7 +241,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
}
@Override
- public final boolean isFunctionAvailable(String funcName) {
+ public final boolean isFunctionAvailable(final String funcName) {
if ( 0 == libraryHandle ) {
throw new RuntimeException("Library is not open");
}
@@ -249,12 +249,12 @@ public final class NativeLibrary implements DynamicLookupHelper {
}
/** Looks up the given function name in all loaded libraries. */
- public static final long dynamicLookupFunctionGlobal(String funcName) {
+ public static final long dynamicLookupFunctionGlobal(final String funcName) {
return dynLink.lookupSymbolGlobal(funcName);
}
/** Looks up the given function name in all loaded libraries. */
- public static final boolean isFunctionAvailableGlobal(String funcName) {
+ public static final boolean isFunctionAvailableGlobal(final String funcName) {
return 0 != dynLink.lookupSymbolGlobal(funcName);
}
@@ -279,7 +279,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
if ( 0 == libraryHandle ) {
throw new RuntimeException("Library already closed");
}
- long handle = libraryHandle;
+ final long handle = libraryHandle;
libraryHandle = 0;
dynLink.closeLibrary(handle);
if (DEBUG) {
@@ -297,11 +297,11 @@ public final class NativeLibrary implements DynamicLookupHelper {
*
* @return basename of libName w/o path, ie. /usr/lib/libDrinkBeer.so -> DrinkBeer on Unix systems, but null on Windows.
*/
- public static final String isValidNativeLibraryName(String libName, boolean isLowerCaseAlready) {
+ public static final String isValidNativeLibraryName(final String libName, final boolean isLowerCaseAlready) {
final String libBaseName;
try {
libBaseName = IOUtil.getBasename(libName);
- } catch (URISyntaxException uriEx) {
+ } catch (final URISyntaxException uriEx) {
throw new IllegalArgumentException(uriEx);
}
final String libBaseNameLC = isLowerCaseAlready ? libBaseName : libBaseName.toLowerCase();
@@ -331,20 +331,20 @@ public final class NativeLibrary implements DynamicLookupHelper {
final String macOSXLibName,
final boolean searchSystemPathFirst,
final ClassLoader loader) {
- List<String> paths = new ArrayList<String>();
- String libName = selectName(windowsLibName, unixLibName, macOSXLibName);
+ final List<String> paths = new ArrayList<String>();
+ final String libName = selectName(windowsLibName, unixLibName, macOSXLibName);
if (libName == null) {
return paths;
}
// Allow user's full path specification to override our building of paths
- File file = new File(libName);
+ final File file = new File(libName);
if (file.isAbsolute()) {
paths.add(libName);
return paths;
}
- String[] baseNames = buildNames(libName);
+ final String[] baseNames = buildNames(libName);
if (searchSystemPathFirst) {
// Add just the library names to use the OS's search algorithm
@@ -402,7 +402,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
}
// Add current working directory
- String userDir =
+ final String userDir =
AccessController.doPrivileged(new PrivilegedAction<String>() {
@Override
public String run() {
@@ -430,9 +430,9 @@ public final class NativeLibrary implements DynamicLookupHelper {
}
- private static final String selectName(String windowsLibName,
- String unixLibName,
- String macOSXLibName) {
+ private static final String selectName(final String windowsLibName,
+ final String unixLibName,
+ final String macOSXLibName) {
switch (PlatformPropsImpl.OS_TYPE) {
case WINDOWS:
return windowsLibName;
@@ -452,14 +452,14 @@ public final class NativeLibrary implements DynamicLookupHelper {
}
}
- private static final String[] buildNames(String libName) {
+ private static final String[] buildNames(final String libName) {
// If the library name already has the prefix / suffix added
// (principally because we want to force a version number on Unix
// operating systems) then just return the library name.
final String libBaseNameLC;
try {
libBaseNameLC = IOUtil.getBasename(libName).toLowerCase();
- } catch (URISyntaxException uriEx) {
+ } catch (final URISyntaxException uriEx) {
throw new IllegalArgumentException(uriEx);
}
@@ -485,7 +485,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
for (int i = suffixIdx + suffixes[0].length();
i < libName.length();
i++) {
- char c = libName.charAt(i);
+ final char c = libName.charAt(i);
if (!(c == '.' || (c >= '0' && c <= '9'))) {
ok = false;
break;
@@ -497,7 +497,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
}
}
- String[] res = new String[prefixes.length * suffixes.length +
+ final String[] res = new String[prefixes.length * suffixes.length +
( PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS ? 1 : 0 )];
int idx = 0;
for (int i = 0; i < prefixes.length; i++) {
@@ -512,7 +512,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
return res;
}
- private static final void addPaths(String path, String[] baseNames, List<String> paths) {
+ private static final void addPaths(final String path, final String[] baseNames, final List<String> paths) {
for (int j = 0; j < baseNames.length; j++) {
paths.add(path + File.separator + baseNames[j]);
}
@@ -532,7 +532,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
findLibraryMethod = ClassLoader.class.getDeclaredMethod("findLibrary",
new Class[] { String.class });
findLibraryMethod.setAccessible(true);
- } catch (Exception e) {
+ } catch (final Exception e) {
// Fail silently disabling this functionality
}
initializedFindLibraryMethod = true;
@@ -547,12 +547,12 @@ public final class NativeLibrary implements DynamicLookupHelper {
public String run() {
try {
return (String) findLibraryMethod.invoke(loader, new Object[] { libName });
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new RuntimeException(e);
}
}
});
- } catch (Exception e) {
+ } catch (final Exception e) {
if (DEBUG) {
e.printStackTrace();
}
diff --git a/src/java/com/jogamp/common/os/Platform.java b/src/java/com/jogamp/common/os/Platform.java
index 518c772..933947c 100644
--- a/src/java/com/jogamp/common/os/Platform.java
+++ b/src/java/com/jogamp/common/os/Platform.java
@@ -35,6 +35,7 @@ import java.util.concurrent.TimeUnit;
import com.jogamp.common.jvm.JNILibLoaderBase;
import com.jogamp.common.util.JarUtil;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.common.util.ReflectionUtil;
import com.jogamp.common.util.VersionNumber;
import com.jogamp.common.util.cache.TempJarCache;
@@ -62,7 +63,7 @@ public class Platform extends PlatformPropsImpl {
public final int id;
- OSType(int id){
+ OSType(final int id){
this.id = id;
}
}
@@ -85,7 +86,7 @@ public class Platform extends PlatformPropsImpl {
public final int id;
- CPUFamily(int id){
+ CPUFamily(final int id){
this.id = id;
}
}
@@ -121,7 +122,7 @@ public class Platform extends PlatformPropsImpl {
public final int id;
public final CPUFamily family;
- CPUType(CPUFamily type, int id){
+ CPUType(final CPUFamily type, final int id){
this.family = type;
this.id = id;
}
@@ -138,7 +139,7 @@ public class Platform extends PlatformPropsImpl {
public final int id;
- ABIType(int id){
+ ABIType(final int id){
this.id = id;
}
}
@@ -189,19 +190,19 @@ public class Platform extends PlatformPropsImpl {
URI _platformClassJarURI = null;
try {
_platformClassJarURI = JarUtil.getJarURI(Platform.class.getName(), cl);
- } catch (Exception e) { }
+ } catch (final Exception e) { }
platformClassJarURI = _platformClassJarURI;
}
_isRunningFromJarURL[0] = null != platformClassJarURI;
_USE_TEMP_JAR_CACHE[0] = ( OS_TYPE != OSType.ANDROID ) && ( null != platformClassJarURI ) &&
- Debug.getBooleanProperty(useTempJarCachePropName, true, true);
+ PropertyAccess.getBooleanProperty(useTempJarCachePropName, true, true);
// load GluegenRT native library
if(_USE_TEMP_JAR_CACHE[0] && TempJarCache.initSingleton()) {
try {
JNILibLoaderBase.addNativeJarLibs(new Class<?>[] { Platform.class }, null, null );
- } catch (Exception e0) {
+ } catch (final Exception e0) {
// IllegalArgumentException, IOException
System.err.println("Caught "+e0.getClass().getSimpleName()+": "+e0.getMessage()+", while JNILibLoaderBase.addNativeJarLibs(..)");
}
@@ -212,12 +213,12 @@ public class Platform extends PlatformPropsImpl {
JVMUtil.initSingleton(); // requires gluegen-rt, one-time init.
// AWT Headless determination
- if( !Debug.getBooleanProperty("java.awt.headless", true) &&
+ if( !PropertyAccess.getBooleanProperty("java.awt.headless", true) &&
ReflectionUtil.isClassAvailable(ReflectionUtil.AWTNames.ComponentClass, cl) &&
ReflectionUtil.isClassAvailable(ReflectionUtil.AWTNames.GraphicsEnvironmentClass, cl) ) {
try {
_AWT_AVAILABLE[0] = false == ((Boolean)ReflectionUtil.callStaticMethod(ReflectionUtil.AWTNames.GraphicsEnvironmentClass, ReflectionUtil.AWTNames.isHeadlessMethod, null, null, cl)).booleanValue();
- } catch (Throwable t) { }
+ } catch (final Throwable t) { }
}
return null;
} } );
@@ -227,11 +228,11 @@ public class Platform extends PlatformPropsImpl {
MachineDescription md = MachineDescriptionRuntime.getRuntime();
if(null == md) {
- MachineDescription.StaticConfig smd = MachineDescriptionRuntime.getStatic();
+ final MachineDescription.StaticConfig smd = MachineDescriptionRuntime.getStatic();
md = smd.md;
System.err.println("Warning: Using static MachineDescription: "+smd);
} else {
- MachineDescription.StaticConfig smd = MachineDescriptionRuntime.getStatic();
+ final MachineDescription.StaticConfig smd = MachineDescriptionRuntime.getStatic();
if(!md.compatible(smd.md)) {
throw new RuntimeException("Incompatible MachineDescriptions:"+PlatformPropsImpl.NEWLINE+
" Static "+smd+PlatformPropsImpl.NEWLINE+
@@ -476,7 +477,7 @@ public class Platform extends PlatformPropsImpl {
final long nsPeriod = nsDuration / splitInLoops;
final long t0_ns = System.nanoTime();
for(int i=splitInLoops; i>0; i--) {
- try { TimeUnit.NANOSECONDS.sleep(nsPeriod); } catch (InterruptedException e) { }
+ try { TimeUnit.NANOSECONDS.sleep(nsPeriod); } catch (final InterruptedException e) { }
}
return ( ( System.nanoTime() - t0_ns ) - nsDuration ) / splitInLoops;
}
diff --git a/src/java/com/jogamp/common/util/ArrayHashSet.java b/src/java/com/jogamp/common/util/ArrayHashSet.java
index a125580..34e84c4 100644
--- a/src/java/com/jogamp/common/util/ArrayHashSet.java
+++ b/src/java/com/jogamp/common/util/ArrayHashSet.java
@@ -76,12 +76,12 @@ public class ArrayHashSet<E>
data = new ArrayList<E>();
}
- public ArrayHashSet(int initialCapacity) {
+ public ArrayHashSet(final int initialCapacity) {
map = new HashMap<E,E>(initialCapacity);
data = new ArrayList<E>(initialCapacity);
}
- public ArrayHashSet(int initialCapacity, float loadFactor) {
+ public ArrayHashSet(final int initialCapacity, final float loadFactor) {
map = new HashMap<E,E>(initialCapacity, loadFactor);
data = new ArrayList<E>(initialCapacity);
}
@@ -130,7 +130,7 @@ public class ArrayHashSet<E>
* otherwise false (already contained).
*/
@Override
- public final boolean add(E element) {
+ public final boolean add(final E element) {
final boolean exists = map.containsKey(element);
if(!exists) {
if(null != map.put(element, element)) {
@@ -153,7 +153,7 @@ public class ArrayHashSet<E>
* otherwise false (not contained).
*/
@Override
- public final boolean remove(Object element) {
+ public final boolean remove(final Object element) {
if ( null != map.remove(element) ) {
if ( ! data.remove(element) ) {
throw new InternalError("Couldn't remove prev mapped element: "+element);
@@ -172,9 +172,9 @@ public class ArrayHashSet<E>
* otherwise false (completely container).
*/
@Override
- public final boolean addAll(Collection<? extends E> c) {
+ public final boolean addAll(final Collection<? extends E> c) {
boolean mod = false;
- for (E o : c) {
+ for (final E o : c) {
mod |= add(o);
}
return mod;
@@ -189,7 +189,7 @@ public class ArrayHashSet<E>
* otherwise false.
*/
@Override
- public final boolean contains(Object element) {
+ public final boolean contains(final Object element) {
return map.containsKey(element);
}
@@ -202,8 +202,8 @@ public class ArrayHashSet<E>
* otherwise false.
*/
@Override
- public final boolean containsAll(Collection<?> c) {
- for (Object o : c) {
+ public final boolean containsAll(final Collection<?> c) {
+ for (final Object o : c) {
if (!this.contains(o)) {
return false;
}
@@ -220,9 +220,9 @@ public class ArrayHashSet<E>
* otherwise false.
*/
@Override
- public final boolean removeAll(Collection<?> c) {
+ public final boolean removeAll(final Collection<?> c) {
boolean mod = false;
- for (Object o : c) {
+ for (final Object o : c) {
mod |= this.remove(o);
}
return mod;
@@ -238,9 +238,9 @@ public class ArrayHashSet<E>
* otherwise false.
*/
@Override
- public final boolean retainAll(Collection<?> c) {
+ public final boolean retainAll(final Collection<?> c) {
boolean mod = false;
- for (Object o : c) {
+ for (final Object o : c) {
if (!c.contains(o)) {
mod |= this.remove(o);
}
@@ -255,7 +255,7 @@ public class ArrayHashSet<E>
* Performance: arrayHashSet(1)
*/
@Override
- public final boolean equals(Object arrayHashSet) {
+ public final boolean equals(final Object arrayHashSet) {
if ( !(arrayHashSet instanceof ArrayHashSet) ) {
return false;
}
@@ -294,7 +294,7 @@ public class ArrayHashSet<E>
}
@Override
- public final <T> T[] toArray(T[] a) {
+ public final <T> T[] toArray(final T[] a) {
return data.toArray(a);
}
@@ -303,12 +303,12 @@ public class ArrayHashSet<E>
//
@Override
- public final E get(int index) {
+ public final E get(final int index) {
return data.get(index);
}
@Override
- public final int indexOf(Object element) {
+ public final int indexOf(final Object element) {
return data.indexOf(element);
}
@@ -320,7 +320,7 @@ public class ArrayHashSet<E>
* @throws IllegalArgumentException if the given element was already contained
*/
@Override
- public final void add(int index, E element) {
+ public final void add(final int index, final E element) {
if ( map.containsKey(element) ) {
throw new IllegalArgumentException("Element "+element+" is already contained");
}
@@ -334,7 +334,7 @@ public class ArrayHashSet<E>
* @throws UnsupportedOperationException
*/
@Override
- public final boolean addAll(int index, Collection<? extends E> c) {
+ public final boolean addAll(final int index, final Collection<? extends E> c) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -342,7 +342,7 @@ public class ArrayHashSet<E>
* @throws UnsupportedOperationException
*/
@Override
- public final E set(int index, E element) {
+ public final E set(final int index, final E element) {
final E old = remove(index);
if(null!=old) {
add(index, element);
@@ -358,7 +358,7 @@ public class ArrayHashSet<E>
* @return the removed object
*/
@Override
- public final E remove(int index) {
+ public final E remove(final int index) {
final E o = get(index);
if( null!=o && remove(o) ) {
return o;
@@ -374,7 +374,7 @@ public class ArrayHashSet<E>
* @return index of element, or -1 if not found
*/
@Override
- public final int lastIndexOf(Object o) {
+ public final int lastIndexOf(final Object o) {
return indexOf(o);
}
@@ -384,12 +384,12 @@ public class ArrayHashSet<E>
}
@Override
- public final ListIterator<E> listIterator(int index) {
+ public final ListIterator<E> listIterator(final int index) {
return data.listIterator(index);
}
@Override
- public final List<E> subList(int fromIndex, int toIndex) {
+ public final List<E> subList(final int fromIndex, final int toIndex) {
return data.subList(fromIndex, toIndex);
}
@@ -413,7 +413,7 @@ public class ArrayHashSet<E>
* @return object from this list, identical to the given <code>key</code> hash code,
* or null if not contained
*/
- public final E get(Object key) {
+ public final E get(final Object key) {
return map.get(key);
}
@@ -427,7 +427,7 @@ public class ArrayHashSet<E>
* @return object from this list, identical to the given <code>key</code> hash code,
* or add the given <code>key</code> and return it.
*/
- public final E getOrAdd(E key) {
+ public final E getOrAdd(final E key) {
final E identity = get(key);
if(null == identity) {
// object not contained yet, add it
@@ -451,7 +451,7 @@ public class ArrayHashSet<E>
* @return true if the given element is contained by this list using slow equals operation,
* otherwise false.
*/
- public final boolean containsSafe(Object element) {
+ public final boolean containsSafe(final Object element) {
return data.contains(element);
}
diff --git a/src/java/com/jogamp/common/util/Bitstream.java b/src/java/com/jogamp/common/util/Bitstream.java
index 393108b..7d9c4fd 100644
--- a/src/java/com/jogamp/common/util/Bitstream.java
+++ b/src/java/com/jogamp/common/util/Bitstream.java
@@ -595,7 +595,7 @@ public class Bitstream<T> {
* Default behavior for I/O methods is not to throw an {@link IOException}, but to return {@link #EOS}.
* </p>
*/
- public final void setThrowIOExceptionOnEOF(boolean enable) {
+ public final void setThrowIOExceptionOnEOF(final boolean enable) {
throwIOExceptionOnEOF = enable;
}
diff --git a/src/java/com/jogamp/common/util/FloatStack.java b/src/java/com/jogamp/common/util/FloatStack.java
index 8cb2e5b..b9be29c 100644
--- a/src/java/com/jogamp/common/util/FloatStack.java
+++ b/src/java/com/jogamp/common/util/FloatStack.java
@@ -50,7 +50,7 @@ public class /*name*/FloatStack/*name*/ implements PrimitiveStack {
* @param growSize grow size if {@link #position()} is reached, maybe <code>0</code>
* in which case an {@link IndexOutOfBoundsException} is thrown.
*/
- public /*name*/FloatStack/*name*/(int initialSize, int growSize) {
+ public /*name*/FloatStack/*name*/(final int initialSize, final int growSize) {
this.position = 0;
this.growSize = growSize;
this.buffer = new /*value*/float/*value*/[initialSize];
@@ -63,7 +63,7 @@ public class /*name*/FloatStack/*name*/ implements PrimitiveStack {
public final int position() { return position; }
@Override
- public final void position(int newPosition) throws IndexOutOfBoundsException {
+ public final void position(final int newPosition) throws IndexOutOfBoundsException {
if( 0 > position || position >= buffer.length ) {
throw new IndexOutOfBoundsException("Invalid new position "+newPosition+", "+this.toString());
}
@@ -77,7 +77,7 @@ public class /*name*/FloatStack/*name*/ implements PrimitiveStack {
public final int getGrowSize() { return growSize; }
@Override
- public final void setGrowSize(int newGrowSize) { growSize = newGrowSize; }
+ public final void setGrowSize(final int newGrowSize) { growSize = newGrowSize; }
@Override
public final String toString() {
@@ -86,12 +86,12 @@ public class /*name*/FloatStack/*name*/ implements PrimitiveStack {
public final /*value*/float/*value*/[] buffer() { return buffer; }
- private final void growIfNecessary(int length) throws IndexOutOfBoundsException {
+ private final void growIfNecessary(final int length) throws IndexOutOfBoundsException {
if( position + length > buffer.length ) {
if( 0 >= growSize ) {
throw new IndexOutOfBoundsException("Out of fixed stack size: "+this);
}
- /*value*/float/*value*/[] newBuffer =
+ final /*value*/float/*value*/[] newBuffer =
new /*value*/float/*value*/[buffer.length + growSize];
System.arraycopy(buffer, 0, newBuffer, 0, position);
buffer = newBuffer;
@@ -108,7 +108,7 @@ public class /*name*/FloatStack/*name*/ implements PrimitiveStack {
* @throws IndexOutOfBoundsException if stack cannot grow due to zero grow-size or offset+length exceeds src.
*/
public final /*value*/float/*value*/[]
- putOnTop(/*value*/float/*value*/[] src, int srcOffset, int length) throws IndexOutOfBoundsException {
+ putOnTop(final /*value*/float/*value*/[] src, final int srcOffset, final int length) throws IndexOutOfBoundsException {
growIfNecessary(length);
System.arraycopy(src, srcOffset, buffer, position, length);
position += length;
@@ -125,7 +125,7 @@ public class /*name*/FloatStack/*name*/ implements PrimitiveStack {
* @throws BufferUnderflowException if <code>src</code> FloatBuffer has less remaining elements than <code>length</code>.
*/
public final /*value2*/FloatBuffer/*value2*/
- putOnTop(/*value2*/FloatBuffer/*value2*/ src, int length) throws IndexOutOfBoundsException, BufferUnderflowException {
+ putOnTop(final /*value2*/FloatBuffer/*value2*/ src, final int length) throws IndexOutOfBoundsException, BufferUnderflowException {
growIfNecessary(length);
src.get(buffer, position, length);
position += length;
@@ -142,7 +142,7 @@ public class /*name*/FloatStack/*name*/ implements PrimitiveStack {
* @throws IndexOutOfBoundsException if stack or <code>dest</code> has less elements than <code>length</code>.
*/
public final /*value*/float/*value*/[]
- getFromTop(/*value*/float/*value*/[] dest, int destOffset, int length) throws IndexOutOfBoundsException {
+ getFromTop(final /*value*/float/*value*/[] dest, final int destOffset, final int length) throws IndexOutOfBoundsException {
System.arraycopy(buffer, position-length, dest, destOffset, length);
position -= length;
return dest;
@@ -158,7 +158,7 @@ public class /*name*/FloatStack/*name*/ implements PrimitiveStack {
* @throws BufferOverflowException if <code>src</code> FloatBuffer has less remaining elements than <code>length</code>.
*/
public final /*value2*/FloatBuffer/*value2*/
- getFromTop(/*value2*/FloatBuffer/*value2*/ dest, int length) throws IndexOutOfBoundsException, BufferOverflowException {
+ getFromTop(final /*value2*/FloatBuffer/*value2*/ dest, final int length) throws IndexOutOfBoundsException, BufferOverflowException {
dest.put(buffer, position-length, length);
position -= length;
return dest;
diff --git a/src/java/com/jogamp/common/util/FunctionTask.java b/src/java/com/jogamp/common/util/FunctionTask.java
index b742d73..4ac64d3 100644
--- a/src/java/com/jogamp/common/util/FunctionTask.java
+++ b/src/java/com/jogamp/common/util/FunctionTask.java
@@ -46,7 +46,7 @@ public class FunctionTask<R,A> extends TaskBase implements Function<R,A> {
* @param args the {@link Function} arguments
* @return the {@link Function} return value
*/
- public static <U,V> U invoke(boolean waitUntilDone, Function<U,V> func, V... args) {
+ public static <U,V> U invoke(final boolean waitUntilDone, final Function<U,V> func, final V... args) {
Throwable throwable = null;
final Object sync = new Object();
final FunctionTask<U,V> rt = new FunctionTask<U,V>( func, waitUntilDone ? sync : null, true, waitUntilDone ? null : System.err );
@@ -56,7 +56,7 @@ public class FunctionTask<R,A> extends TaskBase implements Function<R,A> {
if( waitUntilDone ) {
try {
sync.wait();
- } catch (InterruptedException ie) {
+ } catch (final InterruptedException ie) {
throwable = ie;
}
if(null==throwable) {
@@ -82,7 +82,7 @@ public class FunctionTask<R,A> extends TaskBase implements Function<R,A> {
* otherwise the exception is thrown.
* @param exceptionOut If not <code>null</code>, exceptions are written to this {@link PrintStream}.
*/
- public FunctionTask(Function<R,A> runnable, Object syncObject, boolean catchExceptions, PrintStream exceptionOut) {
+ public FunctionTask(final Function<R,A> runnable, final Object syncObject, final boolean catchExceptions, final PrintStream exceptionOut) {
super(syncObject, catchExceptions, exceptionOut);
this.runnable = runnable ;
result = null;
@@ -98,7 +98,7 @@ public class FunctionTask<R,A> extends TaskBase implements Function<R,A> {
* Sets the arguments for {@link #run()}.
* They will be cleared after calling {@link #run()} or {@link #eval(Object...)}.
*/
- public final void setArgs(A... args) {
+ public final void setArgs(final A... args) {
this.args = args;
}
@@ -132,7 +132,7 @@ public class FunctionTask<R,A> extends TaskBase implements Function<R,A> {
if(null == syncObject) {
try {
this.result = runnable.eval(args);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
runnableException = t;
if(null != exceptionOut) {
exceptionOut.println("FunctionTask.run(): "+getExceptionOutIntro()+" exception occured on thread "+Thread.currentThread().getName()+": "+toString());
@@ -149,7 +149,7 @@ public class FunctionTask<R,A> extends TaskBase implements Function<R,A> {
synchronized (syncObject) {
try {
this.result = runnable.eval(args);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
runnableException = t;
if(null != exceptionOut) {
exceptionOut.println("FunctionTask.run(): "+getExceptionOutIntro()+" exception occured on thread "+Thread.currentThread().getName()+": "+toString());
@@ -168,7 +168,7 @@ public class FunctionTask<R,A> extends TaskBase implements Function<R,A> {
}
@Override
- public final R eval(A... args) {
+ public final R eval(final A... args) {
this.args = args;
run();
final R res = result;
diff --git a/src/java/com/jogamp/common/util/HashUtil.java b/src/java/com/jogamp/common/util/HashUtil.java
index 5ce2332..b567bca 100644
--- a/src/java/com/jogamp/common/util/HashUtil.java
+++ b/src/java/com/jogamp/common/util/HashUtil.java
@@ -32,10 +32,10 @@ public class HashUtil {
* Generates a 32bit equally distributed identity hash value
* from <code>addr</code> avoiding XOR collision.
*/
- public static int getAddrHash32_EqualDist(long addr) {
+ public static int getAddrHash32_EqualDist(final long addr) {
// avoid xor collisions of low/high parts
// 31 * x == (x << 5) - x
- int hash = 31 + (int) addr ; // lo addr
+ final int hash = 31 + (int) addr ; // lo addr
return ((hash << 5) - hash) + (int) ( addr >>> 32 ) ; // hi addr
}
@@ -43,7 +43,7 @@ public class HashUtil {
* Generates a 32bit equally distributed identity hash value
* from <code>addr</code> and <code>size</code> avoiding XOR collision.
*/
- public static int getAddrSizeHash32_EqualDist(long addr, long size) {
+ public static int getAddrSizeHash32_EqualDist(final long addr, final long size) {
// avoid xor collisions of low/high parts
// 31 * x == (x << 5) - x
int hash = 31 + (int) addr ; // lo addr
@@ -56,7 +56,7 @@ public class HashUtil {
* Generates a 64bit equally distributed hash value
* from <code>addr</code> and <code>size</code> avoiding XOR collisions.
*/
- public static long getHash64(long addr, long size) {
+ public static long getHash64(final long addr, final long size) {
// 31 * x == (x << 5) - x
final long hash = 31 + addr;
return ((hash << 5) - hash) + size;
diff --git a/src/java/com/jogamp/common/util/IOUtil.java b/src/java/com/jogamp/common/util/IOUtil.java
index c70fa92..3b145af 100644
--- a/src/java/com/jogamp/common/util/IOUtil.java
+++ b/src/java/com/jogamp/common/util/IOUtil.java
@@ -98,7 +98,7 @@ public class IOUtil {
try {
_fosCtor = ReflectionUtil.getConstructor("java.io.FileOutputStream", new Class<?>[] { File.class }, true, IOUtil.class.getClassLoader());
_t = null;
- } catch (Throwable t) {
+ } catch (final Throwable t) {
_fosCtor = null;
_t = t;
}
@@ -126,11 +126,11 @@ public class IOUtil {
* @return
* @throws IOException
*/
- public static int copyURLConn2File(URLConnection conn, File outFile) throws IOException {
+ public static int copyURLConn2File(final URLConnection conn, final File outFile) throws IOException {
conn.connect(); // redundant
int totalNumBytes = 0;
- InputStream in = new BufferedInputStream(conn.getInputStream());
+ final InputStream in = new BufferedInputStream(conn.getInputStream());
try {
totalNumBytes = copyStream2File(in, outFile, conn.getContentLength());
} finally {
@@ -149,8 +149,8 @@ public class IOUtil {
* @return
* @throws IOException
*/
- public static int copyStream2File(InputStream in, File outFile, int totalNumBytes) throws IOException {
- OutputStream out = new BufferedOutputStream(new FileOutputStream(outFile));
+ public static int copyStream2File(final InputStream in, final File outFile, int totalNumBytes) throws IOException {
+ final OutputStream out = new BufferedOutputStream(new FileOutputStream(outFile));
try {
totalNumBytes = copyStream2Stream(in, out, totalNumBytes);
} finally {
@@ -169,7 +169,7 @@ public class IOUtil {
* @return
* @throws IOException
*/
- public static int copyStream2Stream(InputStream in, OutputStream out, int totalNumBytes) throws IOException {
+ public static int copyStream2Stream(final InputStream in, final OutputStream out, final int totalNumBytes) throws IOException {
return copyStream2Stream(Platform.getMachineDescription().pageSizeInBytes(), in, out, totalNumBytes);
}
@@ -184,7 +184,7 @@ public class IOUtil {
* @return
* @throws IOException
*/
- public static int copyStream2Stream(int bufferSize, InputStream in, OutputStream out, int totalNumBytes) throws IOException {
+ public static int copyStream2Stream(final int bufferSize, final InputStream in, final OutputStream out, final int totalNumBytes) throws IOException {
final byte[] buf = new byte[bufferSize];
int numBytes = 0;
while (true) {
@@ -238,7 +238,7 @@ public class IOUtil {
*
* @param stream input stream, which will be wrapped into a BufferedInputStream, if not already done.
*/
- public static ByteBuffer copyStream2ByteBuffer(InputStream stream) throws IOException {
+ public static ByteBuffer copyStream2ByteBuffer(final InputStream stream) throws IOException {
return copyStream2ByteBuffer(stream, -1);
}
@@ -259,7 +259,7 @@ public class IOUtil {
}
final MachineDescription machine = Platform.getMachineDescription();
ByteBuffer data = Buffers.newDirectByteBuffer( machine.pageAlignedSize( initialCapacity ) );
- byte[] chunk = new byte[machine.pageSizeInBytes()];
+ final byte[] chunk = new byte[machine.pageSizeInBytes()];
int chunk2Read = Math.min(machine.pageSizeInBytes(), avail);
int numRead = 0;
do {
@@ -296,7 +296,7 @@ public class IOUtil {
* @return
* @throws URISyntaxException if path is empty or has no parent directory available while resolving <code>../</code>
*/
- public static String slashify(String path, boolean startWithSlash, boolean endWithSlash) throws URISyntaxException {
+ public static String slashify(final String path, final boolean startWithSlash, final boolean endWithSlash) throws URISyntaxException {
String p = path.replace('\\', '/'); // unify file separator
if (startWithSlash && !p.startsWith("/")) {
p = "/" + p;
@@ -312,7 +312,7 @@ public class IOUtil {
* @throws URISyntaxException if path is empty or has no parent directory available while resolving <code>../</code>
* @throws URISyntaxException if the resulting string does not comply w/ an RFC 2396 URI
*/
- public static URI toURISimple(File file) throws URISyntaxException {
+ public static URI toURISimple(final File file) throws URISyntaxException {
return new URI(FILE_SCHEME, null, slashify(file.getAbsolutePath(), true /* startWithSlash */, file.isDirectory() /* endWithSlash */), null);
}
@@ -321,7 +321,7 @@ public class IOUtil {
* @throws URISyntaxException if path is empty or has no parent directory available while resolving <code>../</code>
* @throws URISyntaxException if the resulting string does not comply w/ an RFC 2396 URI
*/
- public static URI toURISimple(String protocol, String path, boolean isDirectory) throws URISyntaxException {
+ public static URI toURISimple(final String protocol, final String path, final boolean isDirectory) throws URISyntaxException {
return new URI(protocol, null, slashify(new File(path).getAbsolutePath(), true /* startWithSlash */, isDirectory /* endWithSlash */), null);
}
@@ -336,7 +336,7 @@ public class IOUtil {
* @throws NullPointerException if file is null
*/
- public static String getFileSuffix(File file) {
+ public static String getFileSuffix(final File file) {
return getFileSuffix(file.getName());
}
@@ -350,14 +350,14 @@ public class IOUtil {
* @return lowercase suffix of the file name
* @throws NullPointerException if filename is null
*/
- public static String getFileSuffix(String filename) {
- int lastDot = filename.lastIndexOf('.');
+ public static String getFileSuffix(final String filename) {
+ final int lastDot = filename.lastIndexOf('.');
if (lastDot < 0) {
return null;
}
return toLowerCase(filename.substring(lastDot + 1));
}
- private static String toLowerCase(String arg) {
+ private static String toLowerCase(final String arg) {
if (arg == null) {
return null;
}
@@ -373,7 +373,7 @@ public class IOUtil {
* the class {@link java.io.FileOutputStream} is not accessible or
* the user does not have sufficient rights to access the local filesystem.
*/
- public static FileOutputStream getFileOutputStream(File file, boolean allowOverwrite) throws IOException {
+ public static FileOutputStream getFileOutputStream(final File file, final boolean allowOverwrite) throws IOException {
final Constructor<?> fosCtor = getFOSCtor();
if(null == fosCtor) {
throw new IOException("Cannot open file (" + file + ") for writing, FileOutputStream feature not available.");
@@ -383,12 +383,12 @@ public class IOUtil {
}
try {
return (FileOutputStream) fosCtor.newInstance(new Object[] { file });
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new IOException("error opening " + file + " for write. ", e);
}
}
- public static String getClassFileName(String clazzBinName) {
+ public static String getClassFileName(final String clazzBinName) {
// or return clazzBinName.replace('.', File.separatorChar) + ".class"; ?
return clazzBinName.replace('.', '/') + ".class";
}
@@ -399,7 +399,7 @@ public class IOUtil {
* @return jar:file:/usr/local/projects/JOGL/gluegen/build-x86_64/gluegen-rt.jar!/com/jogamp/common/util/cache/TempJarCache.class
* @throws IOException if the jar file could not been found by the ClassLoader
*/
- public static URL getClassURL(String clazzBinName, ClassLoader cl) throws IOException {
+ public static URL getClassURL(final String clazzBinName, final ClassLoader cl) throws IOException {
final URL url = cl.getResource(getClassFileName(clazzBinName));
if(null == url) {
throw new IOException("Cannot not find: "+clazzBinName);
@@ -413,7 +413,7 @@ public class IOUtil {
*/
public static String getBasename(String fname) throws URISyntaxException {
fname = slashify(fname, false /* startWithSlash */, false /* endWithSlash */);
- int lios = fname.lastIndexOf('/'); // strip off dirname
+ final int lios = fname.lastIndexOf('/'); // strip off dirname
if(lios>=0) {
fname = fname.substring(lios+1);
}
@@ -426,7 +426,7 @@ public class IOUtil {
*/
public static String getDirname(String fname) throws URISyntaxException {
fname = slashify(fname, false /* startWithSlash */, false /* endWithSlash */);
- int lios = fname.lastIndexOf('/'); // strip off dirname
+ final int lios = fname.lastIndexOf('/'); // strip off dirname
if(lios>=0) {
fname = fname.substring(0, lios+1);
}
@@ -445,11 +445,11 @@ public class IOUtil {
* @throws IllegalArgumentException if the URI doesn't match the expected formatting, or is null
* @throws URISyntaxException
*/
- public static URI getURIDirname(URI uri) throws IllegalArgumentException, URISyntaxException {
+ public static URI getURIDirname(final URI uri) throws IllegalArgumentException, URISyntaxException {
if(null == uri) {
throw new IllegalArgumentException("URI is null");
}
- String uriS = uri.toString();
+ final String uriS = uri.toString();
if( DEBUG ) {
System.err.println("getURIDirname "+uri+", extForm: "+uriS);
}
@@ -556,7 +556,7 @@ public class IOUtil {
File f;
try {
f = new File( decodeFromURI( specificURI.getPath() ) ); // validates uri, uses decoded uri.getPath() and normalizes it
- } catch(Exception iae) {
+ } catch(final Exception iae) {
if( DEBUG ) {
System.err.println("Caught "+iae.getClass().getSimpleName()+": new File("+decodeFromURI( specificURI.getPath() )+") failed: "+iae.getMessage());
iae.printStackTrace();
@@ -584,7 +584,7 @@ public class IOUtil {
final URL fUrl = fUri.toURL();
System.err.println("IOUtil.toURL.1b: fUri "+fUri+PlatformPropsImpl.NEWLINE+
"\t, fUrl "+fUrl);
- } catch (Exception ee) {
+ } catch (final Exception ee) {
System.err.println("Caught "+ee.getClass().getSimpleName()+": f.toURI().toURL() failed: "+ee.getMessage());
ee.printStackTrace();
}
@@ -612,7 +612,7 @@ public class IOUtil {
url = new URL(urlS);
mode = 2;
}
- } catch (Exception mue) {
+ } catch (final Exception mue) {
if( DEBUG ) {
System.err.println("Caught "+mue.getClass().getSimpleName()+": new URL("+urlS+") failed: "+mue.getMessage());
mue.printStackTrace();
@@ -624,7 +624,7 @@ public class IOUtil {
try {
url = uri.toURL();
mode = 3;
- } catch (Exception e) {
+ } catch (final Exception e) {
if( DEBUG ) {
System.err.println("Caught "+e.getClass().getSimpleName()+": "+uri+".toURL() failed: "+e.getMessage());
e.printStackTrace();
@@ -662,7 +662,7 @@ public class IOUtil {
* @param contextCL class instance to {@link #resolve(int)} {@link #resourcePaths}.
* @param resourcePaths array of strings denominating multiple resource paths. None shall be null.
*/
- public ClassResources(Class<?> contextCL, String[] resourcePaths) {
+ public ClassResources(final Class<?> contextCL, final String[] resourcePaths) {
for(int i=resourcePaths.length-1; i>=0; i--) {
if( null == resourcePaths[i] ) {
throw new IllegalArgumentException("resourcePath["+i+"] is null");
@@ -676,7 +676,7 @@ public class IOUtil {
* Resolving one of the {@link #resourcePaths} indexed by <code>uriIndex</code> using {@link #contextCL} and {@link IOUtil#getResource(Class, String)}.
* @throws ArrayIndexOutOfBoundsException if <code>uriIndex</code> is < 0 or >= {@link #resourceCount()}.
*/
- public URLConnection resolve(int uriIndex) throws ArrayIndexOutOfBoundsException {
+ public URLConnection resolve(final int uriIndex) throws ArrayIndexOutOfBoundsException {
return getResource(contextCL, resourcePaths[uriIndex]);
}
}
@@ -698,11 +698,11 @@ public class IOUtil {
* @see ClassLoader#getResource(String)
* @see ClassLoader#getSystemResource(String)
*/
- public static URLConnection getResource(Class<?> context, String resourcePath) {
+ public static URLConnection getResource(final Class<?> context, final String resourcePath) {
if(null == resourcePath) {
return null;
}
- ClassLoader contextCL = (null!=context)?context.getClassLoader():IOUtil.class.getClassLoader();
+ final ClassLoader contextCL = (null!=context)?context.getClassLoader():IOUtil.class.getClassLoader();
URLConnection conn = null;
if(null != context) {
// scoping the path within the class's package
@@ -738,7 +738,7 @@ public class IOUtil {
* @see URL#URL(String)
* @see File#File(String)
*/
- public static URLConnection getResource(String resourcePath, ClassLoader cl) {
+ public static URLConnection getResource(final String resourcePath, final ClassLoader cl) {
if(null == resourcePath) {
return null;
}
@@ -748,7 +748,7 @@ public class IOUtil {
if(resourcePath.startsWith(AssetURLContext.asset_protocol_prefix)) {
try {
return AssetURLContext.createURL(resourcePath, cl).openConnection();
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
if(DEBUG) {
System.err.println("IOUtil: Caught Exception:");
ioe.printStackTrace();
@@ -758,7 +758,7 @@ public class IOUtil {
} else {
try {
return AssetURLContext.resolve(resourcePath, cl);
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
if(DEBUG) {
System.err.println("IOUtil: Caught Exception:");
ioe.printStackTrace();
@@ -775,7 +775,7 @@ public class IOUtil {
* @param relativeFile denotes a relative file to the baseLocation
* @throws URISyntaxException if path is empty or has no parent directory available while resolving <code>../</code>
*/
- public static String getRelativeOf(File baseLocation, String relativeFile) throws URISyntaxException {
+ public static String getRelativeOf(final File baseLocation, final String relativeFile) throws URISyntaxException {
if(null == relativeFile) {
return null;
}
@@ -793,7 +793,7 @@ public class IOUtil {
* @return parent of path
* @throws URISyntaxException if path is empty or has no parent directory available
*/
- public static String getParentOf(String path) throws URISyntaxException {
+ public static String getParentOf(final String path) throws URISyntaxException {
final int pl = null!=path ? path.length() : 0;
if(pl == 0) {
throw new IllegalArgumentException("path is empty <"+path+">");
@@ -850,7 +850,7 @@ public class IOUtil {
* @param relativePath denotes a relative file to the baseLocation's parent directory
* @throws URISyntaxException if path is empty or has no parent directory available while resolving <code>../</code>
*/
- public static URI getRelativeOf(URI baseURI, String relativePath) throws URISyntaxException {
+ public static URI getRelativeOf(final URI baseURI, final String relativePath) throws URISyntaxException {
return compose(baseURI.getScheme(), baseURI.getSchemeSpecificPart(), relativePath, baseURI.getFragment());
}
@@ -858,10 +858,10 @@ public class IOUtil {
* Wraps {@link #getRelativeOf(URI, String)} for convenience.
* @throws IOException
*/
- public static URL getRelativeOf(URL baseURL, String relativePath) throws IOException {
+ public static URL getRelativeOf(final URL baseURL, final String relativePath) throws IOException {
try {
return getRelativeOf(baseURL.toURI(), relativePath).toURL();
- } catch (URISyntaxException e) {
+ } catch (final URISyntaxException e) {
throw new IOException(e);
}
}
@@ -883,7 +883,7 @@ public class IOUtil {
* @throws URISyntaxException if path is empty or has no parent directory available while resolving <code>../</code>
* @see #encodeToURI(String)
*/
- public static URI compose(String scheme, String schemeSpecificPart, String relativePath, String fragment) throws URISyntaxException {
+ public static URI compose(final String scheme, String schemeSpecificPart, final String relativePath, final String fragment) throws URISyntaxException {
// cut off optional query in scheme-specific-part
final String query;
final int queryI = schemeSpecificPart.lastIndexOf('?');
@@ -912,7 +912,7 @@ public class IOUtil {
* <li>SPACE -> %20</li>
* </ul>
*/
- public static String encodeToURI(String s) {
+ public static String encodeToURI(final String s) {
return patternSpaceRaw.matcher(s).replaceAll("%20");
}
@@ -922,7 +922,7 @@ public class IOUtil {
* <li>%20 -> SPACE</li>
* </ul>
*/
- public static String decodeFromURI(String s) {
+ public static String decodeFromURI(final String s) {
return patternSpaceEnc.matcher(s).replaceAll(" ");
}
@@ -1019,14 +1019,14 @@ public class IOUtil {
/**
* Returns the connected URLConnection, or null if not url is not available
*/
- public static URLConnection openURL(URL url) {
+ public static URLConnection openURL(final URL url) {
return openURL(url, ".");
}
/**
* Returns the connected URLConnection, or null if not url is not available
*/
- public static URLConnection openURL(URL url, String dbgmsg) {
+ public static URLConnection openURL(final URL url, final String dbgmsg) {
if(null!=url) {
try {
final URLConnection c = url.openConnection();
@@ -1035,7 +1035,7 @@ public class IOUtil {
System.err.println("IOUtil: urlExists("+url+") ["+dbgmsg+"] - true");
}
return c;
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
if(DEBUG) {
System.err.println("IOUtil: urlExists("+url+") ["+dbgmsg+"] - false - "+ioe.getClass().getSimpleName()+": "+ioe.getMessage());
ioe.printStackTrace();
@@ -1092,7 +1092,7 @@ public class IOUtil {
* @param shallBeWritable
* @return
*/
- public static boolean testFile(File file, boolean shallBeDir, boolean shallBeWritable) {
+ public static boolean testFile(final File file, final boolean shallBeDir, final boolean shallBeWritable) {
if (!file.exists()) {
if(DEBUG) {
System.err.println("IOUtil.testFile: <"+file.getAbsolutePath()+">: does not exist");
@@ -1126,7 +1126,7 @@ public class IOUtil {
* @throws SecurityException if file creation and process execution is not allowed within the current security context
* @param dir
*/
- public static boolean testDirExec(File dir)
+ public static boolean testDirExec(final File dir)
throws SecurityException
{
if (!testFile(dir, true, true)) {
@@ -1145,9 +1145,9 @@ public class IOUtil {
File exetst;
try {
exetst = File.createTempFile("jogamp_exe_tst", getShellSuffix(), dir);
- } catch (SecurityException se) {
+ } catch (final SecurityException se) {
throw se; // fwd Security exception
- } catch (IOException e) {
+ } catch (final IOException e) {
if(DEBUG) {
e.printStackTrace();
}
@@ -1156,12 +1156,12 @@ public class IOUtil {
int res = -1;
if(exetst.setExecutable(true /* exec */, true /* ownerOnly */)) {
try {
- Process pr = Runtime.getRuntime().exec(exetst.getCanonicalPath());
+ final Process pr = Runtime.getRuntime().exec(exetst.getCanonicalPath());
pr.waitFor() ;
res = pr.exitValue();
- } catch (SecurityException se) {
+ } catch (final SecurityException se) {
throw se; // fwd Security exception
- } catch (Throwable t) {
+ } catch (final Throwable t) {
res = -2;
if(DEBUG) {
System.err.println("IOUtil.testDirExec: <"+exetst.getAbsolutePath()+">: Caught "+t.getClass().getSimpleName()+": "+t.getMessage());
@@ -1176,7 +1176,7 @@ public class IOUtil {
return 0 == res;
}
- private static File testDirImpl(File dir, boolean create, boolean executable, String dbgMsg)
+ private static File testDirImpl(final File dir, final boolean create, final boolean executable, final String dbgMsg)
throws SecurityException
{
final File res;
@@ -1214,7 +1214,7 @@ public class IOUtil {
return testDirImpl(dir, create, executable, "testDir");
}
- private static boolean isStringSet(String s) { return null != s && 0 < s.length(); }
+ private static boolean isStringSet(final String s) { return null != s && 0 < s.length(); }
/**
* This methods finds [and creates] an available temporary sub-directory:
@@ -1240,7 +1240,7 @@ public class IOUtil {
* @return a temporary directory, writable by this user
* @throws SecurityException
*/
- private static File getSubTempDir(File tmpRoot, String tmpSubDirPrefix, boolean executable, String dbgMsg)
+ private static File getSubTempDir(final File tmpRoot, final String tmpSubDirPrefix, final boolean executable, final String dbgMsg)
throws SecurityException
{
File tmpBaseDir = null;
@@ -1411,17 +1411,17 @@ public class IOUtil {
* @throws IOException
* @throws SecurityException
*/
- public static File createTempFile(String prefix, String suffix, boolean executable)
+ public static File createTempFile(final String prefix, final String suffix, final boolean executable)
throws IllegalArgumentException, IOException, SecurityException
{
return File.createTempFile( prefix, suffix, getTempDir(executable) );
}
- public static void close(Closeable stream, boolean throwRuntimeException) throws RuntimeException {
+ public static void close(final Closeable stream, final boolean throwRuntimeException) throws RuntimeException {
if(null != stream) {
try {
stream.close();
- } catch (IOException e) {
+ } catch (final IOException e) {
if(throwRuntimeException) {
throw new RuntimeException(e);
} else if(DEBUG) {
diff --git a/src/java/com/jogamp/common/util/IntBitfield.java b/src/java/com/jogamp/common/util/IntBitfield.java
index 2d2f1ef..74e37ac 100644
--- a/src/java/com/jogamp/common/util/IntBitfield.java
+++ b/src/java/com/jogamp/common/util/IntBitfield.java
@@ -50,7 +50,7 @@ public class IntBitfield {
/**
* @param bitCount
*/
- public IntBitfield(long bitCount) {
+ public IntBitfield(final long bitCount) {
final int units = (int) Math.max(1L, ( bitCount + 7L ) >>> UNIT_SHIFT_L);
this.storage = new int[units];
this.bitsCountL = (long)units << UNIT_SHIFT_L ;
@@ -60,19 +60,19 @@ public class IntBitfield {
/**
* @param bitCount
*/
- public IntBitfield(int bitCount) {
+ public IntBitfield(final int bitCount) {
final int units = Math.max(1, ( bitCount + 7 ) >>> UNIT_SHIFT_I);
this.storage = new int[units];
this.bitsCountI = units << UNIT_SHIFT_I;
this.bitsCountL = bitsCountI;
}
- private final void check(long bitnum) {
+ private final void check(final long bitnum) {
if( 0 > bitnum || bitnum >= bitsCountL ) {
throw new ArrayIndexOutOfBoundsException("Bitnum should be within [0.."+(bitsCountL-1)+"], but is "+bitnum);
}
}
- private final void check(int bitnum) {
+ private final void check(final int bitnum) {
if( 0 > bitnum || bitnum >= bitsCountI ) {
throw new ArrayIndexOutOfBoundsException("Bitnum should be within [0.."+(bitsCountI-1)+"], but is "+bitnum);
}
@@ -82,7 +82,7 @@ public class IntBitfield {
public final long capacity() { return bitsCountL; }
/** Return <code>true</code> if the bit at position <code>bitnum</code> is set, otherwise <code>false</code>. */
- public final boolean get(long bitnum) {
+ public final boolean get(final long bitnum) {
check(bitnum);
final int u = (int) ( bitnum >>> UNIT_SHIFT_L );
final int b = (int) ( bitnum - ( (long)u << UNIT_SHIFT_L ) );
@@ -90,7 +90,7 @@ public class IntBitfield {
}
/** Return <code>true</code> if the bit at position <code>bitnum</code> is set, otherwise <code>false</code>. */
- public final boolean get(int bitnum) {
+ public final boolean get(final int bitnum) {
check(bitnum);
final int u = bitnum >>> UNIT_SHIFT_I;
final int b = bitnum - ( u << UNIT_SHIFT_I );
@@ -101,7 +101,7 @@ public class IntBitfield {
* Set or clear the bit at position <code>bitnum</code> according to <code>bit</code>
* and return the previous value.
*/
- public final boolean put(long bitnum, boolean bit) {
+ public final boolean put(final long bitnum, final boolean bit) {
check(bitnum);
final int u = (int) ( bitnum >>> UNIT_SHIFT_L );
final int b = (int) ( bitnum - ( (long)u << UNIT_SHIFT_L ) );
@@ -121,7 +121,7 @@ public class IntBitfield {
* Set or clear the bit at position <code>bitnum</code> according to <code>bit</code>
* and return the previous value.
*/
- public final boolean put(int bitnum, boolean bit) {
+ public final boolean put(final int bitnum, final boolean bit) {
check(bitnum);
final int u = bitnum >>> UNIT_SHIFT_I;
final int b = bitnum - ( u << UNIT_SHIFT_I );
diff --git a/src/java/com/jogamp/common/util/IntIntHashMap.java b/src/java/com/jogamp/common/util/IntIntHashMap.java
index ef6159b..4cb2329 100644
--- a/src/java/com/jogamp/common/util/IntIntHashMap.java
+++ b/src/java/com/jogamp/common/util/IntIntHashMap.java
@@ -88,13 +88,13 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable,
@Override
@SuppressWarnings("unchecked")
public EntryCM run() {
- EntryCM r = new EntryCM();
+ final EntryCM r = new EntryCM();
r.c = (Constructor<Entry>)
ReflectionUtil.getConstructor(Entry.class,
new Class[] { keyClazz, valueClazz, Entry.class } );
try {
r.m1 = valueClazz.getDeclaredMethod("equals", Object.class);
- } catch (NoSuchMethodException ex) {
+ } catch (final NoSuchMethodException ex) {
throw new JogampRuntimeException("Class "+valueClazz+" doesn't support equals(Object)");
}
return r;
@@ -111,11 +111,11 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable,
this(16, 0.75f);
}
- public /*name*/IntIntHashMap/*name*/(int initialCapacity) {
+ public /*name*/IntIntHashMap/*name*/(final int initialCapacity) {
this(initialCapacity, 0.75f);
}
- public /*name*/IntIntHashMap/*name*/(int initialCapacity, float loadFactor) {
+ public /*name*/IntIntHashMap/*name*/(final int initialCapacity, final float loadFactor) {
if (initialCapacity > 1 << 30) {
throw new IllegalArgumentException("initialCapacity is too large.");
}
@@ -135,9 +135,9 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable,
this.mask = capacity - 1;
}
- private /*name*/IntIntHashMap/*name*/(float loadFactor, int table_size, int size,
- int mask, int capacity, int threshold,
- /*value*/int/*value*/ keyNotFoundValue) {
+ private /*name*/IntIntHashMap/*name*/(final float loadFactor, final int table_size, final int size,
+ final int mask, final int capacity, final int threshold,
+ final /*value*/int/*value*/ keyNotFoundValue) {
this.loadFactor = loadFactor;
this.table = new Entry[table_size];
this.size = size;
@@ -157,7 +157,7 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable,
*/
@Override
public Object clone() {
- /*name*/IntIntHashMap/*name*/ n =
+ final /*name*/IntIntHashMap/*name*/ n =
new /*name*/IntIntHashMap/*name*/(loadFactor, table.length, size,
mask, capacity, threshold,
keyNotFoundValue);
@@ -187,8 +187,8 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable,
return n;
}
- public boolean containsValue(/*value*/int/*value*/ value) {
- Entry[] t = this.table;
+ public boolean containsValue(final /*value*/int/*value*/ value) {
+ final Entry[] t = this.table;
for (int i = t.length; i-- > 0;) {
for (Entry e = t[i]; e != null; e = e.next) {
if( isPrimitive ) {
@@ -207,7 +207,7 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable,
}
// @SuppressWarnings(value="cast")
- public boolean containsKey(/*key*/int/*key*/ key) {
+ public boolean containsKey(final /*key*/int/*key*/ key) {
final Entry[] t = this.table;
final int index = /*keyHash*/key/*keyHash*/ & mask;
for (Entry e = t[index]; e != null; e = e.next) {
@@ -223,7 +223,7 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable,
* or {@link #getKeyNotFoundValue} if this map contains no mapping for the key.
*/
// @SuppressWarnings(value="cast")
- public /*value*/int/*value*/ get(/*key*/int/*key*/ key) {
+ public /*value*/int/*value*/ get(final /*key*/int/*key*/ key) {
final Entry[] t = this.table;
final int index = /*keyHash*/key/*keyHash*/ & mask;
for (Entry e = t[index]; e != null; e = e.next) {
@@ -239,7 +239,7 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable,
* the previous value will be returned (otherwise {@link #getKeyNotFoundValue}).
*/
// @SuppressWarnings(value="cast")
- public /*value*/int/*value*/ put(/*key*/int/*key*/ key, /*value*/int/*value*/ value) {
+ public /*value*/int/*value*/ put(final /*key*/int/*key*/ key, final /*value*/int/*value*/ value) {
final Entry[] t = this.table;
final int index = /*keyHash*/key/*keyHash*/ & mask;
// Check if key already exists.
@@ -247,7 +247,7 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable,
if (e.key != key) {
continue;
}
- /*value*/int/*value*/ oldValue = e.value;
+ final /*value*/int/*value*/ oldValue = e.value;
e.value = value;
return oldValue;
}
@@ -263,7 +263,7 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable,
if (e != null) {
t[j] = null;
do {
- Entry next = e.next;
+ final Entry next = e.next;
final int index2 = /*keyHash*/e.key/*keyHash*/ & newMask;
e.next = newTable[index2];
newTable[index2] = e;
@@ -282,7 +282,7 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable,
/**
* Copies all of the mappings from the specified map to this map.
*/
- public void putAll(/*name*/IntIntHashMap/*name*/ source) {
+ public void putAll(final /*name*/IntIntHashMap/*name*/ source) {
final Iterator<Entry> itr = source.iterator();
while(itr.hasNext()) {
final Entry e = itr.next();
@@ -295,14 +295,14 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable,
* Returns the previously mapped value or {@link #getKeyNotFoundValue} if no such mapping exists.
*/
// @SuppressWarnings(value="cast")
- public /*value*/int/*value*/ remove(/*key*/int/*key*/ key) {
+ public /*value*/int/*value*/ remove(final /*key*/int/*key*/ key) {
final Entry[] t = this.table;
final int index = /*keyHash*/key/*keyHash*/ & mask;
Entry prev = t[index];
Entry e = prev;
while (e != null) {
- Entry next = e.next;
+ final Entry next = e.next;
if (e.key == key) {
size--;
if (prev == e) {
@@ -358,8 +358,8 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable,
* @see #get
* @see #put
*/
- public /*value*/int/*value*/ setKeyNotFoundValue(/*value*/int/*value*/ newKeyNotFoundValue) {
- /*value*/int/*value*/ t = keyNotFoundValue;
+ public /*value*/int/*value*/ setKeyNotFoundValue(final /*value*/int/*value*/ newKeyNotFoundValue) {
+ final /*value*/int/*value*/ t = keyNotFoundValue;
keyNotFoundValue = newKeyNotFoundValue;
return t;
}
@@ -382,7 +382,7 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable,
sb = new StringBuilder();
}
sb.append("{");
- Iterator<Entry> itr = iterator();
+ final Iterator<Entry> itr = iterator();
while(itr.hasNext()) {
itr.next().toString(sb);
if(itr.hasNext()) {
@@ -405,7 +405,7 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable,
private int index;
private Entry next;
- private EntryIterator(Entry[] entries){
+ private EntryIterator(final Entry[] entries){
this.entries = entries;
// load next
next();
@@ -424,7 +424,7 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable,
next = current.next;
}else{
while(index < entries.length) {
- Entry e = entries[index++];
+ final Entry e = entries[index++];
if(e != null) {
next = e;
return current;
@@ -453,7 +453,7 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable,
private Entry next;
- Entry(/*key*/int/*key*/ k, /*value*/int/*value*/ v, Entry n) {
+ Entry(final /*key*/int/*key*/ k, final /*value*/int/*value*/ v, final Entry n) {
key = k;
value = v;
next = n;
@@ -476,7 +476,7 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable,
/**
* Sets the value for this entry.
*/
- public void setValue(/*value*/int/*value*/ value) {
+ public void setValue(final /*value*/int/*value*/ value) {
this.value = value;
}
@@ -499,14 +499,14 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable,
}
- private static Method getCloneMethod(Object obj) {
+ private static Method getCloneMethod(final Object obj) {
final Class<?> clazz = obj.getClass();
return AccessController.doPrivileged(new PrivilegedAction<Method>() {
@Override
public Method run() {
try {
return clazz.getDeclaredMethod("clone");
- } catch (NoSuchMethodException ex) {
+ } catch (final NoSuchMethodException ex) {
throw new JogampRuntimeException("Class "+clazz+" doesn't support clone()", ex);
}
} } );
diff --git a/src/java/com/jogamp/common/util/JarUtil.java b/src/java/com/jogamp/common/util/JarUtil.java
index 77f1a84..eeee82a 100644
--- a/src/java/com/jogamp/common/util/JarUtil.java
+++ b/src/java/com/jogamp/common/util/JarUtil.java
@@ -83,7 +83,7 @@ public class JarUtil {
* @throws SecurityException if the security manager doesn't have the setFactory
* permission
*/
- public static void setResolver(Resolver r) throws IllegalArgumentException, IllegalStateException, SecurityException {
+ public static void setResolver(final Resolver r) throws IllegalArgumentException, IllegalStateException, SecurityException {
if(r == null) {
throw new IllegalArgumentException("Null Resolver passed");
}
@@ -113,10 +113,10 @@ public class JarUtil {
* @return true if the class is loaded from a Jar file, otherwise false.
* @see {@link #getJarURI(String, ClassLoader)}
*/
- public static boolean hasJarURI(String clazzBinName, ClassLoader cl) {
+ public static boolean hasJarURI(final String clazzBinName, final ClassLoader cl) {
try {
return null != getJarURI(clazzBinName, cl);
- } catch (Exception e) { /* ignore */ }
+ } catch (final Exception e) { /* ignore */ }
return false;
}
@@ -136,7 +136,7 @@ public class JarUtil {
* @throws URISyntaxException if the URI could not be translated into a RFC 2396 URI
* @see {@link IOUtil#getClassURL(String, ClassLoader)}
*/
- public static URI getJarURI(String clazzBinName, ClassLoader cl) throws IllegalArgumentException, IOException, URISyntaxException {
+ public static URI getJarURI(final String clazzBinName, final ClassLoader cl) throws IllegalArgumentException, IOException, URISyntaxException {
if(null == clazzBinName || null == cl) {
throw new IllegalArgumentException("null arguments: clazzBinName "+clazzBinName+", cl "+cl);
}
@@ -187,7 +187,7 @@ public class JarUtil {
* @throws IllegalArgumentException if the URI doesn't match the expected formatting or is null
* @see {@link IOUtil#getClassURL(String, ClassLoader)}
*/
- public static String getJarBasename(URI classJarURI) throws IllegalArgumentException {
+ public static String getJarBasename(final URI classJarURI) throws IllegalArgumentException {
if(null == classJarURI) {
throw new IllegalArgumentException("URI is null");
}
@@ -246,7 +246,7 @@ public class JarUtil {
* @throws URISyntaxException if the URI could not be translated into a RFC 2396 URI
* @see {@link IOUtil#getClassURL(String, ClassLoader)}
*/
- public static String getJarBasename(String clazzBinName, ClassLoader cl) throws IllegalArgumentException, IOException, URISyntaxException {
+ public static String getJarBasename(final String clazzBinName, final ClassLoader cl) throws IllegalArgumentException, IOException, URISyntaxException {
return getJarBasename( getJarURI(clazzBinName, cl) );
}
@@ -264,7 +264,7 @@ public class JarUtil {
* @throws URISyntaxException if the URI could not be translated into a RFC 2396 URI
* @see {@link IOUtil#getClassURL(String, ClassLoader)}
*/
- public static URI getJarSubURI(URI classJarURI) throws IllegalArgumentException, URISyntaxException {
+ public static URI getJarSubURI(final URI classJarURI) throws IllegalArgumentException, URISyntaxException {
if(null == classJarURI) {
throw new IllegalArgumentException("URI is null");
}
@@ -277,7 +277,7 @@ public class JarUtil {
// to
// file:/some/path/gluegen-rt.jar
final String uriS0 = classJarURI.getSchemeSpecificPart();
- int idx = uriS0.lastIndexOf(IOUtil.JAR_SCHEME_SEPARATOR);
+ final int idx = uriS0.lastIndexOf(IOUtil.JAR_SCHEME_SEPARATOR);
final String uriS1;
if (0 <= idx) {
uriS1 = uriS0.substring(0, idx); // exclude '!/'
@@ -303,7 +303,7 @@ public class JarUtil {
* @return <code>/com/jogamp/common/GlueGenVersion.class</code>
* @see {@link IOUtil#getClassURL(String, ClassLoader)}
*/
- public static String getJarEntry(URI classJarURI) {
+ public static String getJarEntry(final URI classJarURI) {
if(null == classJarURI) {
throw new IllegalArgumentException("URI is null");
}
@@ -345,7 +345,7 @@ public class JarUtil {
* @throws URISyntaxException if the URI could not be translated into a RFC 2396 URI
* @see {@link IOUtil#getClassURL(String, ClassLoader)}
*/
- public static URI getJarSubURI(String clazzBinName, ClassLoader cl) throws IllegalArgumentException, IOException, URISyntaxException {
+ public static URI getJarSubURI(final String clazzBinName, final ClassLoader cl) throws IllegalArgumentException, IOException, URISyntaxException {
return getJarSubURI( getJarURI(clazzBinName, cl) );
}
@@ -365,7 +365,7 @@ public class JarUtil {
* @throws URISyntaxException if the URI could not be translated into a RFC 2396 URI
* @see {@link IOUtil#getClassURL(String, ClassLoader)}
*/
- public static URI getJarFileURI(String clazzBinName, ClassLoader cl) throws IllegalArgumentException, IOException, URISyntaxException {
+ public static URI getJarFileURI(final String clazzBinName, final ClassLoader cl) throws IllegalArgumentException, IOException, URISyntaxException {
if(null == clazzBinName || null == cl) {
throw new IllegalArgumentException("null arguments: clazzBinName "+clazzBinName+", cl "+cl);
}
@@ -383,7 +383,7 @@ public class JarUtil {
* @throws URISyntaxException
* @throws IllegalArgumentException null arguments
*/
- public static URI getJarFileURI(URI baseUri, String jarFileName) throws IllegalArgumentException, URISyntaxException {
+ public static URI getJarFileURI(final URI baseUri, final String jarFileName) throws IllegalArgumentException, URISyntaxException {
if(null == baseUri || null == jarFileName) {
throw new IllegalArgumentException("null arguments: baseURI "+baseUri+", jarFileName "+jarFileName);
}
@@ -396,7 +396,7 @@ public class JarUtil {
* @throws IllegalArgumentException null arguments
* @throws URISyntaxException
*/
- public static URI getJarFileURI(URI jarSubUri) throws IllegalArgumentException, URISyntaxException {
+ public static URI getJarFileURI(final URI jarSubUri) throws IllegalArgumentException, URISyntaxException {
if(null == jarSubUri) {
throw new IllegalArgumentException("jarSubURI is null");
}
@@ -409,7 +409,7 @@ public class JarUtil {
* @throws IllegalArgumentException null arguments
* @throws URISyntaxException
*/
- public static URI getJarFileURI(String jarSubUriS) throws IllegalArgumentException, URISyntaxException {
+ public static URI getJarFileURI(final String jarSubUriS) throws IllegalArgumentException, URISyntaxException {
if(null == jarSubUriS) {
throw new IllegalArgumentException("jarSubURIS is null");
}
@@ -423,7 +423,7 @@ public class JarUtil {
* @throws IllegalArgumentException null arguments
* @throws URISyntaxException
*/
- public static URI getJarEntryURI(URI jarFileURI, String jarEntry) throws IllegalArgumentException, URISyntaxException {
+ public static URI getJarEntryURI(final URI jarFileURI, final String jarEntry) throws IllegalArgumentException, URISyntaxException {
if(null == jarEntry) {
throw new IllegalArgumentException("jarEntry is null");
}
@@ -439,7 +439,7 @@ public class JarUtil {
* @throws URISyntaxException if the URI could not be translated into a RFC 2396 URI
* @see {@link #getJarFileURI(String, ClassLoader)}
*/
- public static JarFile getJarFile(String clazzBinName, ClassLoader cl) throws IOException, IllegalArgumentException, URISyntaxException {
+ public static JarFile getJarFile(final String clazzBinName, final ClassLoader cl) throws IOException, IllegalArgumentException, URISyntaxException {
return getJarFile( getJarFileURI(clazzBinName, cl) );
}
@@ -450,7 +450,7 @@ public class JarUtil {
* @throws IOException if the Jar file could not been found
* @throws URISyntaxException
*/
- public static JarFile getJarFile(URI jarFileURI) throws IOException, IllegalArgumentException, URISyntaxException {
+ public static JarFile getJarFile(final URI jarFileURI) throws IOException, IllegalArgumentException, URISyntaxException {
if(null == jarFileURI) {
throw new IllegalArgumentException("null jarFileURI");
}
@@ -464,8 +464,8 @@ public class JarUtil {
// final URL jarFileURL = jarFileURI.toURL(); // doesn't work due to encoded path even w/ file schema!
final URLConnection urlc = jarFileURL.openConnection();
if(urlc instanceof JarURLConnection) {
- JarURLConnection jarConnection = (JarURLConnection)jarFileURL.openConnection();
- JarFile jarFile = jarConnection.getJarFile();
+ final JarURLConnection jarConnection = (JarURLConnection)jarFileURL.openConnection();
+ final JarFile jarFile = jarConnection.getJarFile();
if(DEBUG) {
System.err.println("getJarFile res: "+jarFile.getName());
}
@@ -509,7 +509,7 @@ public class JarUtil {
* @throws IOException
* @throws URISyntaxException
*/
- public static URI getRelativeOf(Class<?> classFromJavaJar, String cutOffInclSubDir, String relResPath) throws IllegalArgumentException, IOException, URISyntaxException {
+ public static URI getRelativeOf(final Class<?> classFromJavaJar, final String cutOffInclSubDir, final String relResPath) throws IllegalArgumentException, IOException, URISyntaxException {
final ClassLoader cl = classFromJavaJar.getClassLoader();
final URI classJarURI = JarUtil.getJarURI(classFromJavaJar.getName(), cl);
if( DEBUG ) {
@@ -546,7 +546,7 @@ public class JarUtil {
/**
* Return a map from native-lib-base-name to entry-name.
*/
- public static Map<String, String> getNativeLibNames(JarFile jarFile) {
+ public static Map<String, String> getNativeLibNames(final JarFile jarFile) {
if (DEBUG) {
System.err.println("JarUtil: getNativeLibNames: "+jarFile);
}
@@ -602,11 +602,11 @@ public class JarUtil {
* @return
* @throws IOException
*/
- public static final int extract(File dest, Map<String, String> nativeLibMap,
- JarFile jarFile,
- String nativeLibraryPath,
- boolean extractNativeLibraries,
- boolean extractClassFiles, boolean extractOtherFiles) throws IOException {
+ public static final int extract(final File dest, final Map<String, String> nativeLibMap,
+ final JarFile jarFile,
+ final String nativeLibraryPath,
+ final boolean extractNativeLibraries,
+ final boolean extractClassFiles, final boolean extractOtherFiles) throws IOException {
if (DEBUG) {
System.err.println("JarUtil: extract: "+jarFile.getName()+" -> "+dest+
@@ -616,10 +616,10 @@ public class JarUtil {
}
int num = 0;
- Enumeration<JarEntry> entries = jarFile.entries();
+ final Enumeration<JarEntry> entries = jarFile.entries();
while (entries.hasMoreElements()) {
- JarEntry entry = entries.nextElement();
- String entryName = entry.getName();
+ final JarEntry entry = entries.nextElement();
+ final String entryName = entry.getName();
// Match entries with correct prefix and suffix (ignoring case)
final String libBaseName = NativeLibrary.isValidNativeLibraryName(entryName, false);
@@ -637,7 +637,7 @@ public class JarUtil {
try {
nativeLibraryPathS = IOUtil.slashify(nativeLibraryPath, false /* startWithSlash */, true /* endWithSlash */);
dirnameS = IOUtil.getDirname(entryName);
- } catch (URISyntaxException e) {
+ } catch (final URISyntaxException e) {
throw new IOException(e);
}
if( !nativeLibraryPathS.equals(dirnameS) ) {
@@ -721,7 +721,7 @@ public class JarUtil {
* <li>Bug 865: Safari >= 6.1 [OSX]: May employ xattr on 'com.apple.quarantine' on 'PluginProcess.app'</li>
* </ul>
*/
- private final static void fixNativeLibAttribs(File file) {
+ private final static void fixNativeLibAttribs(final File file) {
// We tolerate UnsatisfiedLinkError (and derived) to solve the chicken and egg problem
// of loading gluegen's native library.
// On Safari(OSX), Bug 865, we simply hope the destination folder is executable.
@@ -732,7 +732,7 @@ public class JarUtil {
if( DEBUG ) {
System.err.println("JarUtil.fixNativeLibAttribs: "+fileAbsPath+" - OK");
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
if( DEBUG ) {
System.err.println("JarUtil.fixNativeLibAttribs: "+fileAbsPath+" - "+t.getClass().getSimpleName()+": "+t.getMessage());
}
@@ -749,7 +749,7 @@ public class JarUtil {
getCodeSource().getCertificates();
</pre>
*/
- public static final void validateCertificates(Certificate[] rootCerts, JarFile jarFile)
+ public static final void validateCertificates(final Certificate[] rootCerts, final JarFile jarFile)
throws IOException, SecurityException {
if (DEBUG) {
@@ -760,8 +760,8 @@ public class JarUtil {
throw new IllegalArgumentException("Null certificates passed");
}
- byte[] buf = new byte[1024];
- Enumeration<JarEntry> entries = jarFile.entries();
+ final byte[] buf = new byte[1024];
+ final Enumeration<JarEntry> entries = jarFile.entries();
while (entries.hasMoreElements()) {
final JarEntry entry = entries.nextElement();
if( ! entry.isDirectory() && ! entry.getName().startsWith("META-INF/") ) {
@@ -775,8 +775,8 @@ public class JarUtil {
* Check the certificates with the ones in the jar file
* (all must match).
*/
- private static final void validateCertificate(Certificate[] rootCerts,
- JarFile jar, JarEntry entry, byte[] buf) throws IOException, SecurityException {
+ private static final void validateCertificate(final Certificate[] rootCerts,
+ final JarFile jar, final JarEntry entry, final byte[] buf) throws IOException, SecurityException {
if (DEBUG) {
System.err.println("JarUtil: validate JarEntry : " + entry.getName());
@@ -785,7 +785,7 @@ public class JarUtil {
// API states that we must read all of the data from the entry's
// InputStream in order to be able to get its certificates
- InputStream is = jar.getInputStream(entry);
+ final InputStream is = jar.getInputStream(entry);
try {
while (is.read(buf) > 0) { }
} finally {
diff --git a/src/java/com/jogamp/common/util/JogampVersion.java b/src/java/com/jogamp/common/util/JogampVersion.java
index 2789de7..2ff7d81 100644
--- a/src/java/com/jogamp/common/util/JogampVersion.java
+++ b/src/java/com/jogamp/common/util/JogampVersion.java
@@ -47,15 +47,15 @@ public class JogampVersion {
/** See {@link #getImplementationCommit()} */
public static final Attributes.Name IMPLEMENTATION_COMMIT = new Attributes.Name("Implementation-Commit");
- private String packageName;
- private Manifest mf;
- private int hash;
- private Attributes mainAttributes;
- private Set<?>/*<Attributes.Name>*/ mainAttributeNames;
+ private final String packageName;
+ private final Manifest mf;
+ private final int hash;
+ private final Attributes mainAttributes;
+ private final Set<?>/*<Attributes.Name>*/ mainAttributeNames;
private final String androidPackageVersionName;
- protected JogampVersion(String packageName, Manifest mf) {
+ protected JogampVersion(final String packageName, final Manifest mf) {
this.packageName = packageName;
this.mf = ( null != mf ) ? mf : new Manifest();
this.hash = this.mf.hashCode();
@@ -70,7 +70,7 @@ public class JogampVersion {
}
@Override
- public final boolean equals(Object o) {
+ public final boolean equals(final Object o) {
if (o instanceof JogampVersion) {
return mf.equals(((JogampVersion) o).getManifest());
}
@@ -85,17 +85,17 @@ public class JogampVersion {
return packageName;
}
- public final String getAttribute(Attributes.Name attributeName) {
+ public final String getAttribute(final Attributes.Name attributeName) {
return (null != attributeName) ? (String) mainAttributes.get(attributeName) : null;
}
- public final String getAttribute(String attributeName) {
+ public final String getAttribute(final String attributeName) {
return getAttribute(getAttributeName(attributeName));
}
- public final Attributes.Name getAttributeName(String attributeName) {
- for (Iterator<?> iter = mainAttributeNames.iterator(); iter.hasNext();) {
- Attributes.Name an = (Attributes.Name) iter.next();
+ public final Attributes.Name getAttributeName(final String attributeName) {
+ for (final Iterator<?> iter = mainAttributeNames.iterator(); iter.hasNext();) {
+ final Attributes.Name an = (Attributes.Name) iter.next();
if (an.toString().equals(attributeName)) {
return an;
}
@@ -121,21 +121,21 @@ public class JogampVersion {
* Returns the implementation build number, e.g. <code>2.0-b456-20130328</code>.
*/
public final String getImplementationBuild() {
- return this.getAttribute(GlueGenVersion.IMPLEMENTATION_BUILD);
+ return this.getAttribute(JogampVersion.IMPLEMENTATION_BUILD);
}
/**
* Returns the SCM branch name
*/
public final String getImplementationBranch() {
- return this.getAttribute(GlueGenVersion.IMPLEMENTATION_BRANCH);
+ return this.getAttribute(JogampVersion.IMPLEMENTATION_BRANCH);
}
/**
* Returns the SCM version of the last commit, e.g. git's sha1
*/
public final String getImplementationCommit() {
- return this.getAttribute(GlueGenVersion.IMPLEMENTATION_COMMIT);
+ return this.getAttribute(JogampVersion.IMPLEMENTATION_COMMIT);
}
public final String getImplementationTitle() {
@@ -181,7 +181,7 @@ public class JogampVersion {
return this.getAttribute(Attributes.Name.SPECIFICATION_VERSION);
}
- public final StringBuilder getFullManifestInfo(StringBuilder sb) {
+ public final StringBuilder getFullManifestInfo(final StringBuilder sb) {
return VersionUtil.getFullManifestInfo(getManifest(), sb);
}
@@ -189,7 +189,7 @@ public class JogampVersion {
if(null==sb) {
sb = new StringBuilder();
}
- String nl = Platform.getNewline();
+ final String nl = Platform.getNewline();
sb.append("Package: ").append(getPackageName()).append(nl);
sb.append("Extension Name: ").append(getExtensionName()).append(nl);
sb.append("Specification Title: ").append(getSpecificationTitle()).append(nl);
diff --git a/src/java/com/jogamp/common/util/LFRingbuffer.java b/src/java/com/jogamp/common/util/LFRingbuffer.java
index a0418c5..685c529 100644
--- a/src/java/com/jogamp/common/util/LFRingbuffer.java
+++ b/src/java/com/jogamp/common/util/LFRingbuffer.java
@@ -87,7 +87,7 @@ public class LFRingbuffer<T> implements Ringbuffer<T> {
}
@Override
- public final void dump(PrintStream stream, String prefix) {
+ public final void dump(final PrintStream stream, final String prefix) {
stream.println(prefix+" "+toString()+" {");
for(int i=0; i<capacityPlusOne; i++) {
stream.println("\t["+i+"]: "+array[i]);
@@ -116,7 +116,7 @@ public class LFRingbuffer<T> implements Ringbuffer<T> {
* @throws IllegalArgumentException if <code>copyFrom</code> is <code>null</code>
*/
@SuppressWarnings("unchecked")
- public LFRingbuffer(T[] copyFrom) throws IllegalArgumentException {
+ public LFRingbuffer(final T[] copyFrom) throws IllegalArgumentException {
capacityPlusOne = copyFrom.length + 1;
array = (T[]) newArray(copyFrom.getClass(), capacityPlusOne);
resetImpl(true, copyFrom);
@@ -139,9 +139,9 @@ public class LFRingbuffer<T> implements Ringbuffer<T> {
* @param arrayType the array type of the created empty internal array.
* @param capacity the initial net capacity of the ring buffer
*/
- public LFRingbuffer(Class<? extends T[]> arrayType, int capacity) {
+ public LFRingbuffer(final Class<? extends T[]> arrayType, final int capacity) {
capacityPlusOne = capacity+1;
- array = (T[]) newArray(arrayType, capacityPlusOne);
+ array = newArray(arrayType, capacityPlusOne);
resetImpl(false, null /* empty, nothing to copy */ );
}
@@ -162,11 +162,11 @@ public class LFRingbuffer<T> implements Ringbuffer<T> {
}
@Override
- public final void resetFull(T[] copyFrom) throws IllegalArgumentException {
+ public final void resetFull(final T[] copyFrom) throws IllegalArgumentException {
resetImpl(true, copyFrom);
}
- private final void resetImpl(boolean full, T[] copyFrom) throws IllegalArgumentException {
+ private final void resetImpl(final boolean full, final T[] copyFrom) throws IllegalArgumentException {
synchronized ( syncGlobal ) {
if( null != copyFrom ) {
if( copyFrom.length != capacityPlusOne-1 ) {
@@ -210,7 +210,7 @@ public class LFRingbuffer<T> implements Ringbuffer<T> {
public final T get() {
try {
return getImpl(false, false);
- } catch (InterruptedException ie) { throw new RuntimeException(ie); }
+ } catch (final InterruptedException ie) { throw new RuntimeException(ie); }
}
/**
@@ -228,14 +228,14 @@ public class LFRingbuffer<T> implements Ringbuffer<T> {
public final T peek() {
try {
return getImpl(false, true);
- } catch (InterruptedException ie) { throw new RuntimeException(ie); }
+ } catch (final InterruptedException ie) { throw new RuntimeException(ie); }
}
@Override
public final T peekBlocking() throws InterruptedException {
return getImpl(true, true);
}
- private final T getImpl(boolean blocking, boolean peek) throws InterruptedException {
+ private final T getImpl(final boolean blocking, final boolean peek) throws InterruptedException {
int localReadPos = readPos;
if( localReadPos == writePos ) {
if( blocking ) {
@@ -268,10 +268,10 @@ public class LFRingbuffer<T> implements Ringbuffer<T> {
* </p>
*/
@Override
- public final boolean put(T e) {
+ public final boolean put(final T e) {
try {
return putImpl(e, false, false);
- } catch (InterruptedException ie) { throw new RuntimeException(ie); }
+ } catch (final InterruptedException ie) { throw new RuntimeException(ie); }
}
/**
@@ -281,7 +281,7 @@ public class LFRingbuffer<T> implements Ringbuffer<T> {
* </p>
*/
@Override
- public final void putBlocking(T e) throws InterruptedException {
+ public final void putBlocking(final T e) throws InterruptedException {
if( !putImpl(e, false, true) ) {
throw new InternalError("Blocking put failed: "+this);
}
@@ -294,11 +294,11 @@ public class LFRingbuffer<T> implements Ringbuffer<T> {
* </p>
*/
@Override
- public final boolean putSame(boolean blocking) throws InterruptedException {
+ public final boolean putSame(final boolean blocking) throws InterruptedException {
return putImpl(null, true, blocking);
}
- private final boolean putImpl(T e, boolean sameRef, boolean blocking) throws InterruptedException {
+ private final boolean putImpl(final T e, final boolean sameRef, final boolean blocking) throws InterruptedException {
int localWritePos = writePos;
localWritePos = (localWritePos + 1) % capacityPlusOne;
if( localWritePos == readPos ) {
@@ -325,7 +325,7 @@ public class LFRingbuffer<T> implements Ringbuffer<T> {
@Override
- public final void waitForFreeSlots(int count) throws InterruptedException {
+ public final void waitForFreeSlots(final int count) throws InterruptedException {
synchronized ( syncRead ) {
if( capacityPlusOne - 1 - size < count ) {
while( capacityPlusOne - 1 - size < count ) {
@@ -361,7 +361,7 @@ public class LFRingbuffer<T> implements Ringbuffer<T> {
final int growAmount = newElements.length;
final int newCapacity = capacityPlusOne + growAmount;
final T[] oldArray = array;
- final T[] newArray = (T[]) newArray(arrayTypeInternal, newCapacity);
+ final T[] newArray = newArray(arrayTypeInternal, newCapacity);
// writePos == readPos
writePos += growAmount; // warp writePos to the end of the new data location
@@ -401,7 +401,7 @@ public class LFRingbuffer<T> implements Ringbuffer<T> {
final int newCapacity = capacityPlusOne + growAmount;
final T[] oldArray = array;
- final T[] newArray = (T[]) newArray(arrayTypeInternal, newCapacity);
+ final T[] newArray = newArray(arrayTypeInternal, newCapacity);
// writePos == readPos - 1
readPos = ( writePos + 1 + growAmount ) % newCapacity; // warp readPos to the end of the new data location
@@ -420,7 +420,7 @@ public class LFRingbuffer<T> implements Ringbuffer<T> {
}
@SuppressWarnings("unchecked")
- private static <T> T[] newArray(Class<? extends T[]> arrayType, int length) {
+ private static <T> T[] newArray(final Class<? extends T[]> arrayType, final int length) {
return ((Object)arrayType == (Object)Object[].class)
? (T[]) new Object[length]
: (T[]) Array.newInstance(arrayType.getComponentType(), length);
diff --git a/src/java/com/jogamp/common/util/PropertyAccess.java b/src/java/com/jogamp/common/util/PropertyAccess.java
index a2e3690..b6e9bdd 100644
--- a/src/java/com/jogamp/common/util/PropertyAccess.java
+++ b/src/java/com/jogamp/common/util/PropertyAccess.java
@@ -59,12 +59,12 @@ public class PropertyAccess {
* @param prefix New prefix to be registered as trusted.
* @throws AccessControlException as thrown by {@link SecurityUtil#checkAllPermissions()}.
*/
- protected static final void addTrustedPrefix(String prefix) throws AccessControlException {
+ protected static final void addTrustedPrefix(final String prefix) throws AccessControlException {
SecurityUtil.checkAllPermissions();
trustedPrefixes.add(prefix);
}
- public static final boolean isTrusted(String propertyKey) {
+ public static final boolean isTrusted(final String propertyKey) {
final int dot1 = propertyKey.indexOf('.');
if(0<=dot1) {
return trustedPrefixes.contains(propertyKey.substring(0, dot1+1)) || trusted.contains(propertyKey);
@@ -74,26 +74,26 @@ public class PropertyAccess {
}
/** @see #getProperty(String, boolean) */
- public static final int getIntProperty(final String property, final boolean jnlpAlias, int defaultValue) {
+ public static final int getIntProperty(final String property, final boolean jnlpAlias, final int defaultValue) {
int i=defaultValue;
try {
final String sv = PropertyAccess.getProperty(property, jnlpAlias);
if(null!=sv) {
i = Integer.parseInt(sv);
}
- } catch (NumberFormatException nfe) {}
+ } catch (final NumberFormatException nfe) {}
return i;
}
/** @see #getProperty(String, boolean) */
- public static final long getLongProperty(final String property, final boolean jnlpAlias, long defaultValue) {
+ public static final long getLongProperty(final String property, final boolean jnlpAlias, final long defaultValue) {
long l=defaultValue;
try {
final String sv = PropertyAccess.getProperty(property, jnlpAlias);
if(null!=sv) {
l = Long.parseLong(sv);
}
- } catch (NumberFormatException nfe) {}
+ } catch (final NumberFormatException nfe) {}
return l;
}
@@ -103,7 +103,7 @@ public class PropertyAccess {
}
/** @see #getProperty(String, boolean) */
- public static final boolean getBooleanProperty(final String property, final boolean jnlpAlias, boolean defaultValue) {
+ public static final boolean getBooleanProperty(final String property, final boolean jnlpAlias, final boolean defaultValue) {
final String valueS = PropertyAccess.getProperty(property, jnlpAlias);
if(null != valueS) {
return Boolean.valueOf(valueS).booleanValue();
@@ -164,7 +164,7 @@ public class PropertyAccess {
}
/** See {@link #getProperty(String, boolean)}, additionally allows a <code>defaultValue</code> if property value is <code>null</code>. */
- public static final String getProperty(final String propertyKey, final boolean jnlpAlias, String defaultValue)
+ public static final String getProperty(final String propertyKey, final boolean jnlpAlias, final String defaultValue)
throws SecurityException, NullPointerException, IllegalArgumentException {
final String s = PropertyAccess.getProperty(propertyKey, jnlpAlias);
if( null != s ) {
@@ -180,7 +180,7 @@ public class PropertyAccess {
public String run() {
try {
return System.getProperty(propertyKey);
- } catch (SecurityException se) {
+ } catch (final SecurityException se) {
throw new SecurityException("Could not access trusted property '"+propertyKey+"'", se);
}
}
diff --git a/src/java/com/jogamp/common/util/ReflectionUtil.java b/src/java/com/jogamp/common/util/ReflectionUtil.java
index 949df1d..7117f56 100644
--- a/src/java/com/jogamp/common/util/ReflectionUtil.java
+++ b/src/java/com/jogamp/common/util/ReflectionUtil.java
@@ -63,7 +63,7 @@ public final class ReflectionUtil {
static {
Debug.initSingleton();
DEBUG = Debug.debug("ReflectionUtil");
- DEBUG_STATS_FORNAME = Debug.isPropertyDefined("jogamp.debug.ReflectionUtil.forNameStats", true);
+ DEBUG_STATS_FORNAME = PropertyAccess.isPropertyDefined("jogamp.debug.ReflectionUtil.forNameStats", true);
if(DEBUG_STATS_FORNAME) {
forNameLock = new Object();
forNameStats = new HashMap<String, ClassNameLookup>();
@@ -81,7 +81,7 @@ public final class ReflectionUtil {
private static final Class<?>[] zeroTypes = new Class[0];
private static class ClassNameLookup {
- public ClassNameLookup(String name) {
+ public ClassNameLookup(final String name) {
this.name = name;
this.nanoCosts = 0;
this.count = 0;
@@ -111,7 +111,7 @@ public final class ReflectionUtil {
sb.append(String.format("ReflectionUtil.forName: %8.3f ms, %03d invoc%n", forNameNanoCosts/1e6, forNameCount));
final Set<Entry<String, ClassNameLookup>> entries = forNameStats.entrySet();
int entryNum = 0;
- for(Iterator<Entry<String, ClassNameLookup>> iter = entries.iterator(); iter.hasNext(); entryNum++) {
+ for(final Iterator<Entry<String, ClassNameLookup>> iter = entries.iterator(); iter.hasNext(); entryNum++) {
final Entry<String, ClassNameLookup> entry = iter.next();
sb.append(String.format("ReflectionUtil.forName[%03d]: %s%n", entryNum, entry.getValue()));
}
@@ -120,7 +120,7 @@ public final class ReflectionUtil {
return sb;
}
- private static Class<?> getClassImpl(String clazzName, boolean initializeClazz, ClassLoader cl) throws ClassNotFoundException {
+ private static Class<?> getClassImpl(final String clazzName, final boolean initializeClazz, final ClassLoader cl) throws ClassNotFoundException {
if(DEBUG_STATS_FORNAME) {
final long t0 = System.nanoTime();
final Class<?> res = Class.forName(clazzName, initializeClazz, cl);
@@ -151,10 +151,10 @@ public final class ReflectionUtil {
/**
* Returns true only if the class could be loaded.
*/
- public static final boolean isClassAvailable(String clazzName, ClassLoader cl) {
+ public static final boolean isClassAvailable(final String clazzName, final ClassLoader cl) {
try {
return null != getClassImpl(clazzName, false, cl);
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
return false;
}
}
@@ -163,11 +163,11 @@ public final class ReflectionUtil {
* Loads and returns the class or null.
* @see Class#forName(java.lang.String, boolean, java.lang.ClassLoader)
*/
- public static final Class<?> getClass(String clazzName, boolean initializeClazz, ClassLoader cl)
+ public static final Class<?> getClass(final String clazzName, final boolean initializeClazz, final ClassLoader cl)
throws JogampRuntimeException {
try {
return getClassImpl(clazzName, initializeClazz, cl);
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
throw new JogampRuntimeException(clazzName + " not available", e);
}
}
@@ -176,17 +176,17 @@ public final class ReflectionUtil {
* @param initializeClazz TODO
* @throws JogampRuntimeException if the constructor can not be delivered.
*/
- public static final Constructor<?> getConstructor(String clazzName, Class<?>[] cstrArgTypes, boolean initializeClazz, ClassLoader cl)
+ public static final Constructor<?> getConstructor(final String clazzName, final Class<?>[] cstrArgTypes, final boolean initializeClazz, final ClassLoader cl)
throws JogampRuntimeException {
try {
return getConstructor(getClassImpl(clazzName, initializeClazz, cl), cstrArgTypes);
- } catch (ClassNotFoundException ex) {
+ } catch (final ClassNotFoundException ex) {
throw new JogampRuntimeException(clazzName + " not available", ex);
}
}
- static final String asString(Class<?>[] argTypes) {
- StringBuilder args = new StringBuilder();
+ static final String asString(final Class<?>[] argTypes) {
+ final StringBuilder args = new StringBuilder();
boolean coma = false;
if(null != argTypes) {
for (int i = 0; i < argTypes.length; i++) {
@@ -213,7 +213,7 @@ public final class ReflectionUtil {
*
* @throws JogampRuntimeException if the constructor can not be delivered.
*/
- public static final Constructor<?> getConstructor(Class<?> clazz, Class<?> ... cstrArgTypes)
+ public static final Constructor<?> getConstructor(final Class<?> clazz, Class<?> ... cstrArgTypes)
throws JogampRuntimeException {
if(null == cstrArgTypes) {
cstrArgTypes = zeroTypes;
@@ -221,7 +221,7 @@ public final class ReflectionUtil {
Constructor<?> cstr = null;
try {
cstr = clazz.getDeclaredConstructor(cstrArgTypes);
- } catch (NoSuchMethodException ex) {
+ } catch (final NoSuchMethodException ex) {
// ok, cont. w/ 'isAssignableFrom()' validation
}
if(null == cstr) {
@@ -248,7 +248,7 @@ public final class ReflectionUtil {
return cstr;
}
- public static final Constructor<?> getConstructor(String clazzName, ClassLoader cl)
+ public static final Constructor<?> getConstructor(final String clazzName, final ClassLoader cl)
throws JogampRuntimeException {
return getConstructor(clazzName, null, true, cl);
}
@@ -256,12 +256,12 @@ public final class ReflectionUtil {
/**
* @throws JogampRuntimeException if the instance can not be created.
*/
- public static final Object createInstance(Constructor<?> cstr, Object ... cstrArgs)
+ public static final Object createInstance(final Constructor<?> cstr, final Object ... cstrArgs)
throws JogampRuntimeException, RuntimeException
{
try {
return cstr.newInstance(cstrArgs);
- } catch (Exception e) {
+ } catch (final Exception e) {
Throwable t = e;
if (t instanceof InvocationTargetException) {
t = ((InvocationTargetException) t).getTargetException();
@@ -279,13 +279,13 @@ public final class ReflectionUtil {
/**
* @throws JogampRuntimeException if the instance can not be created.
*/
- public static final Object createInstance(Class<?> clazz, Class<?>[] cstrArgTypes, Object ... cstrArgs)
+ public static final Object createInstance(final Class<?> clazz, final Class<?>[] cstrArgTypes, final Object ... cstrArgs)
throws JogampRuntimeException, RuntimeException
{
return createInstance(getConstructor(clazz, cstrArgTypes), cstrArgs);
}
- public static final Object createInstance(Class<?> clazz, Object ... cstrArgs)
+ public static final Object createInstance(final Class<?> clazz, final Object ... cstrArgs)
throws JogampRuntimeException, RuntimeException
{
Class<?>[] cstrArgTypes = null;
@@ -298,17 +298,17 @@ public final class ReflectionUtil {
return createInstance(clazz, cstrArgTypes, cstrArgs);
}
- public static final Object createInstance(String clazzName, Class<?>[] cstrArgTypes, Object[] cstrArgs, ClassLoader cl)
+ public static final Object createInstance(final String clazzName, final Class<?>[] cstrArgTypes, final Object[] cstrArgs, final ClassLoader cl)
throws JogampRuntimeException, RuntimeException
{
try {
return createInstance(getClassImpl(clazzName, true, cl), cstrArgTypes, cstrArgs);
- } catch (ClassNotFoundException ex) {
+ } catch (final ClassNotFoundException ex) {
throw new JogampRuntimeException(clazzName + " not available", ex);
}
}
- public static final Object createInstance(String clazzName, Object[] cstrArgs, ClassLoader cl)
+ public static final Object createInstance(final String clazzName, final Object[] cstrArgs, final ClassLoader cl)
throws JogampRuntimeException, RuntimeException
{
Class<?>[] cstrArgTypes = null;
@@ -321,16 +321,16 @@ public final class ReflectionUtil {
return createInstance(clazzName, cstrArgTypes, cstrArgs, cl);
}
- public static final Object createInstance(String clazzName, ClassLoader cl)
+ public static final Object createInstance(final String clazzName, final ClassLoader cl)
throws JogampRuntimeException, RuntimeException
{
return createInstance(clazzName, null, null, cl);
}
- public static final boolean instanceOf(Object obj, String clazzName) {
+ public static final boolean instanceOf(final Object obj, final String clazzName) {
return instanceOf(obj.getClass(), clazzName);
}
- public static final boolean instanceOf(Class<?> clazz, String clazzName) {
+ public static final boolean instanceOf(Class<?> clazz, final String clazzName) {
do {
if(clazz.getName().equals(clazzName)) {
return true;
@@ -340,14 +340,14 @@ public final class ReflectionUtil {
return false;
}
- public static final boolean implementationOf(Object obj, String faceName) {
+ public static final boolean implementationOf(final Object obj, final String faceName) {
return implementationOf(obj.getClass(), faceName);
}
- public static final boolean implementationOf(Class<?> clazz, String faceName) {
+ public static final boolean implementationOf(Class<?> clazz, final String faceName) {
do {
- Class<?>[] clazzes = clazz.getInterfaces();
+ final Class<?>[] clazzes = clazz.getInterfaces();
for(int i=clazzes.length-1; i>=0; i--) {
- Class<?> face = clazzes[i];
+ final Class<?> face = clazzes[i];
if(face.getName().equals(faceName)) {
return true;
}
@@ -357,27 +357,27 @@ public final class ReflectionUtil {
return false;
}
- public static boolean isAWTComponent(Object target) {
+ public static boolean isAWTComponent(final Object target) {
return instanceOf(target, AWTNames.ComponentClass);
}
- public static boolean isAWTComponent(Class<?> clazz) {
+ public static boolean isAWTComponent(final Class<?> clazz) {
return instanceOf(clazz, AWTNames.ComponentClass);
}
/**
* @throws JogampRuntimeException if the Method can not be found.
*/
- public static final Method getMethod(Class<?> clazz, String methodName, Class<?> ... argTypes)
+ public static final Method getMethod(final Class<?> clazz, final String methodName, final Class<?> ... argTypes)
throws JogampRuntimeException, RuntimeException
{
Throwable t = null;
Method m = null;
try {
m = clazz.getDeclaredMethod(methodName, argTypes);
- } catch (NoClassDefFoundError ex0) {
+ } catch (final NoClassDefFoundError ex0) {
t = ex0;
- } catch (NoSuchMethodException ex1) {
+ } catch (final NoSuchMethodException ex1) {
t = ex1;
}
if(null != t) {
@@ -389,12 +389,12 @@ public final class ReflectionUtil {
/**
* @throws JogampRuntimeException if the Method can not be found.
*/
- public static final Method getMethod(String clazzName, String methodName, Class<?>[] argTypes, ClassLoader cl)
+ public static final Method getMethod(final String clazzName, final String methodName, final Class<?>[] argTypes, final ClassLoader cl)
throws JogampRuntimeException, RuntimeException
{
try {
return getMethod(getClassImpl(clazzName, true, cl), methodName, argTypes);
- } catch (ClassNotFoundException ex) {
+ } catch (final ClassNotFoundException ex) {
throw new JogampRuntimeException(clazzName + " not available", ex);
}
}
@@ -407,12 +407,12 @@ public final class ReflectionUtil {
* @throws JogampRuntimeException if call fails
* @throws RuntimeException if call fails
*/
- public static final Object callMethod(Object instance, Method method, Object ... args)
+ public static final Object callMethod(final Object instance, final Method method, final Object ... args)
throws JogampRuntimeException, RuntimeException
{
try {
return method.invoke(instance, args);
- } catch (Exception e) {
+ } catch (final Exception e) {
Throwable t = e;
if (t instanceof InvocationTargetException) {
t = ((InvocationTargetException) t).getTargetException();
@@ -430,7 +430,7 @@ public final class ReflectionUtil {
/**
* @throws JogampRuntimeException if the instance can not be created.
*/
- public static final Object callStaticMethod(String clazzName, String methodName, Class<?>[] argTypes, Object[] args, ClassLoader cl)
+ public static final Object callStaticMethod(final String clazzName, final String methodName, final Class<?>[] argTypes, final Object[] args, final ClassLoader cl)
throws JogampRuntimeException, RuntimeException
{
return callMethod(null, getMethod(clazzName, methodName, argTypes, cl), args);
@@ -441,10 +441,10 @@ public final class ReflectionUtil {
Method m = null;
/** Check {@link #available()} before using instance. */
- public MethodAccessor(Class<?> clazz, String methodName, Class<?> ... argTypes) {
+ public MethodAccessor(final Class<?> clazz, final String methodName, final Class<?> ... argTypes) {
try {
m = ReflectionUtil.getMethod(clazz, methodName, argTypes);
- } catch (JogampRuntimeException jre) { /* method n/a */ }
+ } catch (final JogampRuntimeException jre) { /* method n/a */ }
}
/** Returns true if method is available, otherwise false. */
@@ -456,7 +456,7 @@ public final class ReflectionUtil {
* Check {@link #available()} before calling to avoid throwing a JogampRuntimeException.
* @throws JogampRuntimeException if method is not available
*/
- public Object callMethod(Object instance, Object ... args) {
+ public Object callMethod(final Object instance, final Object ... args) {
if(null == m) {
throw new JogampRuntimeException("Method not available. Instance: "+instance);
}
diff --git a/src/java/com/jogamp/common/util/RunnableExecutor.java b/src/java/com/jogamp/common/util/RunnableExecutor.java
index 629bc8c..9358a06 100644
--- a/src/java/com/jogamp/common/util/RunnableExecutor.java
+++ b/src/java/com/jogamp/common/util/RunnableExecutor.java
@@ -43,7 +43,7 @@ public interface RunnableExecutor {
private CurrentThreadExecutor() {}
@Override
- public void invoke(boolean wait, Runnable r) {
+ public void invoke(final boolean wait, final Runnable r) {
r.run();
}
}
diff --git a/src/java/com/jogamp/common/util/RunnableTask.java b/src/java/com/jogamp/common/util/RunnableTask.java
index 97adf04..6fb98de 100644
--- a/src/java/com/jogamp/common/util/RunnableTask.java
+++ b/src/java/com/jogamp/common/util/RunnableTask.java
@@ -42,7 +42,7 @@ public class RunnableTask extends TaskBase {
* @param waitUntilDone if <code>true</code>, waits until <code>runnable</code> execution is completed, otherwise returns immediately.
* @param runnable the {@link Runnable} to execute.
*/
- public static void invoke(boolean waitUntilDone, Runnable runnable) {
+ public static void invoke(final boolean waitUntilDone, final Runnable runnable) {
Throwable throwable = null;
final Object sync = new Object();
final RunnableTask rt = new RunnableTask( runnable, waitUntilDone ? sync : null, true, waitUntilDone ? null : System.err );
@@ -51,7 +51,7 @@ public class RunnableTask extends TaskBase {
if( waitUntilDone ) {
try {
sync.wait();
- } catch (InterruptedException ie) {
+ } catch (final InterruptedException ie) {
throwable = ie;
}
if(null==throwable) {
@@ -85,7 +85,7 @@ public class RunnableTask extends TaskBase {
if( waitUntilDone ) {
try {
sync.wait();
- } catch (InterruptedException ie) {
+ } catch (final InterruptedException ie) {
throwable = ie;
}
if(null==throwable) {
@@ -114,7 +114,7 @@ public class RunnableTask extends TaskBase {
* otherwise the exception is thrown.
* @param exceptionOut If not <code>null</code>, exceptions are written to this {@link PrintStream}.
*/
- public RunnableTask(Runnable runnable, Object syncObject, boolean catchExceptions, PrintStream exceptionOut) {
+ public RunnableTask(final Runnable runnable, final Object syncObject, final boolean catchExceptions, final PrintStream exceptionOut) {
super(syncObject, catchExceptions, exceptionOut);
this.runnable = runnable ;
}
@@ -131,7 +131,7 @@ public class RunnableTask extends TaskBase {
if(null == syncObject) {
try {
runnable.run();
- } catch (Throwable t) {
+ } catch (final Throwable t) {
runnableException = t;
if(null != exceptionOut) {
exceptionOut.println("RunnableTask.run(): "+getExceptionOutIntro()+" exception occured on thread "+Thread.currentThread().getName()+": "+toString());
@@ -148,7 +148,7 @@ public class RunnableTask extends TaskBase {
synchronized (syncObject) {
try {
runnable.run();
- } catch (Throwable t) {
+ } catch (final Throwable t) {
runnableException = t;
if(null != exceptionOut) {
exceptionOut.println("RunnableTask.run(): "+getExceptionOutIntro()+" exception occured on thread "+Thread.currentThread().getName()+": "+toString());
diff --git a/src/java/com/jogamp/common/util/SecurityUtil.java b/src/java/com/jogamp/common/util/SecurityUtil.java
index 4586d22..1b8b7c2 100644
--- a/src/java/com/jogamp/common/util/SecurityUtil.java
+++ b/src/java/com/jogamp/common/util/SecurityUtil.java
@@ -56,7 +56,7 @@ public class SecurityUtil {
try {
insecPD.implies(allPermissions);
_hasAllPermissions = true;
- } catch( SecurityException ace ) {
+ } catch( final SecurityException ace ) {
_hasAllPermissions = false;
}
hasAllPermissions = _hasAllPermissions;
@@ -92,11 +92,11 @@ public class SecurityUtil {
* or the installed {@link SecurityManager}'s <code>checkPermission(perm)</code>
* passes. Otherwise method returns <code>false</code>.
*/
- public static final boolean hasPermission(Permission perm) {
+ public static final boolean hasPermission(final Permission perm) {
try {
checkPermission(perm);
return true;
- } catch( SecurityException ace ) {
+ } catch( final SecurityException ace ) {
return false;
}
}
@@ -113,7 +113,7 @@ public class SecurityUtil {
* Throws an {@link SecurityException} if an installed {@link SecurityManager}
* does not permit the requested {@link Permission}.
*/
- public static final void checkPermission(Permission perm) throws SecurityException {
+ public static final void checkPermission(final Permission perm) throws SecurityException {
if( null != securityManager ) {
securityManager.checkPermission(perm);
}
@@ -124,11 +124,11 @@ public class SecurityUtil {
* or the installed {@link SecurityManager}'s <code>checkLink(libName)</code>
* passes. Otherwise method returns <code>false</code>.
*/
- public static final boolean hasLinkPermission(String libName) {
+ public static final boolean hasLinkPermission(final String libName) {
try {
checkLinkPermission(libName);
return true;
- } catch( SecurityException ace ) {
+ } catch( final SecurityException ace ) {
return false;
}
}
@@ -137,7 +137,7 @@ public class SecurityUtil {
* Throws an {@link SecurityException} if an installed {@link SecurityManager}
* does not permit to dynamically link the given libName.
*/
- public static final void checkLinkPermission(String libName) throws SecurityException {
+ public static final void checkLinkPermission(final String libName) throws SecurityException {
if( null != securityManager ) {
securityManager.checkLink(libName);
}
@@ -166,7 +166,7 @@ public class SecurityUtil {
return (null != certs && certs.length>0) ? certs : null;
}
- public static final boolean equals(Certificate[] a, Certificate[] b) {
+ public static final boolean equals(final Certificate[] a, final Certificate[] b) {
if(a == b) {
return true;
}
diff --git a/src/java/com/jogamp/common/util/SyncedRingbuffer.java b/src/java/com/jogamp/common/util/SyncedRingbuffer.java
index 8ef2970..7f4a878 100644
--- a/src/java/com/jogamp/common/util/SyncedRingbuffer.java
+++ b/src/java/com/jogamp/common/util/SyncedRingbuffer.java
@@ -63,7 +63,7 @@ public class SyncedRingbuffer<T> implements Ringbuffer<T> {
}
@Override
- public final void dump(PrintStream stream, String prefix) {
+ public final void dump(final PrintStream stream, final String prefix) {
stream.println(prefix+" "+toString()+" {");
for(int i=0; i<capacity; i++) {
stream.println("\t["+i+"]: "+array[i]);
@@ -92,7 +92,7 @@ public class SyncedRingbuffer<T> implements Ringbuffer<T> {
* @throws IllegalArgumentException if <code>copyFrom</code> is <code>null</code>
*/
@SuppressWarnings("unchecked")
- public SyncedRingbuffer(T[] copyFrom) throws IllegalArgumentException {
+ public SyncedRingbuffer(final T[] copyFrom) throws IllegalArgumentException {
capacity = copyFrom.length;
array = (T[]) newArray(copyFrom.getClass(), capacity);
resetImpl(true, copyFrom);
@@ -115,9 +115,9 @@ public class SyncedRingbuffer<T> implements Ringbuffer<T> {
* @param arrayType the array type of the created empty internal array.
* @param capacity the initial net capacity of the ring buffer
*/
- public SyncedRingbuffer(Class<? extends T[]> arrayType, int capacity) {
+ public SyncedRingbuffer(final Class<? extends T[]> arrayType, final int capacity) {
this.capacity = capacity;
- this.array = (T[]) newArray(arrayType, capacity);
+ this.array = newArray(arrayType, capacity);
resetImpl(false, null /* empty, nothing to copy */ );
}
@@ -144,11 +144,11 @@ public class SyncedRingbuffer<T> implements Ringbuffer<T> {
}
@Override
- public final void resetFull(T[] copyFrom) throws IllegalArgumentException {
+ public final void resetFull(final T[] copyFrom) throws IllegalArgumentException {
resetImpl(true, copyFrom);
}
- private final void resetImpl(boolean full, T[] copyFrom) throws IllegalArgumentException {
+ private final void resetImpl(final boolean full, final T[] copyFrom) throws IllegalArgumentException {
synchronized ( syncGlobal ) {
if( null != copyFrom ) {
if( copyFrom.length != capacity() ) {
@@ -202,7 +202,7 @@ public class SyncedRingbuffer<T> implements Ringbuffer<T> {
public final T get() {
try {
return getImpl(false, false);
- } catch (InterruptedException ie) { throw new RuntimeException(ie); }
+ } catch (final InterruptedException ie) { throw new RuntimeException(ie); }
}
/**
@@ -220,14 +220,14 @@ public class SyncedRingbuffer<T> implements Ringbuffer<T> {
public final T peek() {
try {
return getImpl(false, true);
- } catch (InterruptedException ie) { throw new RuntimeException(ie); }
+ } catch (final InterruptedException ie) { throw new RuntimeException(ie); }
}
@Override
public final T peekBlocking() throws InterruptedException {
return getImpl(true, true);
}
- private final T getImpl(boolean blocking, boolean peek) throws InterruptedException {
+ private final T getImpl(final boolean blocking, final boolean peek) throws InterruptedException {
synchronized( syncGlobal ) {
if( 0 == size ) {
if( blocking ) {
@@ -257,10 +257,10 @@ public class SyncedRingbuffer<T> implements Ringbuffer<T> {
* </p>
*/
@Override
- public final boolean put(T e) {
+ public final boolean put(final T e) {
try {
return putImpl(e, false, false);
- } catch (InterruptedException ie) { throw new RuntimeException(ie); }
+ } catch (final InterruptedException ie) { throw new RuntimeException(ie); }
}
/**
@@ -270,7 +270,7 @@ public class SyncedRingbuffer<T> implements Ringbuffer<T> {
* </p>
*/
@Override
- public final void putBlocking(T e) throws InterruptedException {
+ public final void putBlocking(final T e) throws InterruptedException {
if( !putImpl(e, false, true) ) {
throw new InternalError("Blocking put failed: "+this);
}
@@ -283,11 +283,11 @@ public class SyncedRingbuffer<T> implements Ringbuffer<T> {
* </p>
*/
@Override
- public final boolean putSame(boolean blocking) throws InterruptedException {
+ public final boolean putSame(final boolean blocking) throws InterruptedException {
return putImpl(null, true, blocking);
}
- private final boolean putImpl(T e, boolean sameRef, boolean blocking) throws InterruptedException {
+ private final boolean putImpl(final T e, final boolean sameRef, final boolean blocking) throws InterruptedException {
synchronized( syncGlobal ) {
if( capacity == size ) {
if( blocking ) {
@@ -310,7 +310,7 @@ public class SyncedRingbuffer<T> implements Ringbuffer<T> {
}
@Override
- public final void waitForFreeSlots(int count) throws InterruptedException {
+ public final void waitForFreeSlots(final int count) throws InterruptedException {
synchronized ( syncGlobal ) {
if( capacity - size < count ) {
while( capacity - size < count ) {
@@ -344,7 +344,7 @@ public class SyncedRingbuffer<T> implements Ringbuffer<T> {
final int growAmount = newElements.length;
final int newCapacity = capacity + growAmount;
final T[] oldArray = array;
- final T[] newArray = (T[]) newArray(arrayTypeInternal, newCapacity);
+ final T[] newArray = newArray(arrayTypeInternal, newCapacity);
// writePos == readPos
writePos += growAmount; // warp writePos to the end of the new data location
@@ -383,7 +383,7 @@ public class SyncedRingbuffer<T> implements Ringbuffer<T> {
final int newCapacity = capacity + growAmount;
final T[] oldArray = array;
- final T[] newArray = (T[]) newArray(arrayTypeInternal, newCapacity);
+ final T[] newArray = newArray(arrayTypeInternal, newCapacity);
// writePos == readPos
readPos += growAmount; // warp readPos to the end of the new data location
@@ -402,7 +402,7 @@ public class SyncedRingbuffer<T> implements Ringbuffer<T> {
}
@SuppressWarnings("unchecked")
- private static <T> T[] newArray(Class<? extends T[]> arrayType, int length) {
+ private static <T> T[] newArray(final Class<? extends T[]> arrayType, final int length) {
return ((Object)arrayType == (Object)Object[].class)
? (T[]) new Object[length]
: (T[]) Array.newInstance(arrayType.getComponentType(), length);
diff --git a/src/java/com/jogamp/common/util/TaskBase.java b/src/java/com/jogamp/common/util/TaskBase.java
index db437f8..b688ba6 100644
--- a/src/java/com/jogamp/common/util/TaskBase.java
+++ b/src/java/com/jogamp/common/util/TaskBase.java
@@ -42,7 +42,7 @@ public abstract class TaskBase implements Runnable {
static {
Debug.initSingleton();
- TRACE_SOURCE = Debug.isPropertyDefined("jogamp.debug.TaskBase.TraceSource", true);
+ TRACE_SOURCE = PropertyAccess.isPropertyDefined("jogamp.debug.TaskBase.TraceSource", true);
}
protected final Object syncObject;
@@ -56,7 +56,7 @@ public abstract class TaskBase implements Runnable {
protected volatile long tExecuted;
protected volatile boolean isFlushed;
- protected TaskBase(Object syncObject, boolean catchExceptions, PrintStream exceptionOut) {
+ protected TaskBase(final Object syncObject, final boolean catchExceptions, final PrintStream exceptionOut) {
this.syncObject = syncObject;
this.catchExceptions = catchExceptions;
this.exceptionOut = exceptionOut;
@@ -88,7 +88,7 @@ public abstract class TaskBase implements Runnable {
* Attach a custom object to this task.
* Useful to piggybag further information, ie tag a task final.
*/
- public final void setAttachment(Object o) {
+ public final void setAttachment(final Object o) {
attachment = o;
}
@@ -113,7 +113,7 @@ public abstract class TaskBase implements Runnable {
* @see #isFlushed()
* @see #isInQueue()
*/
- public final void flush(Throwable t) {
+ public final void flush(final Throwable t) {
if(!isExecuted() && hasWaiter()) {
runnableException = t;
synchronized (syncObject) {
diff --git a/src/java/com/jogamp/common/util/ValueConv.java b/src/java/com/jogamp/common/util/ValueConv.java
index 9a16b64..2ad002a 100644
--- a/src/java/com/jogamp/common/util/ValueConv.java
+++ b/src/java/com/jogamp/common/util/ValueConv.java
@@ -37,7 +37,7 @@ package com.jogamp.common.util;
* </p>
*/
public class ValueConv {
- public static final byte float_to_byte(float v, boolean dSigned) {
+ public static final byte float_to_byte(final float v, final boolean dSigned) {
// lossy
if( dSigned ) {
return (byte) ( v * ( v > 0 ? 127.0f : 128.0f ) );
@@ -45,14 +45,14 @@ public class ValueConv {
return (byte) ( v * 255.0f );
}
}
- public static final short float_to_short(float v, boolean dSigned) {
+ public static final short float_to_short(final float v, final boolean dSigned) {
if( dSigned ) {
return (short) ( v * ( v > 0 ? 32767.0f : 32768.0f ) );
} else {
return (short) ( v * 65535.0f );
}
}
- public static final int float_to_int(float v, boolean dSigned) {
+ public static final int float_to_int(final float v, final boolean dSigned) {
// float significand 0x007fffff
// double significand 0x000fffffffffffffL
// int min = 0x80000000 = -2147483648
@@ -64,7 +64,7 @@ public class ValueConv {
}
}
- public static final byte double_to_byte(double v, boolean dSigned) {
+ public static final byte double_to_byte(final double v, final boolean dSigned) {
// lossy
if( dSigned ) {
return (byte) ( v * ( v > 0 ? 127.0 : 128.0 ) );
@@ -72,7 +72,7 @@ public class ValueConv {
return (byte) ( v * 255.0 );
}
}
- public static final short double_to_short(double v, boolean dSigned) {
+ public static final short double_to_short(final double v, final boolean dSigned) {
// lossy
if( dSigned ) {
return (short) ( v * ( v > 0 ? 32767.0 : 32768.0 ) );
@@ -80,7 +80,7 @@ public class ValueConv {
return (short) ( v * 65535.0 );
}
}
- public static final int double_to_int(double v, boolean dSigned) {
+ public static final int double_to_int(final double v, final boolean dSigned) {
// lossy
if( dSigned ) {
return (int) ( v * ( v > 0 ? 2147483647.0 : 2147483648.0 ) );
@@ -89,28 +89,28 @@ public class ValueConv {
}
}
- public static final float byte_to_float(byte v, boolean sSigned) {
+ public static final float byte_to_float(final byte v, final boolean sSigned) {
if( sSigned ) {
return (v & 0xff) / ( v > 0 ? 127.0f : -128.0f ) ;
} else {
return (v & 0xff) / 255.0f ;
}
}
- public static final double byte_to_double(byte v, boolean sSigned) {
+ public static final double byte_to_double(final byte v, final boolean sSigned) {
if( sSigned ) {
return (v & 0xff) / ( v > 0 ? 127.0 : -128.0 ) ;
} else {
return (v & 0xff) / 255.0 ;
}
}
- public static final float short_to_float(short v, boolean sSigned) {
+ public static final float short_to_float(final short v, final boolean sSigned) {
if( sSigned ) {
return (v & 0xffff) / ( v > 0 ? 32767.0f : -32768.0f ) ;
} else {
return (v & 0xffff) / 65535.0f ;
}
}
- public static final double short_to_double(short v, boolean sSigned) {
+ public static final double short_to_double(final short v, final boolean sSigned) {
// lossy
if( sSigned ) {
return (v & 0xffff) / ( v > 0 ? 32767.0 : -32768.0 ) ;
@@ -118,7 +118,7 @@ public class ValueConv {
return (v & 0xffff) / 65535.0 ;
}
}
- public static final float int_to_float(int v, boolean sSigned) {
+ public static final float int_to_float(final int v, final boolean sSigned) {
// lossy
// float significand 0x007fffff
// double significand 0x000fffffffffffffL
@@ -127,35 +127,35 @@ public class ValueConv {
if( sSigned ) {
return (float) ( v / ( v > 0 ? 2147483647.0 : 2147483648.0 ) );
} else {
- return (float) ( ((long)v & 0xffffffffL) / 4294967295.0 );
+ return (float) ( (v & 0xffffffffL) / 4294967295.0 );
}
}
- public static final double int_to_double(int v, boolean sSigned) {
+ public static final double int_to_double(final int v, final boolean sSigned) {
if( sSigned ) {
return v / ( v > 0 ? 2147483647.0 : 2147483648.0 ) ;
} else {
- return ((long)v & 0xffffffffL) / 4294967295.0 ;
+ return (v & 0xffffffffL) / 4294967295.0 ;
}
}
- public static final short byte_to_short(byte v, boolean sSigned, boolean dSigned) {
+ public static final short byte_to_short(final byte v, final boolean sSigned, final boolean dSigned) {
return float_to_short(byte_to_float(v, sSigned), dSigned);
}
- public static final int byte_to_int(byte v, boolean sSigned, boolean dSigned) {
+ public static final int byte_to_int(final byte v, final boolean sSigned, final boolean dSigned) {
return float_to_int(byte_to_float(v, sSigned), dSigned);
}
- public static final byte short_to_byte(short v, boolean sSigned, boolean dSigned) {
+ public static final byte short_to_byte(final short v, final boolean sSigned, final boolean dSigned) {
return float_to_byte(short_to_float(v, sSigned), dSigned);
}
- public static final int short_to_int(short v, boolean sSigned, boolean dSigned) {
+ public static final int short_to_int(final short v, final boolean sSigned, final boolean dSigned) {
return float_to_int(short_to_float(v, sSigned), dSigned);
}
- public static final byte int_to_byte(int v, boolean sSigned, boolean dSigned) {
+ public static final byte int_to_byte(final int v, final boolean sSigned, final boolean dSigned) {
return float_to_byte(int_to_float(v, sSigned), dSigned);
}
- public static final short int_to_short(int v, boolean sSigned, boolean dSigned) {
+ public static final short int_to_short(final int v, final boolean sSigned, final boolean dSigned) {
return float_to_short(int_to_float(v, sSigned), dSigned);
}
}
diff --git a/src/java/com/jogamp/common/util/VersionNumber.java b/src/java/com/jogamp/common/util/VersionNumber.java
index addc879..b212fd0 100644
--- a/src/java/com/jogamp/common/util/VersionNumber.java
+++ b/src/java/com/jogamp/common/util/VersionNumber.java
@@ -72,7 +72,7 @@ public class VersionNumber implements Comparable<Object> {
* </p>
* @param delim the delimiter, e.g. "."
*/
- public static java.util.regex.Pattern getVersionNumberPattern(String delim) {
+ public static java.util.regex.Pattern getVersionNumberPattern(final String delim) {
return java.util.regex.Pattern.compile("\\D*(\\d+)[^\\"+delim+"\\s]*(?:\\"+delim+"\\D*(\\d+)[^\\"+delim+"\\s]*(?:\\"+delim+"\\D*(\\d+))?)?");
}
@@ -102,7 +102,7 @@ public class VersionNumber implements Comparable<Object> {
protected final static short HAS_MINOR = 1 << 1 ;
protected final static short HAS_SUB = 1 << 2 ;
- protected VersionNumber(int majorRev, int minorRev, int subMinorRev, int _strEnd, short _state) {
+ protected VersionNumber(final int majorRev, final int minorRev, final int subMinorRev, final int _strEnd, final short _state) {
major = majorRev;
minor = minorRev;
sub = subMinorRev;
@@ -116,7 +116,7 @@ public class VersionNumber implements Comparable<Object> {
* @see #hasMinor()
* @see #hasSub()
*/
- public VersionNumber(int majorRev, int minorRev, int subMinorRev) {
+ public VersionNumber(final int majorRev, final int minorRev, final int subMinorRev) {
this(majorRev, minorRev, subMinorRev, -1, (short)(HAS_MAJOR | HAS_MINOR | HAS_SUB));
}
@@ -197,7 +197,7 @@ public class VersionNumber implements Comparable<Object> {
}
}
}
- } catch (Exception e) { }
+ } catch (final Exception e) { }
major = val[0];
minor = val[1];
@@ -233,7 +233,7 @@ public class VersionNumber implements Comparable<Object> {
}
@Override
- public final boolean equals(Object o) {
+ public final boolean equals(final Object o) {
if ( o instanceof VersionNumber ) {
return 0 == compareTo( (VersionNumber) o );
}
@@ -241,15 +241,15 @@ public class VersionNumber implements Comparable<Object> {
}
@Override
- public final int compareTo(Object o) {
+ public final int compareTo(final Object o) {
if ( ! ( o instanceof VersionNumber ) ) {
- Class<?> c = (null != o) ? o.getClass() : null ;
+ final Class<?> c = (null != o) ? o.getClass() : null ;
throw new ClassCastException("Not a VersionNumber object: " + c);
}
return compareTo( (VersionNumber) o );
}
- public final int compareTo(VersionNumber vo) {
+ public final int compareTo(final VersionNumber vo) {
if (major > vo.major) {
return 1;
} else if (major < vo.major) {
diff --git a/src/java/com/jogamp/common/util/VersionNumberString.java b/src/java/com/jogamp/common/util/VersionNumberString.java
index e23300c..6644f65 100644
--- a/src/java/com/jogamp/common/util/VersionNumberString.java
+++ b/src/java/com/jogamp/common/util/VersionNumberString.java
@@ -44,7 +44,7 @@ public class VersionNumberString extends VersionNumber {
protected final String strVal;
- protected VersionNumberString(int majorRev, int minorRev, int subMinorRev, int strEnd, short _state, String versionString) {
+ protected VersionNumberString(final int majorRev, final int minorRev, final int subMinorRev, final int strEnd, final short _state, final String versionString) {
super(majorRev, minorRev, subMinorRev, strEnd, _state);
strVal = versionString;
}
@@ -52,7 +52,7 @@ public class VersionNumberString extends VersionNumber {
/**
* See {@link VersionNumber#VersionNumber(int, int, int)}.
*/
- public VersionNumberString(int majorRev, int minorRev, int subMinorRev, String versionString) {
+ public VersionNumberString(final int majorRev, final int minorRev, final int subMinorRev, final String versionString) {
this(majorRev, minorRev, subMinorRev, -1, (short)(HAS_MAJOR | HAS_MINOR | HAS_SUB), versionString);
}
diff --git a/src/java/com/jogamp/common/util/VersionUtil.java b/src/java/com/jogamp/common/util/VersionUtil.java
index c4451ac..6949d62 100644
--- a/src/java/com/jogamp/common/util/VersionUtil.java
+++ b/src/java/com/jogamp/common/util/VersionUtil.java
@@ -40,6 +40,8 @@ import java.util.Set;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
+import jogamp.common.os.PlatformPropsImpl;
+
public class VersionUtil {
public static final String SEPERATOR = "-----------------------------------------------------------------------------------------------------";
@@ -68,7 +70,7 @@ public class VersionUtil {
Platform.getMachineDescription().toString(sb).append(Platform.getNewline());
// JVM/JRE
- sb.append("Platform: Java Version: ").append(Platform.getJavaVersion()).append(" (").append(Platform.getJavaVersionNumber()).append("u").append(Platform.JAVA_VERSION_UPDATE).append("), VM: ").append(Platform.getJavaVMName());
+ sb.append("Platform: Java Version: ").append(Platform.getJavaVersion()).append(" (").append(Platform.getJavaVersionNumber()).append("u").append(PlatformPropsImpl.JAVA_VERSION_UPDATE).append("), VM: ").append(Platform.getJavaVMName());
sb.append(", Runtime: ").append(Platform.getJavaRuntimeName()).append(Platform.getNewline());
sb.append("Platform: Java Vendor: ").append(Platform.getJavaVendor()).append(", ").append(Platform.getJavaVendorURL());
sb.append(", JavaSE: ").append(Platform.isJavaSE());
@@ -94,7 +96,7 @@ public class VersionUtil {
* @param extension The value of the 'Extension-Name' jar-manifest attribute; used to identify the manifest.
* @return the requested manifest or null when not found.
*/
- public static Manifest getManifest(ClassLoader cl, String extension) {
+ public static Manifest getManifest(final ClassLoader cl, final String extension) {
return getManifest(cl, new String[] { extension } );
}
@@ -106,10 +108,10 @@ public class VersionUtil {
* Matching is applied in decreasing order, i.e. first element is favored over the second, etc.
* @return the requested manifest or null when not found.
*/
- public static Manifest getManifest(ClassLoader cl, String[] extensions) {
+ public static Manifest getManifest(final ClassLoader cl, final String[] extensions) {
final Manifest[] extManifests = new Manifest[extensions.length];
try {
- Enumeration<URL> resources = cl.getResources("META-INF/MANIFEST.MF");
+ final Enumeration<URL> resources = cl.getResources("META-INF/MANIFEST.MF");
while (resources.hasMoreElements()) {
final InputStream is = resources.nextElement().openStream();
final Manifest manifest;
@@ -118,7 +120,7 @@ public class VersionUtil {
} finally {
IOUtil.close(is, false);
}
- Attributes attributes = manifest.getMainAttributes();
+ final Attributes attributes = manifest.getMainAttributes();
if(attributes != null) {
for(int i=0; i < extensions.length && null == extManifests[i]; i++) {
final String extension = extensions[i];
@@ -131,7 +133,7 @@ public class VersionUtil {
}
}
}
- } catch (IOException ex) {
+ } catch (final IOException ex) {
throw new RuntimeException("Unable to read manifest.", ex);
}
for(int i=1; i<extManifests.length; i++) {
@@ -142,7 +144,7 @@ public class VersionUtil {
return null;
}
- public static StringBuilder getFullManifestInfo(Manifest mf, StringBuilder sb) {
+ public static StringBuilder getFullManifestInfo(final Manifest mf, StringBuilder sb) {
if(null==mf) {
return sb;
}
@@ -151,11 +153,11 @@ public class VersionUtil {
sb = new StringBuilder();
}
- Attributes attr = mf.getMainAttributes();
- Set<Object> keys = attr.keySet();
- for(Iterator<Object> iter=keys.iterator(); iter.hasNext(); ) {
- Attributes.Name key = (Attributes.Name) iter.next();
- String val = attr.getValue(key);
+ final Attributes attr = mf.getMainAttributes();
+ final Set<Object> keys = attr.keySet();
+ for(final Iterator<Object> iter=keys.iterator(); iter.hasNext(); ) {
+ final Attributes.Name key = (Attributes.Name) iter.next();
+ final String val = attr.getValue(key);
sb.append(" ");
sb.append(key);
sb.append(" = ");
diff --git a/src/java/com/jogamp/common/util/awt/AWTEDTExecutor.java b/src/java/com/jogamp/common/util/awt/AWTEDTExecutor.java
index e98478e..ec9348d 100644
--- a/src/java/com/jogamp/common/util/awt/AWTEDTExecutor.java
+++ b/src/java/com/jogamp/common/util/awt/AWTEDTExecutor.java
@@ -44,7 +44,7 @@ public class AWTEDTExecutor implements RunnableExecutor {
private AWTEDTExecutor() {}
@Override
- public void invoke(boolean wait, Runnable r) {
+ public void invoke(final boolean wait, final Runnable r) {
if(EventQueue.isDispatchThread()) {
r.run();
} else {
@@ -54,9 +54,9 @@ public class AWTEDTExecutor implements RunnableExecutor {
} else {
EventQueue.invokeLater(r);
}
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
throw new RuntimeException(e.getTargetException());
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
throw new RuntimeException(e);
}
}
@@ -83,7 +83,7 @@ public class AWTEDTExecutor implements RunnableExecutor {
* @param r the {@link Runnable} to be executed.
* @return <code>true</code> if the {@link Runnable} has been issued for execution, otherwise <code>false</code>
*/
- public boolean invoke(Object treeLock, boolean allowOnNonEDT, boolean wait, Runnable r) {
+ public boolean invoke(final Object treeLock, final boolean allowOnNonEDT, final boolean wait, final Runnable r) {
if( EventQueue.isDispatchThread() ) {
r.run();
return true;
@@ -94,9 +94,9 @@ public class AWTEDTExecutor implements RunnableExecutor {
} else {
EventQueue.invokeLater(r);
}
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
throw new RuntimeException(e.getTargetException());
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
throw new RuntimeException(e);
}
return true;
diff --git a/src/java/com/jogamp/common/util/cache/TempFileCache.java b/src/java/com/jogamp/common/util/cache/TempFileCache.java
index e1b1aab..b58ea28 100644
--- a/src/java/com/jogamp/common/util/cache/TempFileCache.java
+++ b/src/java/com/jogamp/common/util/cache/TempFileCache.java
@@ -79,7 +79,7 @@ public class TempFileCache {
try {
_tmpBaseDir = new File(IOUtil.getTempDir(true /* executable */), tmpDirPrefix);
_tmpBaseDir = IOUtil.testDir(_tmpBaseDir, true /* create */, false /* executable */); // executable already checked
- } catch (Exception ex) {
+ } catch (final Exception ex) {
System.err.println("Warning: Caught Exception while retrieving executable temp base directory:");
ex.printStackTrace();
staticInitError = true;
@@ -94,7 +94,7 @@ public class TempFileCache {
if(!staticInitError) {
try {
initTmpRoot();
- } catch (Exception ex) {
+ } catch (final Exception ex) {
System.err.println("Warning: Caught Exception due to initializing TmpRoot:");
ex.printStackTrace();
staticInitError = true;
@@ -200,7 +200,7 @@ public class TempFileCache {
if (tmpRootPropValue == null) {
// Create ${tmpbase}/jlnNNNN.tmp then lock the file
- File tmpFile = File.createTempFile("jln", ".tmp", tmpBaseDir);
+ final File tmpFile = File.createTempFile("jln", ".tmp", tmpBaseDir);
if (DEBUG) {
System.err.println("TempFileCache: tmpFile = " + tmpFile.getAbsolutePath());
}
@@ -209,12 +209,12 @@ public class TempFileCache {
final FileLock tmpLock = tmpChannel.lock();
// Strip off the ".tmp" to get the name of the tmprootdir
- String tmpFileName = tmpFile.getAbsolutePath();
- String tmpRootName = tmpFileName.substring(0, tmpFileName.lastIndexOf(".tmp"));
+ final String tmpFileName = tmpFile.getAbsolutePath();
+ final String tmpRootName = tmpFileName.substring(0, tmpFileName.lastIndexOf(".tmp"));
// create ${tmpbase}/jlnNNNN.lck then lock the file
- String lckFileName = tmpRootName + ".lck";
- File lckFile = new File(lckFileName);
+ final String lckFileName = tmpRootName + ".lck";
+ final File lckFile = new File(lckFileName);
if (DEBUG) {
System.err.println("TempFileCache: lckFile = " + lckFile.getAbsolutePath());
}
@@ -248,7 +248,7 @@ public class TempFileCache {
tmpLock.release();
lckOut.close();
lckLock.release();
- } catch (IOException ex) {
+ } catch (final IOException ex) {
// Do nothing
}
}
@@ -262,7 +262,7 @@ public class TempFileCache {
}
// Start a new Reaper thread to do stuff...
- Thread reaperThread = new Thread() {
+ final Thread reaperThread = new Thread() {
/* @Override */
@Override
public void run() {
@@ -286,10 +286,10 @@ public class TempFileCache {
// enumerate list of jnl*.lck files, ignore our own jlnNNNN file
final String ourLockFile = tmpRootPropValue + ".lck";
- FilenameFilter lckFilter = new FilenameFilter() {
+ final FilenameFilter lckFilter = new FilenameFilter() {
/* @Override */
@Override
- public boolean accept(File dir, String name) {
+ public boolean accept(final File dir, final String name) {
return name.endsWith(".lck") && !name.equals(ourLockFile);
}
};
@@ -299,16 +299,16 @@ public class TempFileCache {
// (which should always succeed unless there is a problem). If we can
// get the lock on both files, then it must be an old installation, and
// we will delete it.
- String[] fileNames = tmpBaseDir.list(lckFilter);
+ final String[] fileNames = tmpBaseDir.list(lckFilter);
if (fileNames != null) {
for (int i = 0; i < fileNames.length; i++) {
- String lckFileName = fileNames[i];
- String tmpDirName = lckFileName.substring(0, lckFileName.lastIndexOf(".lck"));
- String tmpFileName = tmpDirName + ".tmp";
+ final String lckFileName = fileNames[i];
+ final String tmpDirName = lckFileName.substring(0, lckFileName.lastIndexOf(".lck"));
+ final String tmpFileName = tmpDirName + ".tmp";
- File lckFile = new File(tmpBaseDir, lckFileName);
- File tmpFile = new File(tmpBaseDir, tmpFileName);
- File tmpDir = new File(tmpBaseDir, tmpDirName);
+ final File lckFile = new File(tmpBaseDir, lckFileName);
+ final File tmpFile = new File(tmpBaseDir, tmpFileName);
+ final File tmpDir = new File(tmpBaseDir, tmpDirName);
if (lckFile.exists() && tmpFile.exists() && tmpDir.isDirectory()) {
FileOutputStream tmpOut = null;
@@ -319,7 +319,7 @@ public class TempFileCache {
tmpOut = new FileOutputStream(tmpFile);
tmpChannel = tmpOut.getChannel();
tmpLock = tmpChannel.tryLock();
- } catch (Exception ex) {
+ } catch (final Exception ex) {
// Ignore exceptions
if (DEBUG) {
ex.printStackTrace();
@@ -335,7 +335,7 @@ public class TempFileCache {
lckOut = new FileOutputStream(lckFile);
lckChannel = lckOut.getChannel();
lckLock = lckChannel.tryLock();
- } catch (Exception ex) {
+ } catch (final Exception ex) {
if (DEBUG) {
ex.printStackTrace();
}
@@ -355,12 +355,12 @@ public class TempFileCache {
// occasional 0-byte .lck or .tmp file left around
try {
lckOut.close();
- } catch (IOException ex) {
+ } catch (final IOException ex) {
}
lckFile.delete();
try {
tmpOut.close();
- } catch (IOException ex) {
+ } catch (final IOException ex) {
}
tmpFile.delete();
} else {
@@ -373,7 +373,7 @@ public class TempFileCache {
// on the *.tmp file
tmpOut.close();
tmpLock.release();
- } catch (IOException ex) {
+ } catch (final IOException ex) {
if (DEBUG) {
ex.printStackTrace();
}
@@ -393,14 +393,14 @@ public class TempFileCache {
* Remove the specified file or directory. If "path" is a directory, then
* recursively remove all entries, then remove the directory itself.
*/
- private static void removeAll(File path) {
+ private static void removeAll(final File path) {
if (DEBUG) {
System.err.println("TempFileCache: removeAll(" + path + ")");
}
if (path.isDirectory()) {
// Recursively remove all files/directories in this directory
- File[] list = path.listFiles();
+ final File[] list = path.listFiles();
if (list != null) {
for (int i = 0; i < list.length; i++) {
removeAll(list[i]);
@@ -419,7 +419,7 @@ public class TempFileCache {
if(!staticInitError) {
try {
createTmpDir();
- } catch (Exception ex) {
+ } catch (final Exception ex) {
ex.printStackTrace();
initError = true;
}
@@ -439,7 +439,7 @@ public class TempFileCache {
if(!staticInitError) {
try {
removeAll(individualTmpDir);
- } catch (Exception ex) {
+ } catch (final Exception ex) {
ex.printStackTrace();
}
}
@@ -525,9 +525,9 @@ public class TempFileCache {
* We avoid deleteOnExit, because it doesn't work reliably.
*/
private void createTmpDir() throws IOException {
- File tmpFile = File.createTempFile("jln", ".tmp", tmpRootDir);
- String tmpFileName = tmpFile.getAbsolutePath();
- String tmpDirName = tmpFileName.substring(0, tmpFileName.lastIndexOf(".tmp"));
+ final File tmpFile = File.createTempFile("jln", ".tmp", tmpRootDir);
+ final String tmpFileName = tmpFile.getAbsolutePath();
+ final String tmpDirName = tmpFileName.substring(0, tmpFileName.lastIndexOf(".tmp"));
individualTmpDir = new File(tmpDirName);
if (!individualTmpDir.mkdir()) {
throw new IOException("Cannot create " + individualTmpDir);
diff --git a/src/java/com/jogamp/common/util/cache/TempJarCache.java b/src/java/com/jogamp/common/util/cache/TempJarCache.java
index 99bb272..1b322d7 100644
--- a/src/java/com/jogamp/common/util/cache/TempJarCache.java
+++ b/src/java/com/jogamp/common/util/cache/TempJarCache.java
@@ -56,11 +56,11 @@ public class TempJarCache {
public enum LoadState {
LOOKED_UP, LOADED;
- public boolean compliesWith(LoadState o2) {
+ public boolean compliesWith(final LoadState o2) {
return null != o2 ? compareTo(o2) >= 0 : false;
}
}
- private static boolean testLoadState(LoadState has, LoadState exp) {
+ private static boolean testLoadState(final LoadState has, final LoadState exp) {
if(null == has) {
return null == exp;
}
@@ -182,7 +182,7 @@ public class TempJarCache {
return tmpFileCache;
}
- public synchronized static boolean checkNativeLibs(URI jarURI, LoadState exp) throws IOException {
+ public synchronized static boolean checkNativeLibs(final URI jarURI, final LoadState exp) throws IOException {
checkInitialized();
if(null == jarURI) {
throw new IllegalArgumentException("jarURI is null");
@@ -190,7 +190,7 @@ public class TempJarCache {
return testLoadState(nativeLibJars.get(jarURI), exp);
}
- public synchronized static boolean checkClasses(URI jarURI, LoadState exp) throws IOException {
+ public synchronized static boolean checkClasses(final URI jarURI, final LoadState exp) throws IOException {
checkInitialized();
if(null == jarURI) {
throw new IllegalArgumentException("jarURI is null");
@@ -198,7 +198,7 @@ public class TempJarCache {
return testLoadState(classFileJars.get(jarURI), exp);
}
- public synchronized static boolean checkResources(URI jarURI, LoadState exp) throws IOException {
+ public synchronized static boolean checkResources(final URI jarURI, final LoadState exp) throws IOException {
checkInitialized();
if(null == jarURI) {
throw new IllegalArgumentException("jarURI is null");
@@ -218,7 +218,7 @@ public class TempJarCache {
* @throws URISyntaxException
* @throws IllegalArgumentException
*/
- public synchronized static final boolean addNativeLibs(Class<?> certClass, URI jarURI, String nativeLibraryPath) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException {
+ public synchronized static final boolean addNativeLibs(final Class<?> certClass, final URI jarURI, final String nativeLibraryPath) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException {
checkInitialized();
final LoadState nativeLibJarsLS = nativeLibJars.get(jarURI);
if( !testLoadState(nativeLibJarsLS, LoadState.LOOKED_UP) ) {
@@ -253,7 +253,7 @@ public class TempJarCache {
* @throws URISyntaxException
* @throws IllegalArgumentException
*/
- public synchronized static final void addClasses(Class<?> certClass, URI jarURI) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException {
+ public synchronized static final void addClasses(final Class<?> certClass, final URI jarURI) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException {
checkInitialized();
final LoadState classFileJarsLS = classFileJars.get(jarURI);
if( !testLoadState(classFileJarsLS, LoadState.LOOKED_UP) ) {
@@ -282,7 +282,7 @@ public class TempJarCache {
* @throws URISyntaxException
* @throws IllegalArgumentException
*/
- public synchronized static final void addResources(Class<?> certClass, URI jarURI) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException {
+ public synchronized static final void addResources(final Class<?> certClass, final URI jarURI) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException {
checkInitialized();
final LoadState resourceFileJarsLS = resourceFileJars.get(jarURI);
if( !testLoadState(resourceFileJarsLS, LoadState.LOOKED_UP) ) {
@@ -314,7 +314,7 @@ public class TempJarCache {
* @throws URISyntaxException
* @throws IllegalArgumentException
*/
- public synchronized static final void addAll(Class<?> certClass, URI jarURI) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException {
+ public synchronized static final void addAll(final Class<?> certClass, final URI jarURI) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException {
checkInitialized();
if(null == jarURI) {
throw new IllegalArgumentException("jarURI is null");
@@ -366,7 +366,7 @@ public class TempJarCache {
}
}
- public synchronized static final String findLibrary(String libName) {
+ public synchronized static final String findLibrary(final String libName) {
checkInitialized();
// try with mapped library basename first
String path = nativeLibMap.get(libName);
@@ -398,7 +398,7 @@ public class TempJarCache {
} */
/** Similar to {@link ClassLoader#getResource(String)}. */
- public synchronized static final String findResource(String name) {
+ public synchronized static final String findResource(final String name) {
checkInitialized();
final File f = new File(tmpFileCache.getTempDir(), name);
if(f.exists()) {
@@ -408,7 +408,7 @@ public class TempJarCache {
}
/** Similar to {@link ClassLoader#getResource(String)}. */
- public synchronized static final URI getResource(String name) throws URISyntaxException {
+ public synchronized static final URI getResource(final String name) throws URISyntaxException {
checkInitialized();
final File f = new File(tmpFileCache.getTempDir(), name);
if(f.exists()) {
@@ -417,7 +417,7 @@ public class TempJarCache {
return null;
}
- private static void validateCertificates(Class<?> certClass, JarFile jarFile) throws IOException, SecurityException {
+ private static void validateCertificates(final Class<?> certClass, final JarFile jarFile) throws IOException, SecurityException {
if(null == certClass) {
throw new IllegalArgumentException("certClass is null");
}
diff --git a/src/java/com/jogamp/common/util/locks/LockFactory.java b/src/java/com/jogamp/common/util/locks/LockFactory.java
index e1ec2d7..dd8d25b 100644
--- a/src/java/com/jogamp/common/util/locks/LockFactory.java
+++ b/src/java/com/jogamp/common/util/locks/LockFactory.java
@@ -39,7 +39,7 @@ public class LockFactory {
public final int id;
- ImplType(int id){
+ ImplType(final int id){
this.id = id;
}
}
@@ -54,7 +54,7 @@ public class LockFactory {
return new RecursiveThreadGroupLockImpl01Unfairish();
}
- public static RecursiveLock createRecursiveLock(ImplType t, boolean fair) {
+ public static RecursiveLock createRecursiveLock(final ImplType t, final boolean fair) {
switch(t) {
case Int01:
return fair ? new RecursiveLockImpl01CompleteFair() : new RecursiveLockImpl01Unfairish();
diff --git a/src/java/com/jogamp/common/util/locks/SingletonInstance.java b/src/java/com/jogamp/common/util/locks/SingletonInstance.java
index f016d4b..ee703cd 100644
--- a/src/java/com/jogamp/common/util/locks/SingletonInstance.java
+++ b/src/java/com/jogamp/common/util/locks/SingletonInstance.java
@@ -37,11 +37,11 @@ public abstract class SingletonInstance implements Lock {
protected static final boolean DEBUG = true;
- public static SingletonInstance createFileLock(long poll_ms, String lockFileBasename) {
+ public static SingletonInstance createFileLock(final long poll_ms, final String lockFileBasename) {
return new SingletonInstanceFileLock(poll_ms, lockFileBasename);
}
- public static SingletonInstance createFileLock(long poll_ms, File lockFile) {
+ public static SingletonInstance createFileLock(final long poll_ms, final File lockFile) {
return new SingletonInstanceFileLock(poll_ms, lockFile);
}
@@ -58,11 +58,11 @@ public abstract class SingletonInstance implements Lock {
* @param pollPeriod
* @param portNumber to be used for this single instance server socket.
*/
- public static SingletonInstance createServerSocket(long poll_ms, int portNumber) {
+ public static SingletonInstance createServerSocket(final long poll_ms, final int portNumber) {
return new SingletonInstanceServerSocket(poll_ms, portNumber);
}
- protected SingletonInstance(long poll_ms) {
+ protected SingletonInstance(final long poll_ms) {
this.poll_ms = Math.max(10, poll_ms);
}
@@ -79,7 +79,7 @@ public abstract class SingletonInstance implements Lock {
return;
}
} while ( true ) ;
- } catch ( RuntimeException ie ) {
+ } catch ( final RuntimeException ie ) {
throw new RuntimeException(ie);
}
}
@@ -109,7 +109,7 @@ public abstract class SingletonInstance implements Lock {
maxwait -= System.currentTimeMillis()-t1;
i++;
} while ( 0 < maxwait ) ;
- } catch ( InterruptedException ie ) {
+ } catch ( final InterruptedException ie ) {
final long t2 = System.currentTimeMillis();
throw new RuntimeException(infoPrefix(t2)+" EEE (1) "+getName()+" - couldn't get lock within "+(t2-t0)+" ms, "+i+" attempts", ie);
}
@@ -139,7 +139,7 @@ public abstract class SingletonInstance implements Lock {
return locked;
}
- protected String infoPrefix(long currentMillis) {
+ protected String infoPrefix(final long currentMillis) {
return "SLOCK [T "+Thread.currentThread().getName()+" @ "+currentMillis+" ms";
}
protected String infoPrefix() {