This is the mail archive of the java-prs@sources.redhat.com 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/311: String constant concatenation error



>Number:         311
>Category:       gcj
>Synopsis:       String constant concatenation error
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apbianco
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 09 05:20:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Bryce McKinlay
>Release:        gcc version 2.96 20000809 (experimental)
>Organization:
>Environment:
linux
>Description:
There is a problem with concatenation of string constants.
This appears to be a recent regression.

public class StrConcat
{
  static final String FOO="1";

  public static void main(String args[])
  {
    System.out.println(FOO + "2");  
    System.out.println(FOO + "3");
  }
}

>How-To-Repeat:
Compile the test case above.

Correct output:
12
13

bogus gcj output:
12
123
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:

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