This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
gcj buglet
- To: Java Discuss List <java at gcc dot gnu dot org>
- Subject: gcj buglet
- From: Tom Tromey <tromey at redhat dot com>
- Date: 01 Oct 2001 19:52:10 -0600
- Cc: Alexandre Petit-Bianco <apbianco at cygnus dot com>
- Reply-To: tromey at redhat dot com
Consider this program:
public class t
{
public static String s (int x)
{
return null;
}
public static void main (String[] args)
{
System.out.println ((s(0) + "") == null);
}
}
This erroneously prints `true'.
It ought to print `false'.
I believe the empty-string elimination code in parse.y is somehow
buggy (but I am not 100% certain). When I look at the assembly code
for this, there are no calls to StringBuffer from main.
In this particular case it would be ok to replace the StringBuffer
stuff with a single call to String.valueOf().
Tom