Commit 3d1c8788 by Bryce McKinlay Committed by Bryce McKinlay

Integer.java (getInteger): Return default argument if property is not set.

	* java/lang/Integer.java (getInteger): Return default argument if
	property is not set. Don't call decode with null argument.
	* java/lang/Long.java (getLong): Likewise.

From-SVN: r39870
parent 8d444206
2001-02-19 Bryce McKinlay <bryce@albatross.co.nz>
* java/lang/Integer.java (getInteger): Return default argument if
property is not set. Don't call decode with null argument.
* java/lang/Long.java (getLong): Likewise.
2001-02-17 Mark Wielaard <mark@klomp.org>
* java/util/TimerTask.java: New version from Classpath.
......
......@@ -155,13 +155,15 @@ public final class Integer extends Number implements Comparable
public static Integer getInteger(String prop, Integer defobj)
{
try
{
return decode(System.getProperty(prop));
}
{
String val = System.getProperty(prop);
if (val != null)
return decode(val);
}
catch (NumberFormatException ex)
{
return defobj;
}
{
}
return defobj;
}
public int hashCode()
......
......@@ -156,13 +156,15 @@ public final class Long extends Number implements Comparable
public static Long getLong(String prop, Long defobj)
{
try
{
return decode(System.getProperty(prop));
}
{
String val = System.getProperty(prop);
if (val != null)
return decode(val);
}
catch (NumberFormatException ex)
{
return defobj;
}
{
}
return defobj;
}
public int hashCode()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment