You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexei Zakharov (JIRA)" <ji...@apache.org> on 2006/12/12 13:09:22 UTC

[jira] Updated: (HARMONY-1849) [classlib][nio charset] java.nio.charset.CharsetEncoder.flush() throws unexpected IllegalArgumentException

     [ http://issues.apache.org/jira/browse/HARMONY-1849?page=all ]

Alexei Zakharov updated HARMONY-1849:
-------------------------------------

    Summary: [classlib][nio charset] java.nio.charset.CharsetEncoder.flush() throws unexpected IllegalArgumentException  (was: [classlib][nio] java.nio.charset.CharsetEncoder.flush() throws unexpected IllegalArgumentException)

> [classlib][nio charset] java.nio.charset.CharsetEncoder.flush() throws unexpected IllegalArgumentException
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1849
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1849
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Svetlana Samoilenko
>            Priority: Minor
>         Attachments: H-1849-OutputStreamWriterTest.patch, Update-H-1849-OutputStreamWriterTest.patch
>
>
> Description:
> Unexpected IllegalArgumentException: "The length must be positive" was thrown on closing OutputStreamWriter object.
> RI works fine without any exceptions.
> import junit.framework.TestCase;
> import java.io.*;
>    public class test extends TestCase{    
>        public void testclose() throws IOException { 
>            OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("file"));                   
>            try {
>                 // write a surrogate pair char, then, write a char 0x0001 in order
>                 // to create a malformed surrogate element, expect nothing since specification
>                 // says the behavior is unspecified.
>                osw.write(0xD800); 
>                osw.write(1);
>             } catch (Throwable e) {
>                 //expected
>             } finally {                
>                  osw.close();
>             }        
>     }
> }
> HARMONY output:
> ==============
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r453981, (Oct  9 2006), Windows/ia32/msvc 1310, release build
> http://incubator.apache.org/harmony
> 1) testclose(test)java.lang.IllegalArgumentException: The length must be positive.
>         at java.nio.charset.CoderResult.malformedForLength(CoderResult.java:156)
>         at com.ibm.icu4jni.charset.CharsetEncoderICU.implFlush(Unknown Source)
>         at java.nio.charset.CharsetEncoder.flush(CharsetEncoder.java:650)
>         at java.io.OutputStreamWriter.close(OutputStreamWriter.java:150)
>         at test.testclose(test.java:16)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> FAILURES!!!
> Tests run: 1,  Failures: 0,  Errors: 
> SUN output:
> ==========
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
> .
> Time: 0.01
> OK (1 test)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira