This patch fixes a null pointer exception when I try to launch Findbugs. I've also backed this change up with some new Mauve tests:

2005-11-17  David Gilbert  <[EMAIL PROTECTED]>

        * javax/swing/JComponent.java
        (setPreferredSize): Check for null argument before making a copy.

Regards,

Dave
Index: javax/swing/JComponent.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JComponent.java,v
retrieving revision 1.88
diff -u -r1.88 JComponent.java
--- javax/swing/JComponent.java 17 Nov 2005 23:54:10 -0000      1.88
+++ javax/swing/JComponent.java 18 Nov 2005 00:24:24 -0000
@@ -2564,7 +2564,10 @@
   public void setPreferredSize(Dimension pref)
   {
     Dimension oldPreferredSize = preferredSize;
-    preferredSize = new Dimension(pref);
+    if (pref != null)
+      preferredSize = new Dimension(pref);
+    else
+      preferredSize = null;
     firePropertyChange("preferredSize", oldPreferredSize, preferredSize);
   }
 
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to