Occam's razor.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1600 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -175,12 +175,8 @@ public class Config
|
|||||||
String val = _props.getProperty(name);
|
String val = _props.getProperty(name);
|
||||||
if (val != null) {
|
if (val != null) {
|
||||||
try {
|
try {
|
||||||
// handle hex values
|
// handles base 10, hex values, etc.
|
||||||
if (val.startsWith("0x") || val.startsWith("0X")) {
|
return Integer.decode(val).intValue();
|
||||||
defval = Integer.parseInt(val.substring(2), 16);
|
|
||||||
} else {
|
|
||||||
defval = Integer.parseInt(val);
|
|
||||||
}
|
|
||||||
} catch (NumberFormatException nfe) {
|
} catch (NumberFormatException nfe) {
|
||||||
Log.warning("Malformed integer property [name=" + name +
|
Log.warning("Malformed integer property [name=" + name +
|
||||||
", value=" + val + "].");
|
", value=" + val + "].");
|
||||||
|
|||||||
Reference in New Issue
Block a user