[cp-patches] FYI: IconUIResource fixlet

David Gilbert david.gilbert at object-refinery.com
Mon Jun 19 09:46:12 UTC 2006


This patch (committed) fixes a trivial bug in the IconUIResource constructor:

2006-06-19  David Gilbert  <david.gilbert at object-refinery.com>

	* javax/swing/plaf/IconUIResource.java
	(IconUIResource): Throw IllegalArgumentException for null icon.

Regards,

Dave
-------------- next part --------------
Index: javax/swing/plaf/IconUIResource.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/plaf/IconUIResource.java,v
retrieving revision 1.8
diff -u -r1.8 IconUIResource.java
--- javax/swing/plaf/IconUIResource.java	19 Oct 2005 14:20:10 -0000	1.8
+++ javax/swing/plaf/IconUIResource.java	19 Jun 2006 09:40:16 -0000
@@ -1,5 +1,5 @@
 /* IconUIResource.java --
-   Copyright (C) 2002, 2003, 2004  Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2006,  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -63,7 +63,8 @@
 
 
   /**
-   * The icon that is wrapped by this <code>IconUIResource</code>.
+   * The icon that is wrapped by this <code>IconUIResource</code> (never 
+   * <code>null</code>).
    */
   private Icon delegate;
 
@@ -73,10 +74,12 @@
    * icon. All messages are forwarded to the delegate icon.
    *
    * @param delegate the icon that is wrapped by this
-   *        <code>IconUIResource</code>.
+   *        <code>IconUIResource</code> (<code>null</code> not permitted).
    */
   public IconUIResource(Icon delegate)
   {
+    if (delegate == null)
+      throw new IllegalArgumentException("Null 'delegate' argument.");
     this.delegate = delegate;
   }
 


More information about the Classpath-patches mailing list