Bug 54295 - wasted work in FTP.FTPDirectoryScanner.checkRemoteSensitivity
Summary: wasted work in FTP.FTPDirectoryScanner.checkRemoteSensitivity
Alias: None
Product: Ant
Classification: Unclassified
Component: Core (show other bugs)
Version: 1.9.1
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: 1.9.4
Assignee: Ant Notifications List
Keywords: PatchAvailable
Depends on:
Reported: 2012-12-14 14:55 UTC by Adrian Nistor
Modified: 2014-01-02 14:38 UTC (History)
2 users (show)

patch (659 bytes, patch)
2012-12-14 14:55 UTC, Adrian Nistor
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Nistor 2012-12-14 14:55:40 UTC
Created attachment 29754 [details]

The problem appears in version 1.8.4 and in revision 1421898.  I
attached a one-line patch that fixes it.

In method "FTP.FTPDirectoryScanner.checkRemoteSensitivity", the
innermost loop over "array" should call "break" immediately after
"candidateFound" is set to "false".  All the iterations after
"candidateFound" is set to "false" do not perform any useful work, at
best they just set "candidateFound" again to "false".

There are other similar loops in Ant, and these loops call "break"
immediately after the boolean is set, just like in the proposed patch
(e.g., loops in methods "FTP.findFileName", "SelectorUtils.match"
"ChainReaderHelper.expandReader", "AntClassLoader.isParentFirst",
"WebLogicHotDeploymentTool.isActionValid", "P4Resolve.setResolvemode",
FTPTaskMirrorImpl.findFileName, etc).
Comment 1 Stefan Bodewig 2014-01-02 14:38:42 UTC
svn revision 1554813