harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r495984 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/plaf/basic/BasicSeparatorUI.java test/api/java/common/javax/swing/plaf/basic/BasicSeparatorUITest.java
Date Sat, 13 Jan 2007 22:27:03 GMT
Author: hindessm
Date: Sat Jan 13 14:27:03 2007
New Revision: 495984

URL: http://svn.apache.org/viewvc?view=rev&rev=495984
Log:
Applying patch from "[#HARMONY-2636] [classlib][swing]
javax.swing.plaf.basic.BasicSeparatorUI.uninstallDefaults(JSeparator s)
throws NPE while RI doesn't".  I made the small correction mentioned in the
JIRA comment.  Next time please test your test!

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSeparatorUI.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicSeparatorUITest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSeparatorUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSeparatorUI.java?view=diff&rev=495984&r1=495983&r2=495984
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSeparatorUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSeparatorUI.java
Sat Jan 13 14:27:03 2007
@@ -61,6 +61,9 @@
     }
 
     protected void uninstallDefaults(final JSeparator s) {
+        if (s == null) {
+            return;
+        }
         Utilities.uninstallColorsAndFont(s);
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicSeparatorUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicSeparatorUITest.java?view=diff&rev=495984&r1=495983&r2=495984
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicSeparatorUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicSeparatorUITest.java
Sat Jan 13 14:27:03 2007
@@ -92,4 +92,22 @@
      */
     public void testInstallUninstallListeners() {
     }
+    
+    /**
+     * Auxiliary class for testUninstallDefaults()
+     * */
+    class BasicSeparatorUIForTest extends BasicSeparatorUI
+    {
+        public void uninstallDefaults(JSeparator s){
+            super.uninstallDefaults(s);
+        }
+    }
+
+    /**
+     * Regression test for HARMONY-2636
+     * */
+    public void testUninstallDefaults() throws NullPointerException {
+        BasicSeparatorUIForTest localBasicSeparatorUI = new BasicSeparatorUIForTest();
+        localBasicSeparatorUI.uninstallDefaults(null);
+    }
 }



Mime
View raw message