aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/impl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-10-14 21:30:14 +0200
committerSven Gothel <[email protected]>2010-10-14 21:30:14 +0200
commit1c7f8f8dafe0252afbb0e2701687210814b56793 (patch)
tree99e9830d5b57ab55fc109f30f9196dff6131b810 /src/java/com/jogamp/common/impl
parent52dcea28906b3e61ef44595399e525dd5169c014 (diff)
Moved locking to: com.jogamp.common.util.locks ; Better abstraction ; Misc changes
Diffstat (limited to 'src/java/com/jogamp/common/impl')
-rw-r--r--src/java/com/jogamp/common/impl/Debug.java25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/java/com/jogamp/common/impl/Debug.java b/src/java/com/jogamp/common/impl/Debug.java
index 06a5fea..d8412ae 100644
--- a/src/java/com/jogamp/common/impl/Debug.java
+++ b/src/java/com/jogamp/common/impl/Debug.java
@@ -56,18 +56,33 @@ public class Debug {
}
static int getIntProperty(final String property, final boolean jnlpAlias) {
- return getIntProperty(property, jnlpAlias, localACC);
+ return getIntProperty(property, jnlpAlias, localACC, 0);
}
- public static int getIntProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
- int i=0;
+ public static int getIntProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc, int defaultValue) {
+ int i=defaultValue;
try {
- Integer iv = Integer.valueOf(Debug.getProperty(property, jnlpAlias, acc));
- i = iv.intValue();
+ String sv = Debug.getProperty(property, jnlpAlias, acc);
+ if(null!=sv) {
+ Integer iv = Integer.valueOf(sv);
+ i = iv.intValue();
+ }
} catch (NumberFormatException nfe) {}
return i;
}
+ public static long getLongProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc, long defaultValue) {
+ long l=defaultValue;
+ try {
+ String sv = Debug.getProperty(property, jnlpAlias, acc);
+ if(null!=sv) {
+ Long lv = Long.valueOf(sv);
+ l = lv.longValue();
+ }
+ } catch (NumberFormatException nfe) {}
+ return l;
+ }
+
static boolean getBooleanProperty(final String property, final boolean jnlpAlias) {
return getBooleanProperty(property, jnlpAlias, localACC);
}