Skip to content

Commit

Permalink
java.diagnostic.filter is broken on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
snjeza committed Oct 1, 2024
1 parent 92c8d94 commit f85899d
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.FileSystem;
Expand Down Expand Up @@ -1869,8 +1868,13 @@ public static boolean isExcludedFile(List<String> patterns, String uriString) {
java.nio.file.Path[] path = new java.nio.file.Path[1];
try {
path[0] = Paths.get(uri.toURL().getPath());
} catch (MalformedURLException e) {
path[0] = Paths.get(uri);
} catch (Exception e) {
try {
path[0] = Paths.get(uri);
} catch (Exception e1) {
JavaLanguageServerPlugin.logException(e1);
return false;
}
}
FileSystem fileSystems = path[0].getFileSystem();
return !patterns.stream().filter(pattern -> fileSystems.getPathMatcher("glob:" + pattern).matches(path[0])).collect(Collectors.toList()).isEmpty();
Expand Down

0 comments on commit f85899d

Please sign in to comment.