maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Barrie Treloar (JIRA)" <>
Subject [jira] Commented: (MECLIPSE-261) IdeUtils.toRelativeAndFixSeparator returns incomplete path
Date Wed, 17 Sep 2008 06:36:48 GMT


Barrie Treloar commented on MECLIPSE-261:

For Z:
basedirPath.length() + 1=4
basedirPath =Z:\
relative    =arget\main-output
relative fix=arget/main-output

basedirPath.length() + 1=5
basedirPath =Z:\s
relative    =target\main-output
relative fix=target/main-output

The problem is that the code assumes there is a directory at the end of the absolute basedir
and therefore after the end of basedir, there is a file separator in the fileToAdd.

As fileToAdd = new File( basedir, fileToAdd.getPath() );

Which for basedir = Z:
basedirPath =Z:\

and for 
basedirPath =Z:\s

In the case of Z: there is no file separator after so the +1 assumption causes the problem.

> IdeUtils.toRelativeAndFixSeparator returns incomplete path
> ----------------------------------------------------------
>                 Key: MECLIPSE-261
>                 URL:
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Dependencies resolution and build path
>    Affects Versions: 2.3
>         Environment: Windows XP, jdk 1.5.0_11-b03, maven 2.0.5 
>            Reporter: Marcio Paulo Guedes
>            Assignee: Arnaud Heritier
>         Attachments: .classpath, baseDirIsRoot.patch,,,, patch.txt, pom.xml
> .classpath file is generated with incomplete path for classpathentry when kind is "var".
> Example: 
> <classpathentry kind="var" path="M2_REPO/gnl/ognl/2.6.9/ognl-2.6.9.jar"/>
> when <classpathentry kind="var" path="M2_REPO/ognl/ognl/2.6.9/ognl-2.6.9.jar"/>
 is expected.
> It's caused by IdeUtils.toRelativeAndFixSeparator when basepath is not equal absolutepath.
Code on line 99 shifts the string 1 character to the right, corrupting the result path.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message