diff options
Diffstat (limited to 'src/java/com/jogamp/common/os')
-rw-r--r-- | src/java/com/jogamp/common/os/AndroidVersion.java | 24 | ||||
-rw-r--r-- | src/java/com/jogamp/common/os/DynamicLibraryBundle.java | 26 | ||||
-rw-r--r-- | src/java/com/jogamp/common/os/MachineDescription.java | 54 | ||||
-rw-r--r-- | src/java/com/jogamp/common/os/NativeLibrary.java | 80 | ||||
-rw-r--r-- | src/java/com/jogamp/common/os/Platform.java | 25 |
5 files changed, 105 insertions, 104 deletions
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; } |