harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r518917 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/plaf/basic/BasicInternalFrameUI.java test/api/java/common/javax/swing/plaf/basic/BasicInternalFrameUITest.java
Date Fri, 16 Mar 2007 10:17:27 GMT
Author: apetrenko
Date: Fri Mar 16 03:17:26 2007
New Revision: 518917

URL: http://svn.apache.org/viewvc?view=rev&rev=518917
Log:
Patch for HARMONY-2709 "[classlib][swing] javax.swing.plaf.basic.BasicInternalFrameUI.setupMenuOpenKey()
throws unspecified IllegalArgumentException"

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicInternalFrameUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicInternalFrameUI.java?view=diff&rev=518917&r1=518916&r2=518917
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicInternalFrameUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicInternalFrameUI.java
Fri Mar 16 03:17:26 2007
@@ -694,11 +694,15 @@
     }
 
     protected void setupMenuOpenKey() {
+        if (frame == null) {
+            throw new NullPointerException();
+        }
+
         Object[] keys = (Object[])UIManager.get("InternalFrame.windowBindings");
         if (keys == null) {
             return;
         }
-
+        
         InputMap map = LookAndFeel.makeComponentInputMap(frame, keys);
         SwingUtilities.replaceUIInputMap(
                 frame, JComponent.WHEN_IN_FOCUSED_WINDOW, map);

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicInternalFrameUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicInternalFrameUITest.java?view=diff&rev=518917&r1=518916&r2=518917
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicInternalFrameUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicInternalFrameUITest.java
Fri Mar 16 03:17:26 2007
@@ -281,6 +281,14 @@
                 JComponent.WHEN_IN_FOCUSED_WINDOW);
         assertNotNull("inputMap installed", uiInputMap);
         assertEquals(1, uiInputMap.allKeys().length);
+        
+        // Regression test for HARMONY-2709
+        try {
+            new BasicInternalFrameUI(null).setupMenuOpenKey();
+            fail("NPE expected");
+        } catch (NullPointerException npe) {
+            // PASSED
+        } 
     }
 
     /*



Mime
View raw message