diff options
author | Sven Gothel <[email protected]> | 2013-07-17 04:27:13 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-07-17 04:27:13 +0200 |
commit | 8ac3f344aded383ca9a3083a877af7bfdf6e1e48 (patch) | |
tree | 578fe88bbf8519aed9ef0cf255acd2a7d22a0978 /src/nativewindow/classes/javax | |
parent | a3d5a805751f1cb2c12c80fb0c28db13945a0a2b (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!
+++
Diffstat (limited to 'src/nativewindow/classes/javax')
-rw-r--r-- | src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java index 744c7e6d5..4f07bca9b 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java +++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java @@ -66,8 +66,13 @@ import jogamp.nativewindow.Debug; */ public class DefaultCapabilitiesChooser implements CapabilitiesChooser { - private static final boolean DEBUG = Debug.isPropertyDefined("nativewindow.debug.CapabilitiesChooser", true); + private static final boolean DEBUG; + static { + Debug.initSingleton(); + DEBUG = Debug.isPropertyDefined("nativewindow.debug.CapabilitiesChooser", true); + } + private final static int NO_SCORE = -9999999; private final static int COLOR_MISMATCH_PENALTY_SCALE = 36; |