StringIndexOutOfBounds exception on FilenameUtils.getPathNoEndSeparator
-----------------------------------------------------------------------

                 Key: IO-179
                 URL: https://issues.apache.org/jira/browse/IO-179
             Project: Commons IO
          Issue Type: Bug
          Components: Utilities
    Affects Versions: 1.4, 1.3.2
         Environment: Javadoc says that method is text based. In any case, the 
problem has been reproduced in Windows and Linux.
            Reporter: Francisco Borges


public void testFilenameUtils() {
 String path = "/foo.xml";
 org.apache.commons.io.FilenameUtils.getPathNoEndSeparator(path);
 }


Leads to:

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.String.substring(String.java:1768)
        at org.apache.commons.io.FilenameUtils.doGetPath(FilenameUtils.java:705)
        at 
org.apache.commons.io.FilenameUtils.getPathNoEndSeparator(FilenameUtils.java:683)


  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to