This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: image loading fixes


On Wed, 2003-11-12 at 03:12, Sascha Brawer wrote:
> Hi Tom,
> 
> Thomas Fitzsimmons <fitzsim@redhat.com> wrote on Tue, 11 Nov
> 2003 16:33:30 -0500:
> 
> >[patch to java/awt/Component.java]
> 
>     public boolean prepareImage(Image image, ImageObserver observer)
>     {
> +    if (image == null)
> +      throw new NullPointerException ();
> +
>      return prepareImage(image, image.getWidth(observer),
>                          image.getHeight(observer), observer);
>     }
> 
> Actually, the test for image == null is not needed.
> 

Yes, I know an NPE will be thrown either way.  I just thought it better
to be explicit.  But the other methods in Component don't follow this
policy so I'll remove the check.

Thanks,
Tom



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]