From d27d802b4e11745969909229a2d1f0963c74ce3a Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 17 Jul 2013 04:21:29 +0200 Subject: 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! +++ --- src/java/com/jogamp/common/util/locks/Lock.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/java/com/jogamp/common/util/locks/Lock.java') diff --git a/src/java/com/jogamp/common/util/locks/Lock.java b/src/java/com/jogamp/common/util/locks/Lock.java index ea29763..df645ed 100644 --- a/src/java/com/jogamp/common/util/locks/Lock.java +++ b/src/java/com/jogamp/common/util/locks/Lock.java @@ -35,12 +35,12 @@ import jogamp.common.Debug; */ public interface Lock { - /** Enable via the property jogamp.debug.Lock.TraceLock */ - public static final boolean TRACE_LOCK = Debug.isPropertyDefined("jogamp.debug.Lock.TraceLock", true); - /** Enable via the property jogamp.debug.Lock */ public static final boolean DEBUG = Debug.debug("Lock"); + /** Enable via the property jogamp.debug.Lock.TraceLock */ + public static final boolean TRACE_LOCK = Debug.isPropertyDefined("jogamp.debug.Lock.TraceLock", true); + /** The default {@link #TIMEOUT} value, of {@value} ms */ public static final long DEFAULT_TIMEOUT = 5000; // 5s default timeout -- cgit v1.2.3