summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-07-17 04:23:07 +0200
committerSven Gothel <[email protected]>2013-07-17 04:23:07 +0200
commitb4fbbc98929c56b9f82815a50dacb02796d9d252 (patch)
tree12b4eac67fc86a996d3cd4cdd1adb456ad5f3e35
parent0de2ee1c2ea34b60c7b139ce9a49d690ed7428de (diff)
Remedy for Bug 782: Issue Debug.initSingleton() or Debug.debug(..) before calling 'PropertyAccess.isPropertyDefined(propName, default)' through Debug class.
Calling 'Debug.isPropertyDefined(propName, default)' may be 'optimized' to 'PropertyAccess.isPropertyDefined(propName, default)', which would skip the modules Debug's class initialization. Iff that happens, an AccessControlException may happen, due to requesting an insecure property, since modules own Debug class has not been added it's trusted prefixes from within it's init block yet. This seems to be a bug of the JVM .. to me, however .. the above description is the only able to explain the issue at hand. +++ Fix calls Debug class own static methods, either Debug.initSingleton() or Debug.debug(), before calling 'isPropertyDefined(propName, default)'. +++ Also mark Debug class static methods final! +++
-rw-r--r--src/java/jogamp/openal/Debug.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/java/jogamp/openal/Debug.java b/src/java/jogamp/openal/Debug.java
index 098b640..4cc209e 100644
--- a/src/java/jogamp/openal/Debug.java
+++ b/src/java/jogamp/openal/Debug.java
@@ -64,15 +64,19 @@ public class Debug extends PropertyAccess {
debugAll = isPropertyDefined("joal.debug", true);
}
- public static boolean verbose() {
+ /** Ensures static init block has been issues, i.e. if calling through to {@link PropertyAccess#isPropertyDefined(String, boolean)}. */
+ public static final void initSingleton() {}
+
+
+ public static final boolean verbose() {
return verbose;
}
- public static boolean debugAll() {
+ public static final boolean debugAll() {
return debugAll;
}
- public static boolean debug(String subcomponent) {
+ public static final boolean debug(String subcomponent) {
return debugAll() || isPropertyDefined("joal.debug." + subcomponent, true);
}
}