summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/jogamp/common')
-rw-r--r--src/java/com/jogamp/common/jvm/JNILibLoaderBase.java5
-rw-r--r--src/java/com/jogamp/common/os/Platform.java8
-rw-r--r--src/java/com/jogamp/common/util/IOUtil.java8
-rw-r--r--src/java/com/jogamp/common/util/locks/Lock.java6
4 files changed, 15 insertions, 12 deletions
diff --git a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java
index fd12b7f..a5c68e7 100644
--- a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java
+++ b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java
@@ -51,6 +51,7 @@ import com.jogamp.common.util.JarUtil;
import com.jogamp.common.util.cache.TempJarCache;
import jogamp.common.Debug;
+import jogamp.common.PropertyAccess;
public class JNILibLoaderBase {
public static final boolean DEBUG = Debug.debug("JNILibLoader");
@@ -229,8 +230,8 @@ public class JNILibLoaderBase {
static {
final String sunAppletLauncherProperty = "sun.jnlp.applet.launcher";
final String sunAppletLauncherClassName = "org.jdesktop.applet.util.JNLPAppletLauncher";
- final boolean usingJNLPAppletLauncher = Boolean.valueOf(System.getProperty(sunAppletLauncherProperty)).booleanValue();
-
+ final boolean usingJNLPAppletLauncher = PropertyAccess.getBooleanProperty(sunAppletLauncherProperty, true, AccessController.getContext());
+
Class<?> launcherClass = null;
Method loadLibraryMethod = null;
diff --git a/src/java/com/jogamp/common/os/Platform.java b/src/java/com/jogamp/common/os/Platform.java
index 61b7345..ac1a1d0 100644
--- a/src/java/com/jogamp/common/os/Platform.java
+++ b/src/java/com/jogamp/common/os/Platform.java
@@ -41,7 +41,7 @@ import com.jogamp.common.util.JarUtil;
import com.jogamp.common.util.VersionNumber;
import com.jogamp.common.util.cache.TempJarCache;
-import jogamp.common.Debug;
+import jogamp.common.PropertyAccess;
import jogamp.common.jvm.JVMUtil;
import jogamp.common.os.MachineDescriptionRuntime;
@@ -205,11 +205,7 @@ public class Platform {
os_and_arch = getOSAndArch(OS_TYPE, CPU_ARCH);
USE_TEMP_JAR_CACHE = (OS_TYPE != OSType.ANDROID) && isRunningFromJarURL() &&
- AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
- public Boolean run() {
- return Boolean.valueOf(Debug.getBooleanProperty(true, useTempJarCachePropName, true, AccessController.getContext()));
- }
- }).booleanValue();
+ PropertyAccess.getBooleanProperty(useTempJarCachePropName, true, AccessController.getContext(), true);
loadGlueGenRTImpl();
JVMUtil.initSingleton(); // requires gluegen-rt, one-time init.
diff --git a/src/java/com/jogamp/common/util/IOUtil.java b/src/java/com/jogamp/common/util/IOUtil.java
index 0463c37..cdbeab6 100644
--- a/src/java/com/jogamp/common/util/IOUtil.java
+++ b/src/java/com/jogamp/common/util/IOUtil.java
@@ -44,6 +44,7 @@ import java.net.URLConnection;
import java.nio.ByteBuffer;
import jogamp.common.Debug;
+import jogamp.common.PropertyAccess;
import jogamp.common.os.android.StaticContext;
import android.content.Context;
@@ -510,11 +511,14 @@ public class IOUtil {
* for both platforms w/o the need to handle extra permissions.
* </p>
*
+ * @throws SecurityException
+ * @throws RuntimeException
+ *
* @see StaticContext#setContext(Context)
* @see Context#getDir(String, int)
*/
public static File getTempRoot()
- throws SecurityException
+ throws SecurityException, RuntimeException
{
if(AndroidVersion.isAvailable) {
final Context ctx = StaticContext.getContext();
@@ -526,7 +530,7 @@ public class IOUtil {
return tmpRoot;
}
}
- final String tmpRootName = System.getProperty("java.io.tmpdir");
+ final String tmpRootName = PropertyAccess.getProperty("java.io.tmpdir", false, AccessController.getContext());
final File tmpRoot = new File(tmpRootName);
if(DEBUG) {
System.err.println("IOUtil.getTempRoot(isAndroid: "+AndroidVersion.isAvailable+"): temp dir: "+tmpRoot.getAbsolutePath());
diff --git a/src/java/com/jogamp/common/util/locks/Lock.java b/src/java/com/jogamp/common/util/locks/Lock.java
index 15d01ec..b2d6acc 100644
--- a/src/java/com/jogamp/common/util/locks/Lock.java
+++ b/src/java/com/jogamp/common/util/locks/Lock.java
@@ -29,6 +29,8 @@
package com.jogamp.common.util.locks;
import jogamp.common.Debug;
+import jogamp.common.PropertyAccess;
+
import java.security.AccessController;
/**
@@ -37,7 +39,7 @@ import java.security.AccessController;
public interface Lock {
/** Enable via the property <code>jogamp.debug.Lock.TraceLock</code> */
- public static final boolean TRACE_LOCK = Debug.isPropertyDefined("jogamp.debug.Lock.TraceLock", true, AccessController.getContext());
+ public static final boolean TRACE_LOCK = PropertyAccess.isPropertyDefined("jogamp.debug.Lock.TraceLock", true, AccessController.getContext());
/** Enable via the property <code>jogamp.debug.Lock</code> */
public static final boolean DEBUG = Debug.debug("Lock");
@@ -50,7 +52,7 @@ public interface Lock {
* and defaults to {@link #DEFAULT_TIMEOUT}.<br>
* It can be overridden via the system property <code>jogamp.common.utils.locks.Lock.timeout</code>.
*/
- public static final long TIMEOUT = Debug.getLongProperty("jogamp.common.utils.locks.Lock.timeout", true, AccessController.getContext(), DEFAULT_TIMEOUT);
+ public static final long TIMEOUT = PropertyAccess.getLongProperty("jogamp.common.utils.locks.Lock.timeout", true, AccessController.getContext(), DEFAULT_TIMEOUT);
/**
* Blocking until the lock is acquired by this Thread or {@link #TIMEOUT} is reached.