harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r496756 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/text/DefaultCaret.java test/api/java/common/javax/swing/text/DefaultCaretTest.java
Date Tue, 16 Jan 2007 16:46:07 GMT
Author: hindessm
Date: Tue Jan 16 08:46:06 2007
New Revision: 496756

URL: http://svn.apache.org/viewvc?view=rev&rev=496756
Log:
Applying patches from "[#HARMONY-1795] 
[classlib][swing]javax.swing.text.DefaultCaret.setBlinkRate(int rate) does
not throw unspecified IAE if rate<0".

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultCaret.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/DefaultCaretTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultCaret.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultCaret.java?view=diff&rev=496756&r1=496755&r2=496756
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultCaret.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultCaret.java
Tue Jan 16 08:46:06 2007
@@ -989,6 +989,9 @@
      *
      */
     public void setBlinkRate(final int i) {
+        if (i < 0) {
+            throw new IllegalArgumentException("Invalid delay: " + i);
+        }
         blinkRate = i;
         stopTimer(blinkTimer);
         if (blinkRate > 0) {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/DefaultCaretTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/DefaultCaretTest.java?view=diff&rev=496756&r1=496755&r2=496756
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/DefaultCaretTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/DefaultCaretTest.java
Tue Jan 16 08:46:06 2007
@@ -333,6 +333,13 @@
         assertEquals(0, dc.getBlinkRate());
         dc.setBlinkRate(100);
         assertEquals(100, dc.getBlinkRate());
+
+        try { // Regression test for HARMONY-1795
+            dc.setBlinkRate(-1);
+            fail("IllegalArgumentException should have been thrown");
+        } catch (IllegalArgumentException e) {
+            // Expected
+        }
     }
 
     public void testSetDot() throws Exception {



Mime
View raw message