classpath-patches
[Top][All Lists]
Advanced

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

[cp-patches] Re: imageio/ImageReader|Writer check *Listeners


From: Thomas Fitzsimmons
Subject: [cp-patches] Re: imageio/ImageReader|Writer check *Listeners
Date: Mon, 03 Oct 2005 20:39:26 -0400

On Mon, 2005-10-03 at 22:35 +0200, Andreas Tobler wrote:
> Hello Tom,
> 
> as spoken about on irc.
> 
> Is this what you had in mind?
> 
> I can run 2D swing Demo again.
> 
> Andreas
> 
> 
> 2005-10-03  Andreas Tobler  <address@hidden>
> 
>       * javax/imageio/ImageWriter.java (availableLocales, locale,
>       originatingProvider, output, progressListeners, warningListeners,
>       warningLocales): Initialize.
>       (addIIOWriteProgressListener): Check progressListeners against null
>       to avoid NPE.
>       (addIIOWriteWarningListener): Likewise for warningListeners.
>       (processImageComplete): Likewise for progressListeners.
>       (processImageProgress): Likewise.
>       (processImageStarted): Likewise.
>       (processThumbnailComplete): Likewise.
>       (processThumbnailProgress): Likewise.
>       (processThumbnailStarted): Likewise.
>       (processWarningOccurred): Likewise for warningListeners.
>       (processWriteAborted): Likewise for progressListeners.
>       (removeAllIIOWriteProgressListeners): Likewise.
>       (removeAllIIOWriteWarningListeners): Likewise.
>       (removeIIOWriteProgressListener): Likewise.
>       (removeIIOWriteWarningListener): Likewise for warningListeners.
> 
>       * javax/imageio/ImageReader.java (addIIOReadProgressListener): Check
>       progressListeners against null to avoid NPE.
>       (addIIOReadUpdateListener): Likewise for updateListeners.
>       (addIIOReadWarningListener): Likewise for warningListeners.
>       (processImageComplete):  Likewise for progressListeners.
>       (processImageProgress): Likewise.
>       (processImageStarted): Likewise.
>       (processImageUpdate): Likewise for updateListeners.
>       (processPassComplete): Likewise.
>       (processPassStarted): Likewise.
>       (processReadAborted): Likewise for progressListeners.
>       (processSequenceComplete): Likewise.
>       (processSequenceStarted): Likewise.
>       (processThumbnailComplete): Likewise.
>       (processThumbnailPassComplete): Likewise for updateListeners.
>       (processThumbnailPassStarted): Likewise.
>       (processThumbnailProgress): Likewise for progressListeners.
>       (processThumbnailStarted): Likewise.
>       (processThumbnailUpdate): Likewise for updateListeners.
>       (processWarningOccurred): Likewise for warningListeners.
>       (removeIIOReadProgressListener): Likewise for progressListeners.
>       (removeIIOReadUpdateListener): Likewise for updateListeners.
>       (removeIIOReadWarningListener): Likewise for warningListeners.
> plain text document attachment (cp-imageio-rw.diff)
> Index: javax/imageio/ImageReader.java
> ===================================================================
> RCS file: /cvsroot/classpath/classpath/javax/imageio/ImageReader.java,v
> retrieving revision 1.6
> diff -u -r1.6 ImageReader.java
> --- javax/imageio/ImageReader.java    2 Oct 2005 05:29:55 -0000       1.6
> +++ javax/imageio/ImageReader.java    3 Oct 2005 20:34:10 -0000
> @@ -1,5 +1,5 @@
>  /* ImageReader.java -- Decodes raster images.
> -   Copyright (C) 2004  Free Software Foundation, Inc.
> +   Copyright (C) 2004, 2005  Free Software Foundation, Inc.
>  
>  This file is part of GNU Classpath.
>  
> @@ -185,8 +185,10 @@
>    {
>      if (listener == null)
>        return;
> -
> -    progressListeners.add(listener);    
> +    if (progressListeners != null)
> +      {
> +     progressListeners.add(listener);
> +      }

If progressListeners is null here it should be initialized to a new
ArrayList, otherwise no listener could ever be added.  Otherwise this
patch looks good.

Tom






reply via email to

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