Author: sebb
Date: Tue Mar 22 22:25:20 2011
New Revision: 1084382
URL: http://svn.apache.org/viewvc?rev=1084382&view=rev
Log:
NET-381 Parsing is inefficient, as it parses everything twice
Modified:
commons/proper/net/trunk/src/changes/changes.xml
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPFileEntryParserImpl.java
Modified: commons/proper/net/trunk/src/changes/changes.xml
URL:
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1084382&r1=1084381&r2=1084382&view=diff
==============================================================================
--- commons/proper/net/trunk/src/changes/changes.xml (original)
+++ commons/proper/net/trunk/src/changes/changes.xml Tue Mar 22 22:25:20 2011
@@ -57,6 +57,12 @@ The <action> type attribute can be add,u
<body>
<release version="3.0" date="TBA" description="TBA">
+ <action issue="NET-381" dev="sebb" type="update">
+ Parsing is inefficient, as it parses everything twice.
+ </action>
+ <action issue="NET-388" dev="sebb" type="fix">
+ VMSVersioningFTPEntryParser#preParse should not call
super.preParse().
+ </action>
<action issue="NET-388" dev="sebb" type="fix">
VMSVersioningFTPEntryParser#preParse should not call
super.preParse().
</action>
Modified:
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPFileEntryParserImpl.java
URL:
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPFileEntryParserImpl.java?rev=1084382&r1=1084381&r2=1084382&view=diff
==============================================================================
---
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPFileEntryParserImpl.java
(original)
+++
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPFileEntryParserImpl.java
Tue Mar 22 22:25:20 2011
@@ -18,7 +18,6 @@
package org.apache.commons.net.ftp;
import java.io.BufferedReader;
import java.io.IOException;
-import java.util.Iterator;
import java.util.List;
/**
@@ -58,20 +57,13 @@ public abstract class FTPFileEntryParser
* perform some action upon the FTPFileList after it has been created
* from the server stream, but before any clients see the list.
*
- * This default implementation removes entries that do not parse as files.
+ * This default implementation does nothing.
*
* @param original Original list after it has been created from the server
stream
*
* @return <code>original</code> unmodified.
*/
public List<String> preParse(List<String> original) {
- Iterator<String> it = original.iterator();
- while (it.hasNext()){
- String entry = it.next();
- if (null == parseFTPEntry(entry)) {
- it.remove();
- }
- }
return original;
}
}