harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r495923 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/Box.java test/api/java/common/javax/swing/BoxTest.java
Date Sat, 13 Jan 2007 16:53:24 GMT
Author: hindessm
Date: Sat Jan 13 08:53:23 2007
New Revision: 495923

URL: http://svn.apache.org/viewvc?view=rev&rev=495923
Log:
Applying patch from "[#HARMONY-2578] [classlib][swing]
javax.swing.Box.createRigidArea(null) throws 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/Box.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/BoxTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/Box.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/Box.java?view=diff&rev=495923&r1=495922&r2=495923
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/Box.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/Box.java
Sat Jan 13 08:53:23 2007
@@ -121,6 +121,8 @@
     }
 
     public static Component createRigidArea(Dimension size) {
+        size = (size == null ? new Dimension(0, 0) : size);
+        
         return new Filler(new Dimension(size), new Dimension(size), new Dimension(size));
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/BoxTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/BoxTest.java?view=diff&rev=495923&r1=495922&r2=495923
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/BoxTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/BoxTest.java
Sat Jan 13 08:53:23 2007
@@ -53,13 +53,15 @@
         assertTrue("Exception is thrown ", thrown);
     }
 
-    public void testCreateRigidArea() {
+    public void testCreateRigidArea() throws NullPointerException {
         Dimension size = new Dimension(100, 100);
         Component box = Box.createRigidArea(size);
         assertEquals("Minimum size initialized ", size, box.getMinimumSize());
         assertEquals("Preferred size initialized ", size, box.getPreferredSize());
         assertEquals("Maximum size initialized ", size, box.getMaximumSize());
         assertFalse("Opaqueness initialized ", box.isOpaque());
+
+        Box.createRigidArea(null);             
     }
 
     public void testCreateVerticalBox() {



Mime
View raw message