diff options
Diffstat (limited to 'src/java/com/jogamp/common/impl/Debug.java')
-rw-r--r-- | src/java/com/jogamp/common/impl/Debug.java | 25 |
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); } |