Name: boT120536 Date: 07/22/2001
1.3.0, 1.3.1,
Long String constants (>20K <64K)
which are composed using the plus operator concatenating
a large number (>2000)
short Strings (between 4..20 characters each)
cause the compiler to crash with stack overflow
In 1.3:
java.lang.StackOverflowError
at com.sun.tools.javac.v8.parser.Parser.foldStrings(Parser.java:546)
at com.sun.tools.javac.v8.parser.Parser.foldStrings(Parser.java:546)
at com.sun.tools.javac.v8.parser.Parser.foldStrings(Parser.java:546)
at com.sun.tools.javac.v8.parser.Parser.foldStrings(Parser.java:546)
at com.sun.tools.javac.v8.parser.Parser.foldStrings(Parser.java:546)
in 1.4:
java.lang.StackOverflowError
at com.sun.tools.javac.v8.parser.Parser.foldStrings(Parser.java:680)
at com.sun.tools.javac.v8.parser.Parser.foldStrings(Parser.java:686)
at com.sun.tools.javac.v8.parser.Parser.foldStrings(Parser.java:686)
at com.sun.tools.javac.v8.parser.Parser.foldStrings(Parser.java:686)
at com.sun.tools.javac.v8.parser.Parser.foldStrings(Parser.java:686)
at com.sun.tools.javac.v8.parser.Parser.foldStrings(Parser.java:686)
Source code example:
private static String PCDATA=
/*0000*/ "Sun "+
/*0001*/ "Microsystems "+
/*0002*/ "Internationalization "+
/*0003*/ "Course "+
... // about 6000 more short lines
/*17be*/ "recognize "+
/*17bf*/ "grammatical "+
/*17c0*/ "forms "+
/*17c1*/ "feature "+
/*17c2*/ "spellchecker "+
/*17c3*/ "Separation "+
"";
(Review ID: 128575)
======================================================================
- duplicates
-
JDK-4496697 Parser.foldStrings() should use iteration instead of recursion.
-
- Closed
-