harmony-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?view=rev&rev=495985
Log:
Applying patch from "[#HARMONY-2637] [classlib][swing]
javax.swing.plaf.basic.BasicLabelUI.uninstallDefaults(JLabel label) throws
NPE while RI doesn't".	I modified the test slightly to let junit handle
the exceptions.

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicLabelUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicLabelUI.java?view=diff&rev=495985&r1=495984&r2=495985
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicLabelUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicLabelUI.java
Sat Jan 13 14:30:42 2007
@@ -151,6 +151,9 @@
     }
 
     protected void uninstallDefaults(final JLabel label) {
+        if (label == null) {
+            return;
+        }
         Utilities.uninstallColorsAndFont(label);
         LookAndFeel.uninstallBorder(label);
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicLabelUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicLabelUITest.java?view=diff&rev=495985&r1=495984&r2=495985
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicLabelUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicLabelUITest.java
Sat Jan 13 14:30:42 2007
@@ -102,4 +102,22 @@
         ui.installComponents(label);
         assertEquals(0, label.getComponentCount());
     }
+    
+    private class BasicLabelUIForTest extends BasicLabelUI { 
+        public BasicLabelUIForTest(){ 
+            super(); 
+        } 
+
+        public void uninstallDefaults(JLabel l) { 
+            super.uninstallDefaults(l); 
+        } 
+    } 
+    
+    /**
+     * Regression test for HARMONY-2637
+     * */
+    public void testUninstallDefaults() throws NullPointerException { 
+       BasicLabelUIForTest bu = new BasicLabelUIForTest(); 
+       bu.uninstallDefaults(null); 
+    } 
 }



Mime
View raw message