You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Ray Chen (JIRA)" <ji...@apache.org> on 2009/12/22 07:17:18 UTC

[jira] Updated: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

     [ https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ray Chen updated HARMONY-6408:
------------------------------

    Attachment: Harmony-6408.diff

In the patch, I do three things:

1. Mapping 936 to GBK instead of GB2312 according to Windows Control Panel->Regional and Language options, which is as same as RI do.

2. Fix one bug in GBK encoding

3. Fix one bug in GB2312 encoding, both of them should minus bbRemaining by one after putting one byte into the buffer.

I have ran the nio, nio_char and luni test, no regression.

> [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6408
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6408
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ray Chen
>         Attachments: Harmony-6408.diff
>
>
> Following is the exception trace:
> java.nio.BufferOverflowException
> java.nio.charset.CoderMalfunctionError: java.nio.BufferOverflowException
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:450)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> at java.io.OutputStreamWriter.write(OutputStreamWriter.java:232)
> at java.io.Writer.write(Writer.java:98)
> at org.apache.harmony.luni.tests.java.io.OutputStreamWriterTest.testHandleEarlyEOFChar_1(OutputStreamWriterTest.java:416)
> at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> Caused by: java.nio.BufferOverflowException
> at java.nio.ReadWriteHeapByteBuffer.put(ReadWriteHeapByteBuffer.java:97)
> at org.apache.harmony.niochar.charset.additional.GB2312$Encoder.encodeLoop(GB2312.java:297)
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:448)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> In OutputStreamWriter's constructor using the default character encoding, on my machine, it is GB2312. 
> If I set the encoder to "ISO8859_1" the test passed.
> So I think most of the members from China will got this error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.