Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 51362 invoked from network); 1 Feb 2007 18:19:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Feb 2007 18:19:31 -0000 Received: (qmail 14750 invoked by uid 500); 1 Feb 2007 18:19:35 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 14688 invoked by uid 500); 1 Feb 2007 18:19:35 -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 14508 invoked by uid 99); 1 Feb 2007 18:19:34 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Feb 2007 10:19:34 -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, 01 Feb 2007 10:19:26 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 1D6DC7142E4 for ; Thu, 1 Feb 2007 10:19:06 -0800 (PST) Message-ID: <20952402.1170353946118.JavaMail.jira@brutus> Date: Thu, 1 Feb 2007 10:19:06 -0800 (PST) From: "Vasily Zakharov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-3112) [classlib][swing] j.s.undo.UndoManager.undoTo() and redoTo() throw CannotUndoException/CannotRedoException instead of ArrayIndexOutOfBoundsException In-Reply-To: <18997253.1170353526160.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 [ https://issues.apache.org/jira/browse/HARMONY-3112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12469534 ] Vasily Zakharov commented on HARMONY-3112: ------------------------------------------ Here's a test reproducing the issue: import javax.swing.undo.AbstractUndoableEdit; import javax.swing.undo.CannotRedoException; import javax.swing.undo.CannotUndoException; import javax.swing.undo.UndoManager; import javax.swing.undo.UndoableEdit; public class Test { public static void main(String[] args) { UM um = new UM(); um.addEdit(new AbstractUndoableEdit()); try { um.undoTo(null); } catch (CannotUndoException e) { System.out.println("CannotUndoException caught at undoTo(null)"); } catch (ArrayIndexOutOfBoundsException e) { System.out.println("ArrayIndexOutOfBoundsException caught at undoTo(null)"); } try { um.redoTo(null); } catch (CannotRedoException e) { System.out.println("CannotRedoException caught at redoTo(null)"); } catch (ArrayIndexOutOfBoundsException e) { System.out.println("ArrayIndexOutOfBoundsException caught at redoTo(null)"); } } private static class UM extends UndoManager { @Override public void redoTo(UndoableEdit edit) { super.redoTo(edit); } @Override public void undoTo(UndoableEdit edit) { super.undoTo(edit); } } } Output on RI: ArrayIndexOutOfBoundsException caught at undoTo(null) ArrayIndexOutOfBoundsException caught at redoTo(null) Output on Harmony: CannotUndoException caught at undoTo(null) CannotRedoException caught at redoTo(null) > [classlib][swing] j.s.undo.UndoManager.undoTo() and redoTo() throw CannotUndoException/CannotRedoException instead of ArrayIndexOutOfBoundsException > ---------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-3112 > URL: https://issues.apache.org/jira/browse/HARMONY-3112 > Project: Harmony > Issue Type: Bug > Components: Non-bug differences from RI > Reporter: Vasily Zakharov > Priority: Minor > > javax.swing.undo.UndoManager.undoTo(edit) and redoTo(edit) methods throw CannotUndoException or CannotRedoException correspondingly when the specified edit is not found. > RI throws ArrayIndexOutOfBoundsException in these situations. > Harmony implementation reaction looks more appropriate and adequate to the specification, so considering this a non-bug difference. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.