Skip to content

Commit

Permalink
fixed issue in std:// resolver in the case where we are applying it w…
Browse files Browse the repository at this point in the history
…hile testing from rascal/target/classes instead of from a jar file. now the tests can succeed as well
  • Loading branch information
jurgenvinju committed Sep 16, 2024
1 parent 5ea2006 commit ac8080f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/org/rascalmpl/library/util/PathConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Check warning on line 355 in src/org/rascalmpl/library/util/PathConfig.java

View check run for this annotation

Codecov / codecov/patch

src/org/rascalmpl/library/util/PathConfig.java#L355

Added line #L355 was not covered by tests

// unjarify the path
loc = URIUtil.changePath(loc, loc.getPath().replace("!/" + RascalManifest.META_INF_RASCAL_MF, ""));

Check warning on line 358 in src/org/rascalmpl/library/util/PathConfig.java

View check run for this annotation

Codecov / codecov/patch

src/org/rascalmpl/library/util/PathConfig.java#L358

Added line #L358 was not covered by tests
}
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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/org/rascalmpl/uri/StandardLibraryURIResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private static ISourceLocation resolveCurrentRascalJar() {
return PathConfig.resolveCurrentRascalRuntimeJar();
}
catch (IOException e) {

Check warning on line 39 in src/org/rascalmpl/uri/StandardLibraryURIResolver.java

View check run for this annotation

Codecov / codecov/patch

src/org/rascalmpl/uri/StandardLibraryURIResolver.java#L39

Added line #L39 was not covered by tests
// this will be reported elsewhere in PathConfi -
// this will be reported elsewhere in PathConfig.messages -
return null;

Check warning on line 41 in src/org/rascalmpl/uri/StandardLibraryURIResolver.java

View check run for this annotation

Codecov / codecov/patch

src/org/rascalmpl/uri/StandardLibraryURIResolver.java#L41

Added line #L41 was not covered by tests
}
}
Expand Down

0 comments on commit ac8080f

Please sign in to comment.