[414225] Using relative path to include a XML file leads to a XML
Definition validation error
diff --git a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/util/ComponentResolver.java b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/util/ComponentResolver.java
index 2e7b2fd..16094a2 100644
--- a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/util/ComponentResolver.java
+++ b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/util/ComponentResolver.java
@@ -200,11 +200,14 @@
}
else {
resolvedRuntimePath = new Path(virtualResources[i].getRuntimePath().removeLastSegments(1).append(systemId).toString());
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IFile fileResolvedRuntime = root.getFile(resolvedRuntimePath);
- if(fileResolvedRuntime.exists()) {
- IPath resolvedRuntimeLocation = fileResolvedRuntime.getLocation();
- virtualFile = ComponentCore.createFile(fileResolvedRuntime.getProject(), resolvedRuntimePath.removeFirstSegments(1));
+ if (resolvedRuntimePath.segmentCount() > 1)
+ {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IFile fileResolvedRuntime = root.getFile(resolvedRuntimePath);
+ if(fileResolvedRuntime.exists()) {
+ IPath resolvedRuntimeLocation = fileResolvedRuntime.getLocation();
+ virtualFile = ComponentCore.createFile(fileResolvedRuntime.getProject(), resolvedRuntimePath.removeFirstSegments(1));
+ }
}
}