United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6292315 unexpected exception occurs in InputStreamReader
6292315 : unexpected exception occurs in InputStreamReader

Details
Type:
Bug
Submit Date:
2005-06-29
Status:
Resolved
Updated Date:
2011-02-16
Project Name:
JDK
Resolved Date:
2006-06-26
Component:
core-libs
OS:
windows_xp,windows_2000
Sub-Component:
java.nio.charsets
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
5.0,5.0u4,6
Fixed Versions:
1.4.2_13

Related Reports
Backport:
Duplicate:

Sub Tasks

Description
unexpected exception occurs in InputStreamReader.

REPRODUCE :
 1) Compile the attached test program.
 2) Launch "java TEST1 TEST1.xml"
   You will see the message as follows.

C:\users\issues\unicode\TEST1>java -showversion TEST1 TEST1.xml
java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode)

Exception in thread "main" java.lang.InternalError: Converter malfunction (Unico
deBig) -- please submit a bug report via http://java.sun.com/cgi-bin/bugreport.c
gi
        at sun.nio.cs.StreamDecoder$ConverterSD.malfunction(StreamDecoder.java:2
36)
        at sun.nio.cs.StreamDecoder$ConverterSD.convertInto(StreamDecoder.java:2
52)
        at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:298)

        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:183)
        at sun.nio.cs.StreamDecoder.read0(StreamDecoder.java:132)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:118)
        at java.io.InputStreamReader.read(InputStreamReader.java:151)
        at TEST1.main(TEST1.java:22)

CONFIGURSATION :
  JRE/JDK : 1.4.2/5.0u4
  OS : WindowsXP(SP1,Japanese)
  

###@###.### 2005-06-29 16:14:55 GMT

                                    

Comments
SUGGESTED FIX

*** /tmp/geta4196	Thu Jul 21 00:02:00 2005
--- ByteToCharUnicode.java	Thu Jul 21 00:01:51 2005
***************
*** 134,140 ****
  		    if (inI < inEnd) {
  			b1 = in[inI++] & 0xff;
  			bc = 1;
! 		    }
  		}
  		else {
  		    badInputLength = bc;
--- 134,141 ----
  		    if (inI < inEnd) {
  			b1 = in[inI++] & 0xff;
  			bc = 1;
! 		    } else
!                         byteOff = inI;
  		}
  		else {
  		    badInputLength = bc;
###@###.### 2005-07-21 07:10:33 GMT
                                     
2005-07-21
EVALUATION

Aged bug, probably existed in day one, in ByteToCharUnicode.java. Weird no one
noticed till now. See suggested fix for the fix for ByteToCharUnicode class. An
alternative is to use the nio version in 5.0ux as well.
###@###.### 2005-07-21 07:10:34 GMT
                                     
2005-07-21



Hardware and Software, Engineered to Work Together