[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Patch: image loading fixes
From: |
Ricky Clarkson |
Subject: |
Re: Patch: image loading fixes |
Date: |
Wed, 12 Nov 2003 18:34:25 +0000 |
User-agent: |
Mutt/1.5.4i |
Surely the exception to throw here would be IllegalArgumentException
anyway, as null would be an illegal input to the method.
Ricky.
> > >[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.
--
Phasers locked on target, Captain.