summaryrefslogtreecommitdiffstats
path: root/src/java/jogamp/common/Debug.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-03-13 19:56:54 +0100
committerSven Gothel <[email protected]>2012-03-13 19:56:54 +0100
commitf4ac27e177f6deb444280d3b375e7d343e38bd08 (patch)
tree5dc8835bd3fb47475219d71e278d622ef5742420 /src/java/jogamp/common/Debug.java
parentbab77b637e7cdd327de5f66989fcbfc0298b9b88 (diff)
SecurityUtil: Generalize cert validation and AccessControlContext query; PropertyAccess: Fix security code, grant access to common 'trusted' properties
- SecurityUtil - Generalize cert validation for JAR and property access - Grant access to common AccessControlContext for 'same' cert - PropertyAccess: - Fix security code: Passing the current AccessControlContext from the caller didn't include priviledges. - Grant access to common 'trusted' properties, which removes the need of passing the AccessControlContext for general properties like 'jnlp.', 'jogamp.' .. - Enable registering 'trusted' properties, when caller's cert is 'same'
Diffstat (limited to 'src/java/jogamp/common/Debug.java')
-rw-r--r--src/java/jogamp/common/Debug.java32
1 files changed, 14 insertions, 18 deletions
diff --git a/src/java/jogamp/common/Debug.java b/src/java/jogamp/common/Debug.java
index b8ed098..f75b37b 100644
--- a/src/java/jogamp/common/Debug.java
+++ b/src/java/jogamp/common/Debug.java
@@ -39,38 +39,34 @@
package jogamp.common;
-import java.security.*;
+import com.jogamp.common.util.PropertyAccess;
/** Helper routines for logging and debugging. */
public class Debug extends PropertyAccess {
// Some common properties
- private static boolean verbose;
- private static boolean debugAll;
- private static AccessControlContext localACC;
+ private static final boolean verbose;
+ private static final boolean debugAll;
static {
- localACC=AccessController.getContext();
+ PropertyAccess.addTrustedPrefix("jogamp.", Debug.class);
+
verbose = isPropertyDefined("jogamp.verbose", true);
debugAll = isPropertyDefined("jogamp.debug", true);
}
- static int getIntProperty(final String property, final boolean jnlpAlias) {
- return getIntProperty(property, jnlpAlias, localACC, 0);
- }
-
- static boolean getBooleanProperty(final String property, final boolean jnlpAlias) {
- return getBooleanProperty(property, jnlpAlias, localACC);
+ public static final boolean getBooleanProperty(final String property, final boolean jnlpAlias) {
+ return PropertyAccess.getBooleanProperty(property, jnlpAlias, null);
}
-
- static boolean isPropertyDefined(final String property, final boolean jnlpAlias) {
- return isPropertyDefined(property, jnlpAlias, localACC);
+
+ public static final boolean getBooleanProperty(final String property, final boolean jnlpAlias, boolean defaultValue) {
+ return PropertyAccess.getBooleanProperty(property, jnlpAlias, null, defaultValue);
}
-
- static String getProperty(final String property, final boolean jnlpAlias) {
- return getProperty(property, jnlpAlias, localACC);
+
+ public static final long getLongProperty(final String property, final boolean jnlpAlias, long defaultValue) {
+ return PropertyAccess.getLongProperty(property, jnlpAlias, null, defaultValue);
}
-
+
public static boolean verbose() {
return verbose;
}