harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r504609 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/undo/UndoManager.java test/api/java/common/javax/swing/undo/UndoManagerTest.java
Date Wed, 07 Feb 2007 16:36:25 GMT
Author: ayza
Date: Wed Feb  7 08:36:25 2007
New Revision: 504609

URL: http://svn.apache.org/viewvc?view=rev&rev=504609
Log:
Applying patch from HARMONY-2538 ([classlib][swing] javax.swing.undo.UndoManager.setLimit(int)
throws unspecified ArrayIndexOutOfBoundsException)

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/undo/UndoManager.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/UndoManagerTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/undo/UndoManager.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/undo/UndoManager.java?view=diff&rev=504609&r1=504608&r2=504609
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/undo/UndoManager.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/undo/UndoManager.java
Wed Feb  7 08:36:25 2007
@@ -242,7 +242,7 @@
 
     protected void trimForLimit() {
         // check that we need to trim
-        if (limit < edits.size()) {
+        if ((limit > 0) && (getLimit() < edits.size())) {
             // indexOfNextAdd is a center for trimming
             int beginning = indexOfNextAdd - limit / 2;
             if (beginning < 0) {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/UndoManagerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/UndoManagerTest.java?view=diff&rev=504609&r1=504608&r2=504609
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/UndoManagerTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/UndoManagerTest.java
Wed Feb  7 08:36:25 2007
@@ -431,6 +431,8 @@
                 assertTrue(edits[i].isDieCalled());
             }
         }
+        //Regression test for H2538
+        um.setLimit(-5);
     }
 
     public void testTrimEdits() {



Mime
View raw message