You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2014/12/01 01:35:12 UTC
[jira] [Resolved] (NET-544) initiateListParsing does not correctly
check if parserKey was cached
[ https://issues.apache.org/jira/browse/NET-544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sebb resolved NET-544.
----------------------
Resolution: Fixed
URL: http://svn.apache.org/r1642615
Log:
NET-544 FTPClient.initiateListParsing does not correctly check if parserKey was cached
Modified:
commons/proper/net/trunk/src/changes/changes.xml
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java
commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/FTPClientTest.java
> initiateListParsing does not correctly check if parserKey was cached
> --------------------------------------------------------------------
>
> Key: NET-544
> URL: https://issues.apache.org/jira/browse/NET-544
> Project: Commons Net
> Issue Type: Bug
> Components: FTP
> Affects Versions: 3.3
> Reporter: Olivier Queyrut
> Priority: Minor
> Fix For: 3.4
>
>
> At line 3232 of FTPClient, it is mentionned that the parserKey and entryParser are cached "to avoid creation of a new object every time a file listing is generated".
> However the test seems to be incorrect as a new entryParser is created every time the method "listFiles" is called. Indeed, in method named listFiles, the initiateListParsing is called with a null argument for the parserKey.
> So the test : "if(__entryParser == null || ! __entryParserKey.equals(parserKey))" is always true (even if __entryParserKey has been cached) and thus a new entryParser is created.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)