EA-46905 - assert: EPathUtil.expandEclipsePathUrl

This commit is contained in:
anna
2013-07-04 11:07:06 +02:00
parent 5b19bac29a
commit db4c7aa81f
2 changed files with 17 additions and 1 deletions

View File

@@ -90,9 +90,21 @@ public class EPathUtil {
/**
* @return url
*/
static String expandEclipsePath2Url(final String path, ModifiableRootModel model, final List<String> currentRoots) {
static String expandEclipsePath2Url(final String path,
final ModifiableRootModel model,
final List<String> currentRoots) {
final VirtualFile contentRoot = getContentRoot(model);
LOG.assertTrue(contentRoot != null);
return expandEclipsePath2Url(path, model, currentRoots, contentRoot);
}
/**
* @return url
*/
static String expandEclipsePath2Url(final String path,
final ModifiableRootModel model,
final List<String> currentRoots,
@NotNull final VirtualFile contentRoot) {
final String rootPath = contentRoot.getPath();
String url = null;
if (new File(path).exists()) { //absolute path

View File

@@ -125,6 +125,10 @@ public class EclipseClasspathReader extends AbstractEclipseClasspathReader<Modif
@Override
protected String expandEclipsePath2Url(ModifiableRootModel rootModel, String path) {
final VirtualFile contentRoot = myContentEntry.getFile();
if (contentRoot != null) {
return EPathUtil.expandEclipsePath2Url(path, rootModel, myCurrentRoots, contentRoot);
}
return EPathUtil.expandEclipsePath2Url(path, rootModel, myCurrentRoots);
}