Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 90022 invoked from network); 11 Apr 2007 06:57:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Apr 2007 06:57:54 -0000 Received: (qmail 7348 invoked by uid 500); 11 Apr 2007 06:58:00 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 7243 invoked by uid 500); 11 Apr 2007 06:58:00 -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 7234 invoked by uid 99); 11 Apr 2007 06:58:00 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Apr 2007 23:58:00 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED 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; Tue, 10 Apr 2007 23:57:53 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0BFC471407E for ; Tue, 10 Apr 2007 23:57:33 -0700 (PDT) Message-ID: <15617346.1176274653046.JavaMail.jira@brutus> Date: Tue, 10 Apr 2007 23:57:33 -0700 (PDT) From: "Paulex Yang (JIRA)" To: commits@harmony.apache.org Subject: [jira] Assigned: (HARMONY-1082) [classlib][io]compatibility:java.io.BufferedOutputStream.write(byte[], int, int) throws ArrayIndexOutOfBoundsException while RI throws NullPointerException MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-1082?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paulex Yang reassigned HARMONY-1082: ------------------------------------ Assignee: Paulex Yang > [classlib][io]compatibility:java.io.BufferedOutputStream.write(byte[], int, int) throws ArrayIndexOutOfBoundsException while RI throws NullPointerException > ----------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-1082 > URL: https://issues.apache.org/jira/browse/HARMONY-1082 > Project: Harmony > Issue Type: Bug > Components: Non-bug differences from RI > Reporter: Ilya Okomin > Assigned To: Paulex Yang > Priority: Trivial > Attachments: Harmony-1082-2.diff, harmony-1082.diff > > > J2SE API specifications for java.io.BufferedOutputStream.write(byte[], int, int) method says "Throws IOException - if an I/O error occurs." > Spec for the superclass java.io.OutputStream says that "If off is negative, or len is negative, or off+len is greater than the length of the array b, then an IndexOutOfBoundsException is thrown." > Harmony throws ArrayIndexOutOfBoundsException while RI throws NullPointerException. > ============== Test9422 .java ===================== > import java.io.BufferedOutputStream; > public class Test9422 { > public static void main(String[] argv) { > BufferedOutputStream localBufferedOutputStream = new BufferedOutputStream( > null, 1); > byte[] array0 = new byte[] { 2, 2, 2, 2, 2, 2, 2, 2, 2 }; > try { > localBufferedOutputStream.write(array0, 127, 1); > System.out.println("Test filed!"); > } catch (IndexOutOfBoundsException e) { > System.out.println("Test passed: expected " + e); > } catch (Exception e) { > System.out.println("Test filed: " + e); > } > > try { > localBufferedOutputStream.write(array0, 5, 17); > System.out.println("Test filed!"); > } catch (IndexOutOfBoundsException e) { > System.out.println("Test passed: expected " + e); > } catch (Exception e) { > System.out.println("Test filed: " + e); > } > try { > localBufferedOutputStream.write(array0, -1, 5); > System.out.println("Test filed!"); > } catch (IndexOutOfBoundsException e) { > System.out.println("Test passed: expected " + e); > } catch (Exception e) { > System.out.println("Test filed: " + e); > } > try { > localBufferedOutputStream.write(array0, 1, -5); > System.out.println("Test filed!"); > } catch (IndexOutOfBoundsException e) { > System.out.println("Test passed: expected " + e); > } catch (Exception e) { > System.out.println("Test filed: " + e); > } > } > } > ========================================== > Output: > Harmony: > java version "1.5.0" > pre-alpha : not complete or compatible > svn = r424571, (Jul 22 2006), Windows/ia32/msvc 1310, release build > http://incubator.apache.org/harmony > Test passed: expected java.lang.ArrayIndexOutOfBoundsException: Arguments out of bounds > Test passed: expected java.lang.ArrayIndexOutOfBoundsException: Arguments out of bounds > Test passed: expected java.lang.ArrayIndexOutOfBoundsException: Arguments out of bounds > Test passed: expected java.lang.ArrayIndexOutOfBoundsException: Arguments out of bounds > RI: > java version "1.5.0" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64) > BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar)) > Test filed: java.lang.NullPointerException > Test filed: java.lang.NullPointerException > Test filed: java.lang.NullPointerException > Test passed: expected java.lang.ArrayIndexOutOfBoundsException -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.