harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Svetlana Samoilenko (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-1849) [classlib][nio] java.nio.charset.CharsetEncoder.flush() throws unexpected IllegalArgumentException
Date Fri, 13 Oct 2006 04:10:39 GMT
[classlib][nio] 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

Unexpected IllegalArgumentException: "The length must be positive" was thrown on closing OutputStreamWriter
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.
            } catch (Throwable e) {
            } finally {                
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
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)
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


View raw message