diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/JDTUtils.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/JDTUtils.java index 79af99704f..afb3e537e6 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/JDTUtils.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/JDTUtils.java @@ -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; @@ -1869,8 +1868,13 @@ public static boolean isExcludedFile(List 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();