ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrice Matignon (JIRA)" <>
Subject [jira] [Commented] (IVY-1475) ivy:cachefileset fails with String index out of range on Windows
Date Tue, 03 Jun 2014 01:18:01 GMT


Patrice Matignon commented on IVY-1475:

{code:java| lines 65-70}
for (Iterator iter = paths.iterator(); iter.hasNext();) {
    ArtifactDownloadReport a = (ArtifactDownloadReport);
    if (a.getLocalFile() != null) {                             // getBaseDir() will return
null if both files are incompatible
       base = getBaseDir(base, a.getLocalFile());  // the next iteration will assume it is
the first one.

> ivy:cachefileset fails with String index out of range on Windows
> ----------------------------------------------------------------
>                 Key: IVY-1475
>                 URL:
>             Project: Ivy
>          Issue Type: Bug
>          Components: Ant
>    Affects Versions: 2.4.0-RC1
>         Environment: Windows
>            Reporter: Patrice Matignon
> On Windows, the ant task <ivy:cachefileset /> can fail with the stack trace below,
when the resolve includes artifacts located in separate directories in separate drives (e.g.
c:\ivy2/cache/... ; d:\ivy2\cache ).
> The underlying issue is that cachefileset is an ant fileset and as such it requires a
base dir.
> Nevertheless, the implementation for this ant task doesn't handle this scenario properly:
it attempts to find the common base dir for all the resolved artifacts, except that every
time it runs into a conflicting artifacts, it just loses the information and ends up reporting
an invalid base dir, which causes a fatal StringIndexOutOfBoundsException later in that task.
> A sample stacktrace (the actual reported index varies):
> C:\src\trunk\build.xml:839: impossible to build ivy cache fileset: java.lang.StringIndexOutOfBoundsException:
String index out of range: -24
> 	at java.lang.String.substring(
> 	at java.lang.String.substring(
> 	at org.apache.ivy.ant.IvyCacheFileset.getPath(
> 	at org.apache.ivy.ant.IvyCacheFileset.doExecute(
> 	at org.apache.ivy.ant.IvyTask.execute(

This message was sent by Atlassian JIRA

View raw message