harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r496710 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/ScrollPaneLayout.java test/api/java/common/javax/swing/ScrollPaneLayoutTest.java
Date Tue, 16 Jan 2007 14:43:19 GMT
Author: hindessm
Date: Tue Jan 16 06:43:18 2007
New Revision: 496710

URL: http://svn.apache.org/viewvc?view=rev&rev=496710
Log:
Applying patches from "[#HARMONY-1735] [classlib][swing]
javax.swing.ScrollPaneLayout.preferredLayoutSize(Component c) does not
throw NPE".

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/ScrollPaneLayout.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/ScrollPaneLayout.java?view=diff&rev=496710&r1=496709&r2=496710
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/ScrollPaneLayout.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/ScrollPaneLayout.java
Tue Jan 16 06:43:18 2007
@@ -170,9 +170,6 @@
     public Dimension preferredLayoutSize(final Container parent) {
         JScrollPane pane = (JScrollPane)parent;
 
-        if (pane == null) {
-            return new Dimension(0, 0);
-        }
         int rowHeadWidth = (rowHead == null) ? 0 : rowHead.getPreferredSize().width;
         int viewportWidth = (viewport == null) ? 0 : viewport.getPreferredSize().width;
         int viewportBorderLeft = (pane.getViewportBorder() == null) ? 0 : pane.getViewportBorder().getBorderInsets(pane).left;

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ScrollPaneLayoutTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ScrollPaneLayoutTest.java?view=diff&rev=496710&r1=496709&r2=496710
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ScrollPaneLayoutTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ScrollPaneLayoutTest.java
Tue Jan 16 06:43:18 2007
@@ -68,7 +68,14 @@
             fail("Class cast exception shall be thrown");
         } catch (ClassCastException e) {
         }
-    }
+        //regression for HARMONY-1735
+        try {
+        	layout.preferredLayoutSize(null);
+        	fail("No expected exception");
+        }catch (NullPointerException e) {
+        //expected
+        }
+      }
 
     public void testDefaultLayout() throws Exception {
         ScrollPaneLayout l = new ScrollPaneLayout();



Mime
View raw message