JDK-4121358 : compile test code under /test throws StringIndexOutOfBoundsException.
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.1.6,1.2.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS:
    generic,solaris_2.5.1,windows_95,windows_nt generic,solaris_2.5.1,windows_95,windows_nt
  • CPU: generic,x86,sparc
  • Submitted: 1998-03-20
  • Updated: 1999-01-15
  • Resolved: 1999-01-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other Other
1.1.7 b01Fixed 1.2.0Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Description
JDK1.1.6(K) or JDK1.2b3(L) comes with test code for regression test under directory ./test in source distribution.

STEPS:

$ setenv LANG ja
$ cd test/java/intltest
$ javac BreakIteratorTest.java
java.lang.StringIndexOutOfBoundsException: String index out of range: -125
        at java.lang.String.charAt(String.java:392)
        at sun.io.ByteToCharEUC_JP.getUnicode(ByteToCharEUC_JP.java:72)
        at sun.io.ByteToCharEUC_JP.convert(ByteToCharEUC_JP.java:150)
        at java.io.InputStreamReader.convertInto(InputStreamReader.java:123)
        at java.io.InputStreamReader.fill(InputStreamReader.java:171)
        at java.io.InputStreamReader.read(InputStreamReader.java:229)
        at java.io.Reader.read(Reader.java:103)
        at sun.tools.java.ScannerInputReader.read(ScannerInputReader.java:129)
        at sun.tools.java.Scanner.scanIdentifier(Scanner.java:735)
        at sun.tools.java.Scanner.xscan(Scanner.java:1094)
        at sun.tools.java.Scanner.scan(Scanner.java:784)
        at sun.tools.java.Parser.scan(Parser.java:2024)
        at sun.tools.java.Parser.expect(Parser.java:290)
        at sun.tools.java.Parser.parseStatement(Parser.java:1282)
        at sun.tools.java.Parser.parseBlockStatement(Parser.java:1312)
        at sun.tools.java.Parser.parseStatement(Parser.java:908)
        at sun.tools.java.Parser.parseField(Parser.java:1640)
        at sun.tools.java.Parser.parseClassBody(Parser.java:1872)
        at sun.tools.java.Parser.parseNamedClass(Parser.java:1808)
        at sun.tools.java.Parser.parseClass(Parser.java:1761)
        at sun.tools.java.Parser.parseFile(Parser.java:1968)
        at sun.tools.javac.BatchEnvironment.parseFile(BatchEnvironment.java:343)
        at sun.tools.javac.Main.compile(Main.java:330)
        at sun.tools.javac.Main.main(Main.java:571)

-----

This does not happen on "C" Locale.

koushi.takahashi@japan 1998-03-20

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.1.7 1.2beta4 FIXED IN: 1.1.7 1.2beta4 INTEGRATED IN: 1.1.7 1.2beta4
14-06-2004

PUBLIC COMMENTS .
10-06-2004

EVALUATION According to the stack crawl in the bug report, the crash is coming inside sun.io.ByteToCharEUC_JP.getUnicode(). The crash isn't actually happening inside BreakIterator. It appears that this is a bug in the character code converters. mark.son-bell@eng 1998-03-25 This turns out to be roughly the same bug as 4117820. That is, a failure on the part of ByteToCharEUC_JP.getUnicode() to check for illegal values. The fix in progress is indentical to the one added to ByteToCharDoubleByte.getUnicode(). We could probably be a little more elegant in our class inheritance so as to eliminate the need for this sort of duplication. Worth a revisit in 1.next. mark.son-bell@eng 1998-04-13 Fix integrated into jdk1.2beta3 M2 integration workspace. mark.son-bell@eng 1998-04-24
13-04-1998

SUGGESTED FIX "BreakIteratorTest.java" line 688 has illegal character on EUCJIS. koushi.takahashi@japan 1998-03-20
20-03-1998

WORK AROUND set current locale to "C" when javac this file. koushi.takahashi@japan 1998-03-20
20-03-1998