Skip to content

Commit

Permalink
fix drive letter issue in windows
Browse files Browse the repository at this point in the history
Signed-off-by: Shi Chen <[email protected]>
  • Loading branch information
CsCherrYY committed Apr 22, 2021
1 parent 6bc7aef commit 008b542
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.URIUtil;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
Expand Down Expand Up @@ -193,7 +194,12 @@ public void fileChanged(String uriString, CHANGE_TYPE changeType) {
List<URI> uris = getURIs(formatterUrl);
boolean changed = false;
for (URI formatterUri : uris) {
if (formatterUri.equals(uri)) {
if (Platform.OS_WIN32.equals(Platform.getOS()) && URIUtil.isFileURI(formatterUri) && URIUtil.isFileURI(uri)) {
if (URIUtil.toFile(formatterUri).toPath().equals(URIUtil.toFile(uri).toPath())) {
changed = true;
break;
}
} else if (formatterUri.equals(uri)) {
changed = true;
break;
}
Expand Down

0 comments on commit 008b542

Please sign in to comment.