summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/Debug.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-03-13 20:19:19 +0100
committerSven Gothel <[email protected]>2012-03-13 20:19:19 +0100
commit7d7e7c901d8fe54af1230cbf10e568f1a8433cbe (patch)
treefe878a3776be351faa3c3f7f10583af5f38c112d /src/jogl/classes/jogamp/opengl/Debug.java
parent558a674f5ed727be1536cffd882d43458ce47a37 (diff)
Adapt to gluegen Properties/Security commits f4ac27e177f6deb444280d3b375e7d343e38bd080 and eedb4b530fb83fc59a26962bcf7847a1404092a0
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/Debug.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/Debug.java82
1 files changed, 14 insertions, 68 deletions
diff --git a/src/jogl/classes/jogamp/opengl/Debug.java b/src/jogl/classes/jogamp/opengl/Debug.java
index 83c79c1d3..4287c1960 100644
--- a/src/jogl/classes/jogamp/opengl/Debug.java
+++ b/src/jogl/classes/jogamp/opengl/Debug.java
@@ -39,18 +39,17 @@
package jogamp.opengl;
-import java.security.*;
+import com.jogamp.common.util.PropertyAccess;
/** Helper routines for logging and debugging. */
-public class Debug {
+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("jogl.", Debug.class);
verbose = isPropertyDefined("jogl.verbose", true);
debugAll = isPropertyDefined("jogl.debug", true);
if (verbose) {
@@ -61,71 +60,18 @@ public class Debug {
}
}
- static int getIntProperty(final String property, final boolean jnlpAlias) {
- return getIntProperty(property, jnlpAlias, localACC);
+ public static final boolean isPropertyDefined(final String property, final boolean jnlpAlias) {
+ return PropertyAccess.isPropertyDefined(property, jnlpAlias, null);
}
-
- public static int getIntProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
- int i=0;
- try {
- Integer iv = Integer.valueOf(Debug.getProperty(property, jnlpAlias, acc));
- i = iv.intValue();
- } catch (NumberFormatException nfe) {}
- return i;
- }
-
- static boolean getBooleanProperty(final String property, final boolean jnlpAlias) {
- return getBooleanProperty(property, jnlpAlias, localACC);
- }
-
- public static boolean getBooleanProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
- Boolean b = Boolean.valueOf(Debug.getProperty(property, jnlpAlias, acc));
- return b.booleanValue();
- }
-
- static boolean isPropertyDefined(final String property, final boolean jnlpAlias) {
- return isPropertyDefined(property, jnlpAlias, localACC);
- }
-
- public static boolean isPropertyDefined(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
- return (Debug.getProperty(property, jnlpAlias, acc) != null) ? true : false;
- }
-
- static String getProperty(final String property, final boolean jnlpAlias) {
- return getProperty(property, jnlpAlias, localACC);
+
+ public static String getProperty(final String property, final boolean jnlpAlias) {
+ return PropertyAccess.getProperty(property, jnlpAlias, null);
}
-
- public static String getProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
- String s=null;
- if(null!=acc && acc.equals(localACC)) {
- s = (String) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- String val=null;
- try {
- val = System.getProperty(property);
- } catch (Exception e) {}
- if(null==val && jnlpAlias && !property.startsWith(jnlp_prefix)) {
- try {
- val = System.getProperty(jnlp_prefix + property);
- } catch (Exception e) {}
- }
- return val;
- }
- });
- } else {
- try {
- s = System.getProperty(property);
- } catch (Exception e) {}
- if(null==s && jnlpAlias && !property.startsWith(jnlp_prefix)) {
- try {
- s = System.getProperty(jnlp_prefix + property);
- } catch (Exception e) {}
- }
- }
- return s;
+
+ public static final boolean getBooleanProperty(final String property, final boolean jnlpAlias) {
+ return PropertyAccess.getBooleanProperty(property, jnlpAlias, null);
}
- public static final String jnlp_prefix = "jnlp." ;
-
+
public static boolean verbose() {
return verbose;
}