On Mon, 2005-10-03 at 16:12 +0200, Andreas Tobler wrote:
> Hi Tom,
> 
> hopefully you can enlight a java newbie :)
> 
> In javax/imageio/ImageReader.java you change the following for example
> 
> protected List progressListeners = new ArrayList();
> 
> to
> 
> protected List progressListeners = null;
> 
> The java doc says:
> 
> progressListeners:
> 
> A List of currently registered IIOReadProgressListeners, initialized by 
> default to null, which is synonymous with an empty List.
> 
> My problem is here:
> 
> protected void processImageComplete()
>    {

We should just wrap a != null check around listener code.

Tom

>      Iterator it = progressListeners.iterator();
> 
> in the same file.
> 
> I get an NPE on this since progressListeners is initialized to null, not 
> to an empty List, to null.
> 
> This prevents me to run the swing Demo in 2D mode.
> 
> I changed the above initializer to:
> 
> protected List progressListeners = new ArrayList(0);
> 
> now i can run the demo fine again.
> 
> So, am I missing an initialization of this progressListeners elsewhere? 
> Or is the initializing to null wrong?
> 
> Thanks,
> Andreas
> 
> 



_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to