commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r409447 - in /jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider: AbstractFileObject.java AbstractFileSystem.java
Date Thu, 25 May 2006 19:52:00 GMT
Author: imario
Date: Thu May 25 12:51:59 2006
New Revision: 409447

URL: http://svn.apache.org/viewvc?rev=409447&view=rev
Log:
VFS-50: fixed case where a listener removes itself from the list of listeners during fire
phase.
Thanks to Chris DiGiano for pointing it out.

Modified:
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileSystem.java

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java?rev=409447&r1=409446&r2=409447&view=diff
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java
(original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java
Thu May 25 12:51:59 2006
@@ -1415,7 +1415,7 @@
             if (parentName != null)
             {
                 // Locate the parent, if it is cached
-                parent = (AbstractFileObject) fs.getFileFromCache(parentName);
+                parent = fs.getFileFromCache(parentName);
             }
         }
 

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileSystem.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileSystem.java?rev=409447&r1=409446&r2=409447&view=diff
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileSystem.java
(original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/AbstractFileSystem.java
Thu May 25 12:51:59 2006
@@ -487,13 +487,13 @@
             final ArrayList listeners = (ArrayList) listenerMap.get(file.getName());
             if (listeners != null)
             {
-                final int count = listeners.size();
-                for (int i = 0; i < count; i++)
+            	FileListener[] fileListeners = (FileListener[]) listeners.toArray(new FileListener[listeners.size()]);
+                for (int i = 0; i < fileListeners.length; i++)
                 {
-                    final FileListener listener = (FileListener) listeners.get(i);
+                    final FileListener fileListener = fileListeners[i];
                     try
                     {
-                        event.notify(listener);
+                        event.notify(fileListener);
                     }
                     catch (final Exception e)
                     {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message