Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed logic around fallback resolver in URIResolverRegistry #2101

Merged
merged 5 commits into from
Dec 18, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/org/rascalmpl/uri/URIResolverRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,12 @@
ILogicalSourceLocationResolver resolver = map.get(auth);
loc = resolveAndFixOffsets(loc, resolver, map.values());
}
var fallBack = fallbackLogicalResolver;
if (fallBack != null) {
return resolveAndFixOffsets(loc == null ? original : loc, fallBack, Collections.emptyList());
if (loc == null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not the right place for this check, it changes the logic of the case where there is no fallbackLogicalResolver defined.

loc = original;
}
if (fallbackLogicalResolver != null) {
var fallbackResult = resolveAndFixOffsets(loc, fallbackLogicalResolver, Collections.emptyList());

Check warning on line 409 in src/org/rascalmpl/uri/URIResolverRegistry.java

View check run for this annotation

Codecov / codecov/patch

src/org/rascalmpl/uri/URIResolverRegistry.java#L409

Added line #L409 was not covered by tests
return fallbackResult == null ? loc : fallbackResult;
rodinaarssen marked this conversation as resolved.
Show resolved Hide resolved
}
return loc;
}
Expand Down
Loading