fix double slash in paths

This commit is contained in:
Maxim Shafirov
2012-02-02 18:10:51 +04:00
parent 216edb996a
commit 2b60fe5178
@@ -58,7 +58,15 @@ public class CoreJarVirtualFile extends VirtualFile {
@Override
public String getPath() {
if (myParent == null) return myHandler.myBasePath + "!/";
return myParent.getPath() + "/" + myEntry.shortName;
String parentPath = myParent.getPath();
StringBuilder answer = new StringBuilder(parentPath.length() + 1 + myEntry.shortName.length());
if (answer.charAt(answer.length() - 1) != '/') {
answer.append('/');
}
answer.append(myEntry.shortName);
return answer.toString();
}
@Override