harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r494117 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/JLayeredPane.java test/api/java/common/javax/swing/JLayeredPaneTest.java
Date Mon, 08 Jan 2007 16:48:35 GMT
Author: odeakin
Date: Mon Jan  8 08:48:32 2007
New Revision: 494117

URL: http://svn.apache.org/viewvc?view=rev&rev=494117
Log:
Apply patch HARMONY-2279 ([classlib][swing] javax.swing.JLayeredPane.moveToBack(Component
c) doesn't throw NPE if parameter c == null)

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JLayeredPane.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JLayeredPane.java?view=diff&rev=494117&r1=494116&r2=494117
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JLayeredPane.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JLayeredPane.java
Mon Jan  8 08:48:32 2007
@@ -306,9 +306,6 @@
      * @return layer of component c
      */
     public int getLayer(final Component c) {
-        if (c == null) {
-            return -1;
-        }
         Object layer = getComponentToLayer().get(c);
         if (layer != null) {
             return ((Integer) layer).intValue();

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JLayeredPaneTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JLayeredPaneTest.java?view=diff&rev=494117&r1=494116&r2=494117
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JLayeredPaneTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JLayeredPaneTest.java
Mon Jan  8 08:48:32 2007
@@ -324,6 +324,12 @@
         // moveToBack() does nothing if the component is not from the containter
         layered.moveToBack(new JPanel());
         assertEquals(6, layered.getComponentCount());
+        try { // Regression test for HARMONY-2279
+            layered.moveToBack(null);
+            fail("NullPointerException should have been thrown");
+        } catch (NullPointerException e) {
+            // Expected
+        }
     }
 
     /*



Mime
View raw message