From ac8080fcc81b55e1947a8dd17401a957715e1782 Mon Sep 17 00:00:00 2001 From: "Jurgen J. Vinju" Date: Mon, 16 Sep 2024 12:50:17 +0200 Subject: [PATCH] fixed issue in std:// resolver in the case where we are applying it while testing from rascal/target/classes instead of from a jar file. now the tests can succeed as well --- src/org/rascalmpl/library/util/PathConfig.java | 5 +++-- src/org/rascalmpl/uri/StandardLibraryURIResolver.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/org/rascalmpl/library/util/PathConfig.java b/src/org/rascalmpl/library/util/PathConfig.java index 0d610cdf5b7..825dbae5f14 100644 --- a/src/org/rascalmpl/library/util/PathConfig.java +++ b/src/org/rascalmpl/library/util/PathConfig.java @@ -354,14 +354,15 @@ public static ISourceLocation resolveDependencyFromResourcesOnCurrentClasspath(S // parser to make sense of it and then convert it to an ISourceLocation loc = vf.sourceLocation("file", null, URIUtil.fromURL(new URL(url.getPath())).getPath()); + // unjarify the path + loc = URIUtil.changePath(loc, loc.getPath().replace("!/" + RascalManifest.META_INF_RASCAL_MF, "")); } else { // this is typically a target folder loc = vf.sourceLocation(URIUtil.fromURL(url)); + loc = URIUtil.getParentLocation(URIUtil.getParentLocation(loc)); } - // unjarify the path - loc = URIUtil.changePath(loc, loc.getPath().replace("!/" + RascalManifest.META_INF_RASCAL_MF, "")); return loc; } diff --git a/src/org/rascalmpl/uri/StandardLibraryURIResolver.java b/src/org/rascalmpl/uri/StandardLibraryURIResolver.java index cf8494cc8a2..d6e3d824557 100644 --- a/src/org/rascalmpl/uri/StandardLibraryURIResolver.java +++ b/src/org/rascalmpl/uri/StandardLibraryURIResolver.java @@ -37,7 +37,7 @@ private static ISourceLocation resolveCurrentRascalJar() { return PathConfig.resolveCurrentRascalRuntimeJar(); } catch (IOException e) { - // this will be reported elsewhere in PathConfi - + // this will be reported elsewhere in PathConfig.messages - return null; } }