This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Long.getLong() buglet
- From: Mark Wielaard <mark at klomp dot org>
- To: java-patches at gcc dot gnu dot org
- Date: 02 Apr 2002 16:19:33 +0200
- Subject: Long.getLong() buglet
Hi,
This fixes a stupid bug in Long.getLong(). We tried to decode the System
property key and not the actual value returned.
2002-04-02 Mark Wielaard <mark@klomp.org>
* java/lang/Long.java (getLong(String,Long)): Actually decode property
value, not key.
This has already been fixed in the Classpath version of Long.
OK to commit this small fixlet to the 3.1 branch and wait till after the
3.1 release to merge the complete Classpath Long version to mainline?
Cheers,
Mark
Index: java/lang/Long.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/Long.java,v
retrieving revision 1.11
diff -u -r1.11 Long.java
--- Long.java 2002/01/22 22:40:16 1.11
+++ Long.java 2002/04/02 12:12:16
@@ -186,8 +186,8 @@
*/
public static Long getLong(String nm, Long def)
{
- String val = System.getProperty(nm);
- if (val == null)
+ nm = System.getProperty(nm);
+ if (nm == null || "".equals(nm))
return def;
try
{