You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2012/12/14 21:07:56 UTC

[Bug 54298] New: more efficient (and shorter) method calls in FTPTaskMirrorImpl.makeRemoteDir

https://issues.apache.org/bugzilla/show_bug.cgi?id=54298

            Bug ID: 54298
           Summary: more efficient (and shorter) method calls in
                    FTPTaskMirrorImpl.makeRemoteDir
           Product: Ant
           Version: 1.8.4
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
          Assignee: notifications@ant.apache.org
          Reporter: nistor1@illinois.edu
    Classification: Unclassified

Created attachment 29757
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29757&action=edit
patch

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

In method "FTPTaskMirrorImpl.makeRemoteDir", there are two calls to
"dir.indexOf("/") == 0".  These calls should be "dir.startsWith("/")".
The intent of the call is more explicit with "startsWith" than with
"indexOf(..) == 0".  "startsWith" is also more efficient than
"indexOf", because "startsWith" tries to match only the start of the
string, while "indexOf" searches until the first occurrence.

There are many calls to "String.startsWith" in Ant (just like in the
proposed patch), for example, in methods "AntlibDefinition.setURI",
"AntClassLoader.isParentFirst", "ComponentHelper.checkNamespace",
"Execute.getVMSLogicals", "ExecTask.isPath", "Jar.writeIndexLikeList",
"Definer.makeResourceFromURI", "PathTokenizer.nextToken", etc.

I attached a second one-line patch (secondCall.diff) for the second
call.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54298] more efficient (and shorter) method calls in FTPTaskMirrorImpl.makeRemoteDir

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54298

Antoine Levy-Lambert <an...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|1.9.0                       |1.9.1

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54298] more efficient (and shorter) method calls in FTPTaskMirrorImpl.makeRemoteDir

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54298

--- Comment #1 from Adrian Nistor <ni...@illinois.edu> ---
Created attachment 29758
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29758&action=edit
patch

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54298] more efficient (and shorter) method calls in FTPTaskMirrorImpl.makeRemoteDir

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54298

Jesse Glick <jg...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable
                 CC|                            |jglick@apache.org

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54298] more efficient (and shorter) method calls in FTPTaskMirrorImpl.makeRemoteDir

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54298

Antoine Levy-Lambert <an...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|1.8.4                       |1.9.0

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54298] more efficient (and shorter) method calls in FTPTaskMirrorImpl.makeRemoteDir

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54298

Adrian Nistor <ni...@illinois.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #29757|patch                       |firstCall.diff
        description|                            |

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54298] more efficient (and shorter) method calls in FTPTaskMirrorImpl.makeRemoteDir

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54298

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |1.9.4

--- Comment #2 from Stefan Bodewig <bo...@apache.org> ---
svn revision 1554813

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54298] more efficient (and shorter) method calls in FTPTaskMirrorImpl.makeRemoteDir

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54298

Adrian Nistor <ni...@illinois.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nistor1@illinois.edu

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54298] more efficient (and shorter) method calls in FTPTaskMirrorImpl.makeRemoteDir

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54298

Adrian Nistor <ni...@illinois.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #29758|patch                       |secondCall.diff
        description|                            |

-- 
You are receiving this mail because:
You are the assignee for the bug.