Microsoft KB Archive/156921

= FIX: Large String Literals Can Cause Compiler Errors =

Article ID: 156921

Article Last Modified on 5/12/2007

-

APPLIES TO


 * Microsoft Visual J++ 1.0 Standard Edition

-



This article was previously published under Q156921



SYMPTOMS
The Java Language Compiler (jvc) generates various compiler errors when a string literal exceeds 1000 characters on one line.



WORKAROUND
You can avoid having string literals that exceed 1000 characters by breaking your string literal into multiple lines and using the + (plus sign) operator to combine the strings.



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in Visual J++ 1.1.



Steps to Reproduce Behavior
The following sample code generates one or more of the following errors:

test.java(2162720,1071) : error J0010: Syntax error

test.java(2162720,1072) : error J0014: Expected ')'

test.java(2359392,0) : error J0029: Invalid character

test.java(2752554,2752554) : fatal error J0001: Internal Compiler Error

// test.java void test { public static void main(String args[]) { System.out.println("**************************************************** } }
 * ... for about 1500 characters");

// workaround.java void workaround { public static void main(String args[]) { System.out.println("****************************************"+      "********************************************************"+       "**************************... for about 1500 characters"); }

}

