harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r496040 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/plaf/basic/BasicSplitPaneUI.java test/api/java/common/javax/swing/plaf/basic/BasicSplitPaneUITest.java
Date Sun, 14 Jan 2007 09:05:17 GMT
Author: hindessm
Date: Sun Jan 14 01:05:17 2007
New Revision: 496040

URL: http://svn.apache.org/viewvc?view=rev&rev=496040
Log:
Applying patches from "[#HARMONY-2661] [classlib][swing][plaf]
javax.swing.plaf.basic.BasicSplitPaneUI.getDividerLocation(null) doesn't
throw unspecified NPE".  I've not applied the patch to remove the test from
the windows exclude list because I don't have a windows machine handy and I
still get two failures on Linux.

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSplitPaneUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSplitPaneUI.java?view=diff&rev=496040&r1=496039&r2=496040
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSplitPaneUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSplitPaneUI.java
Sun Jan 14 01:05:17 2007
@@ -714,6 +714,9 @@
     }
 
     public int getDividerLocation(final JSplitPane jc) {
+        if (jc == null) { // Fix for HARMONY-2661, for compatibility with RI
+            throw new NullPointerException("jc is null");
+        }
         return dividerLocation;
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicSplitPaneUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicSplitPaneUITest.java?view=diff&rev=496040&r1=496039&r2=496040
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicSplitPaneUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicSplitPaneUITest.java
Sun Jan 14 01:05:17 2007
@@ -290,6 +290,15 @@
         assertEquals(20, ui.getDividerLocation(splitPane));
     }
 
+    public void testGetDividerLocation() throws Exception {
+        try { // Regression test for HARMONY-2661
+            ui.getDividerLocation(null);
+            fail("NullPointerException should have been thrown");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+    }
+
     public void testInitialLocation() throws Exception {
         splitPane.setSize(1000, 2000);
         splitPane.setBorder(BorderFactory.createEmptyBorder(5, 10, 15, 20));



Mime
View raw message