This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcj buglet


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]