From 3d1c8788547414de4fefbec44a1c014b77781fcf Mon Sep 17 00:00:00 2001 From: Bryce McKinlay Date: Mon, 19 Feb 2001 03:43:12 +0000 Subject: 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 --- libjava/java/lang/Long.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'libjava/java/lang/Long.java') diff --git a/libjava/java/lang/Long.java b/libjava/java/lang/Long.java index cb2cec2d904..2e812f9696d 100644 --- a/libjava/java/lang/Long.java +++ b/libjava/java/lang/Long.java @@ -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() -- cgit v1.2.3