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/15 00:35:07 UTC

[Bug 54305] New: more efficient method call in FileUtils.isContextRelativePath

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

            Bug ID: 54305
           Summary: more efficient method call in
                    FileUtils.isContextRelativePath
           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 29767
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29767&action=edit
patch

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

In method "FileUtils.isContextRelativePath", the call
"filename.indexOf(':') == 1" should be "filename.charAt(1) == ':'"
(the first character is a letter as checked by "Character.isLetter(c)"
earlier in the boolean expression).  In the entire method, "charAt" is
already used 3 different times to check the values of characters 0, 1,
and 2 (while "indexOf" just once, in the instance described above).
These existing 3 calls to "charAt" make the string pattern being
checked for more explicit.  Also, "charAt" is more efficient than
"indexOf", because "charAt" reads only a single character at a given
position, while "indexOf" searches until the first occurrence.

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

[Bug 54305] more efficient method call in FileUtils.isContextRelativePath

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

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 54305] more efficient method call in FileUtils.isContextRelativePath

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

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 54305] more efficient method call in FileUtils.isContextRelativePath

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

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 54305] more efficient method call in FileUtils.isContextRelativePath

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

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

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

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

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

[Bug 54305] more efficient method call in FileUtils.isContextRelativePath

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

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.