harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r496057 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/LookAndFeel.java test/api/java/common/javax/swing/LookAndFeelTest.java
Date Sun, 14 Jan 2007 10:18:10 GMT
Author: hindessm
Date: Sun Jan 14 02:18:08 2007
New Revision: 496057

URL: http://svn.apache.org/viewvc?view=rev&rev=496057
Log:
Applying patches from "[#HARMONY-2706] [classlib][swing]
javax.swing.plaf.basic.BasicMenuBarUI.uninstallDefaults() throws
unspecified NPE".  I modified the test slightly to let junit handle the
exceptions.

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/LookAndFeel.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/LookAndFeel.java?view=diff&rev=496057&r1=496056&r2=496057
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/LookAndFeel.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/LookAndFeel.java
Sun Jan 14 02:18:08 2007
@@ -157,7 +157,7 @@
     }
 
     public static void uninstallBorder(final JComponent comp) {
-        if (Utilities.isUIResource(comp.getBorder())) {
+        if (comp != null && Utilities.isUIResource(comp.getBorder())) {
             comp.setBorder(null);
         }
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/LookAndFeelTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/LookAndFeelTest.java?view=diff&rev=496057&r1=496056&r2=496057
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/LookAndFeelTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/LookAndFeelTest.java
Sun Jan 14 02:18:08 2007
@@ -156,7 +156,7 @@
         assertEquals(UIManager.get("CheckBox.font"), label.getFont());
     }
 
-    public void testInstallUninstallBorder() {
+    public void testInstallUninstallBorder() throws NullPointerException {
         lf = new MetalLookAndFeel();
         JPanel p = new JPanel();
         UIDefaults defaults = lf.getDefaults();
@@ -170,6 +170,16 @@
         assertEquals(UIManager.get("Menu.border"), p.getBorder());
         LookAndFeel.uninstallBorder(p);
         assertNull(p.getBorder());
+
+        BasicMenuBarUIExt m = 
+            new BasicMenuBarUIExt();
+        m.uninstallDefaults(); 
+    }
+
+    class BasicMenuBarUIExt extends javax.swing.plaf.basic.BasicMenuBarUI {
+        public void uninstallDefaults() {
+            super.uninstallDefaults();
+        }
     }
 
     public void testLoadKeyBindings() {



Mime
View raw message