classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] Complete javax.imageio


From: Andreas Tobler
Subject: Re: [cp-patches] Complete javax.imageio
Date: Mon, 03 Oct 2005 16:12:37 +0200
User-agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711)

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()
  {
    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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]