diff options
author | Sven Gothel <[email protected]> | 2014-07-03 16:06:47 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-03 16:06:47 +0200 |
commit | df9ff7f340a5ab4e07efc613f5f264eeae63d4c7 (patch) | |
tree | 239ae276b82024b140428e6c0fe5d739fdd686a4 /src/java/com/jogamp/common/util/PropertyAccess.java | |
parent | eb47aaba63e3b1bf55f274a0f338f1010a017ae4 (diff) |
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type
- Change indirect accesses to static members to direct accesses (accesses through subtypes)
- Add final modifier to private fields
- Add final modifier to method parameters
- Add final modifier to local variables
- Remove unnecessary casts
- Remove unnecessary '$NON-NLS$' tags
- Remove trailing white spaces on all lines
Diffstat (limited to 'src/java/com/jogamp/common/util/PropertyAccess.java')
-rw-r--r-- | src/java/com/jogamp/common/util/PropertyAccess.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/java/com/jogamp/common/util/PropertyAccess.java b/src/java/com/jogamp/common/util/PropertyAccess.java index a2e3690..b6e9bdd 100644 --- a/src/java/com/jogamp/common/util/PropertyAccess.java +++ b/src/java/com/jogamp/common/util/PropertyAccess.java @@ -59,12 +59,12 @@ public class PropertyAccess { * @param prefix New prefix to be registered as trusted. * @throws AccessControlException as thrown by {@link SecurityUtil#checkAllPermissions()}. */ - protected static final void addTrustedPrefix(String prefix) throws AccessControlException { + protected static final void addTrustedPrefix(final String prefix) throws AccessControlException { SecurityUtil.checkAllPermissions(); trustedPrefixes.add(prefix); } - public static final boolean isTrusted(String propertyKey) { + public static final boolean isTrusted(final String propertyKey) { final int dot1 = propertyKey.indexOf('.'); if(0<=dot1) { return trustedPrefixes.contains(propertyKey.substring(0, dot1+1)) || trusted.contains(propertyKey); @@ -74,26 +74,26 @@ public class PropertyAccess { } /** @see #getProperty(String, boolean) */ - public static final int getIntProperty(final String property, final boolean jnlpAlias, int defaultValue) { + public static final int getIntProperty(final String property, final boolean jnlpAlias, final int defaultValue) { int i=defaultValue; try { final String sv = PropertyAccess.getProperty(property, jnlpAlias); if(null!=sv) { i = Integer.parseInt(sv); } - } catch (NumberFormatException nfe) {} + } catch (final NumberFormatException nfe) {} return i; } /** @see #getProperty(String, boolean) */ - public static final long getLongProperty(final String property, final boolean jnlpAlias, long defaultValue) { + public static final long getLongProperty(final String property, final boolean jnlpAlias, final long defaultValue) { long l=defaultValue; try { final String sv = PropertyAccess.getProperty(property, jnlpAlias); if(null!=sv) { l = Long.parseLong(sv); } - } catch (NumberFormatException nfe) {} + } catch (final NumberFormatException nfe) {} return l; } @@ -103,7 +103,7 @@ public class PropertyAccess { } /** @see #getProperty(String, boolean) */ - public static final boolean getBooleanProperty(final String property, final boolean jnlpAlias, boolean defaultValue) { + public static final boolean getBooleanProperty(final String property, final boolean jnlpAlias, final boolean defaultValue) { final String valueS = PropertyAccess.getProperty(property, jnlpAlias); if(null != valueS) { return Boolean.valueOf(valueS).booleanValue(); @@ -164,7 +164,7 @@ public class PropertyAccess { } /** See {@link #getProperty(String, boolean)}, additionally allows a <code>defaultValue</code> if property value is <code>null</code>. */ - public static final String getProperty(final String propertyKey, final boolean jnlpAlias, String defaultValue) + public static final String getProperty(final String propertyKey, final boolean jnlpAlias, final String defaultValue) throws SecurityException, NullPointerException, IllegalArgumentException { final String s = PropertyAccess.getProperty(propertyKey, jnlpAlias); if( null != s ) { @@ -180,7 +180,7 @@ public class PropertyAccess { public String run() { try { return System.getProperty(propertyKey); - } catch (SecurityException se) { + } catch (final SecurityException se) { throw new SecurityException("Could not access trusted property '"+propertyKey+"'", se); } } |