harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r495920 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/JComponent.java test/api/java/common/javax/swing/JComponentTest.java
Date Sat, 13 Jan 2007 16:43:24 GMT
Author: hindessm
Date: Sat Jan 13 08:43:23 2007
New Revision: 495920

URL: http://svn.apache.org/viewvc?view=rev&rev=495920
Log:
Applying patch from "[#HARMONY-2576] [classlib][swing]
javax.swing.JComponent.paintImmediately(null) does not throw unspecified
NPE".

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JComponentTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java?view=diff&rev=495920&r1=495919&r2=495920
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java
Sat Jan 13 08:43:23 2007
@@ -1008,6 +1008,10 @@
     }
 
     public void paintImmediately(Rectangle rect) {
+        if (rect == null) {
+            throw new NullPointerException();
+        }
+ 
         if (!isShowing()) {
             return;
         }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JComponentTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JComponentTest.java?view=diff&rev=495920&r1=495919&r2=495920
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JComponentTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JComponentTest.java
Sat Jan 13 08:43:23 2007
@@ -2352,7 +2352,12 @@
      * Class under test for void paintImmediately(Rectangle)
      */
     public void testPaintImmediatelyRectangle() {
-        // TODO
+        try {    
+            new JComponent(){}.paintImmediately(null);    
+            fail("NPE should be thrown"); 
+        } catch (NullPointerException npe) {      
+            // PASSED            
+        }
     }
 
     /*



Mime
View raw message