harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r496041 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/plaf/basic/BasicDesktopIconUI.java test/api/java/common/javax/swing/plaf/basic/BasicDesktopIconUITest.java
Date Sun, 14 Jan 2007 09:08:59 GMT
Author: hindessm
Date: Sun Jan 14 01:08:58 2007
New Revision: 496041

URL: http://svn.apache.org/viewvc?view=rev&rev=496041
Log:
Applying patches from "[#HARMONY-2664] [classlib][swing]
javax.swing.plaf.basic.BasicDesktopIconUI.getInsets(null) returns valid
result while RI throws NPE".

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicDesktopIconUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicDesktopIconUI.java?view=diff&rev=496041&r1=496040&r2=496041
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicDesktopIconUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicDesktopIconUI.java
Sun Jan 14 01:08:58 2007
@@ -127,7 +127,10 @@
     }
 
     public Insets getInsets(final JComponent c) {
-//        return desktopIcon.getInsets();
+        if (c == null) {
+            throw new NullPointerException("component is null");
+        }
+        //return desktopIcon.getInsets();
         return new Insets(INSETS_WIDTH, INSETS_WIDTH,
                 INSETS_WIDTH, INSETS_WIDTH);
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicDesktopIconUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicDesktopIconUITest.java?view=diff&rev=496041&r1=496040&r2=496041
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicDesktopIconUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicDesktopIconUITest.java
Sun Jan 14 01:08:58 2007
@@ -128,6 +128,12 @@
         Insets insets = ui.getInsets(icon);
         assertTrue("not null", insets != null);
         assertEquals("ok", validInsets, insets);
+        try { //Regression test for HARMONY-2664
+            ui.getInsets(null);
+            fail("NullPointerException should have been thrown");
+        } catch (NullPointerException e) {
+            // Expected
+        }
     }
 
     /*



Mime
View raw message