harmony-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?view=rev&rev=495992
Log:
Applying patch from "[#HARMONY-2654] [classlib][swing]
javax.swing.plaf.basic.BasicPopupMenuUI.installKeyboardActions() throws
unspecified NPE".  I fixed the stack overflow caused by the missing
"super." in the test.  Please test your tests!

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicPopupMenuUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicPopupMenuUI.java?view=diff&rev=495992&r1=495991&r2=495992
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicPopupMenuUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicPopupMenuUI.java
Sat Jan 13 14:51:03 2007
@@ -56,6 +56,9 @@
     }
 
     protected void installKeyboardActions() {
+        if (popupMenu == null) {
+            return;
+        }
         Utilities.installKeyboardActions(popupMenu, JComponent.WHEN_FOCUSED,
                                          PROPERTY_PREFIX + ".selectedWindowInputMapBindings",
                                          PROPERTY_PREFIX + ".selectedWindowInputMapBindings.RightToLeft");

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPopupMenuUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPopupMenuUITest.java?view=diff&rev=495992&r1=495991&r2=495992
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPopupMenuUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPopupMenuUITest.java
Sat Jan 13 14:51:03 2007
@@ -176,4 +176,19 @@
             assertEquals(0, menu.getPopupMenuListeners().length);
         }
     }
+    
+    /**
+     * Regression test for HARMONY-2654 
+     * */
+    public void testInstallKeyboardActions() throws NullPointerException { 
+        BasicPopupMenuUIForTest localBasicPopupMenuUI = new BasicPopupMenuUIForTest(); 
+        localBasicPopupMenuUI.installKeyboardActions(); 
+    } 
+
+
+    class BasicPopupMenuUIForTest extends BasicPopupMenuUI { 
+        public void installKeyboardActions () { 
+            super.installKeyboardActions(); 
+        } 
+    }
 }



Mime
View raw message