UriUtil.normalize did not properly ensure that drive-letters on windows
are canonically represented  (i.e allways in upper-case or allways in
lower-case).
This commit is contained in:
Kris De Volder
2018-08-07 14:44:38 -07:00
parent 243586a8f8
commit 3949aa0a93
2 changed files with 7 additions and 1 deletions

View File

@@ -74,4 +74,9 @@ public class JavaProject implements IJavaProject, Disposable {
public boolean exists() {
return new File(uri).exists();
}
@Override
public String toString() {
return "JavaProject("+uri+")";
}
}

View File

@@ -28,7 +28,7 @@ public class UriUtil {
public static String normalize(String uriVal) {
try {
if (uriVal != null && uriVal.startsWith("file:")) {
File file = new File(URI.create(uriVal));
File file = new File(URI.create(uriVal)).getCanonicalFile();
uriVal = file.toURI().toString();
//Careful!!! If the project uri points to a existing project... then it will be
//a directory and then the uri we computed will get a slash at the end.
@@ -39,6 +39,7 @@ public class UriUtil {
while (uriVal.endsWith("/")) {
uriVal = uriVal.substring(0, uriVal.length()-1);
}
//Careful on windows, drive letters
return uriVal;
}
} catch (Exception e) {