diff --git a/src/org/rascalmpl/uri/URIResolverRegistry.java b/src/org/rascalmpl/uri/URIResolverRegistry.java index 74ed2be4421..a4c447f9480 100644 --- a/src/org/rascalmpl/uri/URIResolverRegistry.java +++ b/src/org/rascalmpl/uri/URIResolverRegistry.java @@ -78,7 +78,6 @@ private URIResolverRegistry() { loadServices(); } - /** * Use with care! This (expensive) reinitialization method clears all caches of all resolvers by * reloading them from scratch. @@ -463,6 +462,9 @@ public void unregisterLogical(String scheme, String auth) { private static final Pattern splitScheme = Pattern.compile("^([^\\+]*)\\+"); private ISourceLocationInput getInputResolver(String scheme) { + if (scheme.equals(URIUtil.unknownLocation().getScheme())) { + return null; + } ISourceLocationInput result = inputResolvers.get(scheme); if (result == null) { Matcher m = splitScheme.matcher(scheme); @@ -481,6 +483,9 @@ private ISourceLocationInput getInputResolver(String scheme) { } private IClassloaderLocationResolver getClassloaderResolver(String scheme) { + if (scheme.equals(URIUtil.unknownLocation().getScheme())) { + return null; + } IClassloaderLocationResolver result = classloaderResolvers.get(scheme); if (result == null) { Matcher m = splitScheme.matcher(scheme); @@ -496,6 +501,9 @@ private IClassloaderLocationResolver getClassloaderResolver(String scheme) { } private ISourceLocationOutput getOutputResolver(String scheme) { + if (scheme.equals(URIUtil.unknownLocation().getScheme())) { + return null; + } ISourceLocationOutput result = outputResolvers.get(scheme); if (result == null) { Matcher m = splitScheme.matcher(scheme); diff --git a/src/org/rascalmpl/uri/URIUtil.java b/src/org/rascalmpl/uri/URIUtil.java index 829001331a5..45b76d98e56 100644 --- a/src/org/rascalmpl/uri/URIUtil.java +++ b/src/org/rascalmpl/uri/URIUtil.java @@ -508,8 +508,4 @@ else if (index != -1) { return URIUtil.changePath(location, path); } - - public static URI invalidURI() { - return rootScheme("invalid"); - } } diff --git a/test/org/rascalmpl/test/repl/JlineParserTest.java b/test/org/rascalmpl/test/repl/JlineParserTest.java index 1b3e9ee9a02..97e1d2ad7a2 100644 --- a/test/org/rascalmpl/test/repl/JlineParserTest.java +++ b/test/org/rascalmpl/test/repl/JlineParserTest.java @@ -16,7 +16,7 @@ private ParsedLine completeParser(String input) { } private ParsedLine completeParser(String input, int cursor) { - var parser = new RascalLineParser(l -> { throw new ParseError("rascal parser not supported in the test yet", URIUtil.invalidURI(), 0, 0, 0, 0, 0, 0); }); + var parser = new RascalLineParser(l -> { throw new ParseError("rascal parser not supported in the test yet", URIUtil.unknownLocation().getURI(), 0, 0, 0, 0, 0, 0); }); return parser.parse(input, cursor, ParseContext.COMPLETE); }