On Tue, 2006-06-13 at 12:16 -0600, Tom Tromey wrote:
> >>>>> "Lillian" == Lillian Angel <[EMAIL PROTECTED]> writes:
> 
> Lillian> The JDK doesnt care if the ImageProducer is null when passed to the
> Lillian> constructor.
> 
> Lillian> -    if (ip == null)
> Lillian> -      throw new NullPointerException("The ImageProducer must not be 
> null.");
> 
> In cases like this it is nice to have a comment, either in the
> javadoc or in the code, explaining what happens when ip==null.
> That way nobody will be tempted to add the check back in later.
> 

Good idea.

2006-06-13  Lillian Angel  <[EMAIL PROTECTED]>

        * java/awt/image/PixelGrabber.java
        (PixelGrabber): Added to API documentation.




> Tom
Index: java/awt/image/PixelGrabber.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/image/PixelGrabber.java,v
retrieving revision 1.15
diff -u -r1.15 PixelGrabber.java
--- java/awt/image/PixelGrabber.java	18 Aug 2005 13:45:44 -0000	1.15
+++ java/awt/image/PixelGrabber.java	13 Jun 2006 14:14:59 -0000
@@ -131,9 +131,6 @@
   public PixelGrabber(ImageProducer ip, int x, int y, int w, int h,
 		      int pix[], int off, int scansize)
   {
-    if (ip == null)
-      throw new NullPointerException("The ImageProducer must not be null.");
-
     this.ip = ip;
     this.x = x;
     this.y = y;
@@ -222,7 +219,6 @@
                 }
               catch (Exception ex)
                 {
-                  ex.printStackTrace();
                   imageComplete(ImageConsumer.IMAGEABORTED);
                 }
 	    }

Reply via email to