Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 35951 invoked from network); 8 Aug 2006 10:30:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Aug 2006 10:30:59 -0000 Received: (qmail 60065 invoked by uid 500); 8 Aug 2006 10:30:58 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 60039 invoked by uid 500); 8 Aug 2006 10:30:58 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 60028 invoked by uid 99); 8 Aug 2006 10:30:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2006 03:30:58 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2006 03:30:58 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id DE7797141F1 for ; Tue, 8 Aug 2006 10:28:15 +0000 (GMT) Message-ID: <16906188.1155032895908.JavaMail.jira@brutus> Date: Tue, 8 Aug 2006 03:28:15 -0700 (PDT) From: "Paulex Yang (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Reopened: (HARMONY-1031) [classlib][text]compatibility: Bidi expected IAE In-Reply-To: <33034843.1154435173921.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 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-1031?page=all ] Paulex Yang reopened HARMONY-1031: ---------------------------------- Denis found more issues. Will look at it soon. > [classlib][text]compatibility: Bidi expected IAE > ------------------------------------------------ > > Key: HARMONY-1031 > URL: http://issues.apache.org/jira/browse/HARMONY-1031 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Denis Kishenko > Assigned To: Paulex Yang > Attachments: 1031-Bidi(2).patch, 1031-Bidi(3).patch, 1031-Bidi.patch, 1031-BidiTest(2).patch, 1031-BidiTest.patch, Bidi.patch, BidiTest.patch > > > 1. Compatibility bug in java.text.Bidi.reorderVisually(byte[], int, Object[],int,int) > - RI throws IAE while Harmony throws NegativeArrayException if last parameter is negative > 2. Compatibility bug java.text.Bidi(char[] text, int textStart, byte[] embeddings, int embStart, int paragraphLength, int flags) > - RI throws IAE while Harmony throws ArrayIndexOutOfBoundsException if textStart <0 > - RI throws IAE while Harmony throws nothing if embStart <0 > - RI throws IAE while Harmony throws NegativeArraySizeException if paragraphLength <0 > - RI throws IAE while Harmony throws OutOfMemoryError if paragraphLength= Integer.MAX_VALUE > - RI throws nothing while Harmony throws NPE if embStart= flags and paragraphLength=0. > Test: 1 ======================================================================= > import java.text.*; > public class test3 { > public static void main (String[] args) { > Bidi bidi=null; > String par="asdfghsafl;"; > AttributedString paragraph = new AttributedString("Paragraph of text| > txet of hpargarap"); > try { > bidi = new Bidi( paragraph.getIterator()); > } > catch (Exception e) { > System.out.println ("new Bidi" + e); > } > Object[] oa= new Object[] {new String("testString")}; > byte[] levels = new byte[]{(byte)0xFF}; > int levelStart = 1; > int Start = 1; > int count = -1; > try{ > bidi.reorderVisually(levels, levelStart, oa, Start, count); > return; > } > catch (IllegalArgumentException e) {e.printStackTrace(); > System.out.println("passed"); > } > catch (NegativeArraySizeException e) {e.printStackTrace(); > System.out.println("failed"); > } > } > } > Output: > ----------------------------------------------------------------jrockit-jdk1.5.0_03: > java.lang.IllegalArgumentException: count -2 must be >= 0 > at java.text.Bidi.reorderVisually(Bidi.java:520) > at bug9267.main(bug9267.java:26) > passed > ----------------------------------------------------------------Harmony > java.lang.NegativeArraySizeException > at java.text.Bidi.reorderVisually(Bidi.java:428) > at bug9267.main(bug9267.java:26) > failed > Test: 2 ======================================================================= > import java.text.Bidi; > import java.util.Set; > import java.text.AttributedCharacterIterator; > import java.util.Map; > public class test { > public static void main (String[] args) { > // RI throws IAE while Harmony throws ArrayIndexOutOfBoundsException if > textStart <0 > try { > new Bidi(new char[] { 't','t','t'},-1,new byte[] { 2, 2 },1,1,1); > } catch (Exception e) { > e.printStackTrace(); > } > // RI throws IAE while Harmony throws nothing if embStart <0 > try { > new Bidi(new char[] { 't','t','t'}, 1, new byte[] { 2, 2 }, -1,1,1 > ); > } catch (Exception e) { > e.printStackTrace(); > } > // RI throws IAE while Harmony throws NegativeArraySizeException if > paragraphLength <0 > try { > new Bidi(new char[] { 't','t','t'}, 1, new byte[] { 2, 2 }, 1,-1,1 > ); > } catch (Exception e) { > e.printStackTrace(); > } > // RI throws IAE while Harmony throws OutOfMemoryError if > paragraphLength= Integer.MAX_VALUE > try { > new Bidi(new char[] {}, 5, new byte[] { 2, 2,2,2,2,2 }, > 8,Integer.MAX_VALUE,5 ); > } catch (Exception e) { > e.printStackTrace(); > } > // RI throws nothing while Harmony throws NPE if embStart= flags and > paragraphLength=0. > try { > new Bidi(new char[] {'o'}, 0, new byte[] { 2, 2}, 2, 0, 2 ); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > Output > ----------------------------------------------------------------jrockit-jdk1.5.0_03 > java.lang.IllegalArgumentException: bad range: -1 length: 2 for text of length: 3 > at java.text.Bidi.(Bidi.java:218) > at bug9287.main(bug9287.java:13) > java.lang.IllegalArgumentException: bad range: -1 length: 2 for embeddings of length: 3 > at java.text.Bidi.(Bidi.java:223) > at bug9287.main(bug9287.java:19) > java.lang.IllegalArgumentException: bad length: -1 > at java.text.Bidi.(Bidi.java:215) > at bug9287.main(bug9287.java:26) > java.lang.IllegalArgumentException: bad range: 5 length: 2147483647 for text of length: 0 > at java.text.Bidi.(Bidi.java:218) > at bug9287.main(bug9287.java:34) > ----------------------------------------------------------------Harmony > java.lang.ArrayIndexOutOfBoundsException: bad arrayCopy > at java.lang.VMMemoryManager.arrayCopy() > at java.lang.System.arraycopy() > at java.text.Bidi.createUBiDi(Bidi.java:183) > at java.text.Bidi.(Bidi.java:144) > at bug9287.main(bug9287.java:13) > java.lang.NegativeArraySizeException > at java.text.Bidi.createUBiDi(Bidi.java:182) > at java.text.Bidi.(Bidi.java:144) > at bug9287.main(bug9287.java:26) > java.lang.OutOfMemoryError: VM doesn't support arrays of the requested size > at java.text.Bidi.createUBiDi(Bidi.java:182) > at java.text.Bidi.(Bidi.java:144) > java.lang.NullPointerException: bad arrayCopy > at java.lang.VMMemoryManager.arrayCopy() > at java.lang.System.arraycopy() > at java.text.Bidi.createUBiDi(Bidi.java:193) > at java.text.Bidi.(Bidi.java:144) > at bug9287.main(bug9287.java:40) > at bug9287.main(bug9287.java:34) -- 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