Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 15286 invoked from network); 7 Dec 2006 15:45:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Dec 2006 15:45:36 -0000 Received: (qmail 54394 invoked by uid 500); 7 Dec 2006 15:45:44 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 54360 invoked by uid 500); 7 Dec 2006 15:45:43 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 54351 invoked by uid 99); 7 Dec 2006 15:45:43 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Dec 2006 07:45:43 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Dec 2006 07:45:30 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 83D4271431E for ; Thu, 7 Dec 2006 07:44:42 -0800 (PST) Message-ID: <21740795.1165506282537.JavaMail.jira@brutus> Date: Thu, 7 Dec 2006 07:44:42 -0800 (PST) From: "Alexei Zakharov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-2404) [classlib][luni] java.io.PipedWriter.write(buf,off,len) throws exeptions in different order than RI In-Reply-To: <26264616.1165231881127.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/HARMONY-2404?page=all ] Alexei Zakharov updated HARMONY-2404: ------------------------------------- Summary: [classlib][luni] java.io.PipedWriter.write(buf,off,len) throws exeptions in different order than RI (was: java.io.PipedWriter.write(buf,off,len) throws exeptions in different order than RI) Description: java.io.PipedWriter.write(buf,off,len) throws exeptions in different order than RI. Harmony at first checks boundary condition while RI checks pipe connection. Compatibility issue. Test for reproducing: import junit.framework.TestCase; import java.io.*; public class test extends TestCase { public void test1 () { try { PipedWriter obj=new PipedWriter(); obj.write(new char[]{1,1},10,1); fail("IOException should be thrown"); } catch (IOException e) { //expected } } } Output on Sun 1.5: ================== . Time: 0 OK (1 test) Output on Harmony: ================== .E Time: 0.015 There was 1 error: 1) test1(test)java.lang.IndexOutOfBoundsException at java.io.PipedWriter.write(PipedWriter.java:166) at test.test1(test.java:8) at java.lang.reflect.VMReflection.invokeMethod(Native Method) FAILURES!!! Tests run: 1, Failures: 0, Errors: 1 The same issue if first parameter buffer==null. Harmony throws NullPointerException while RI at first checks pipe connection and throws java.io.IOException: Pipe Not Connected. import junit.framework.TestCase; import java.io.*; public class test extends TestCase { public void test2 () { try { PipedWriter obj=new PipedWriter(); obj.write((char[])null,10,1); fail("IOException should be thrown"); } catch (IOException e) { //expected } } } was: java.io.PipedWriter.write(buf,off,len) throws exeptions in different order than RI. Harmony at first checks boundary condition while RI checks pipe connection. Compatibility issue. Test for reproducing: import junit.framework.TestCase; import java.io.*; public class test extends TestCase { public void test1 () { try { PipedWriter obj=new PipedWriter(); obj.write(new char[]{1,1},10,1); fail("IOException should be thrown"); } catch (IOException e) { //expected } } } Output on Sun 1.5: ================== . Time: 0 OK (1 test) Output on Harmony: ================== .E Time: 0.015 There was 1 error: 1) test1(test)java.lang.IndexOutOfBoundsException at java.io.PipedWriter.write(PipedWriter.java:166) at test.test1(test.java:8) at java.lang.reflect.VMReflection.invokeMethod(Native Method) FAILURES!!! Tests run: 1, Failures: 0, Errors: 1 The same issue if first parameter buffer==null. Harmony throws NullPointerException while RI at first checks pipe connection and throws java.io.IOException: Pipe Not Connected. import junit.framework.TestCase; import java.io.*; public class test extends TestCase { public void test2 () { try { PipedWriter obj=new PipedWriter(); obj.write((char[])null,10,1); fail("IOException should be thrown"); } catch (IOException e) { //expected } } } adding [classlib][luni] prefix to summary > [classlib][luni] java.io.PipedWriter.write(buf,off,len) throws exeptions in different order than RI > --------------------------------------------------------------------------------------------------- > > Key: HARMONY-2404 > URL: http://issues.apache.org/jira/browse/HARMONY-2404 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Artem Aliev > Priority: Minor > > java.io.PipedWriter.write(buf,off,len) throws exeptions in different order than > RI. > Harmony at first checks boundary condition while RI checks pipe connection. > Compatibility issue. > Test for reproducing: > import junit.framework.TestCase; > import java.io.*; > public class test extends TestCase { > public void test1 () { > try { > PipedWriter obj=new PipedWriter(); > obj.write(new char[]{1,1},10,1); > fail("IOException should be thrown"); > } catch (IOException e) { > //expected > } > } > } > Output on Sun 1.5: > ================== > . > Time: 0 > OK (1 test) > Output on Harmony: > ================== > .E > Time: 0.015 > There was 1 error: > 1) test1(test)java.lang.IndexOutOfBoundsException > at java.io.PipedWriter.write(PipedWriter.java:166) > at test.test1(test.java:8) > at java.lang.reflect.VMReflection.invokeMethod(Native Method) > FAILURES!!! > Tests run: 1, Failures: 0, Errors: 1 > The same issue if first parameter buffer==null. > Harmony throws NullPointerException while RI at first checks pipe connection > and throws java.io.IOException: Pipe Not Connected. > import junit.framework.TestCase; > import java.io.*; > public class test extends TestCase { > public void test2 () { > try { > PipedWriter obj=new PipedWriter(); > obj.write((char[])null,10,1); > fail("IOException should be thrown"); > } catch (IOException e) { > //expected > } > } > } -- 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