Skip to content

Commit 726705b

Browse files
committed
Address review comments
1 parent 9976a7a commit 726705b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

java/kotlin-extractor/src/main/java/com/semmle/util/files/SubstResolver.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.semmle.util.files;
22

3+
import com.semmle.util.exception.Exceptions;
34
import java.io.File;
45
import java.net.URISyntaxException;
56
import java.nio.file.Path;
@@ -16,6 +17,7 @@ public class SubstResolver {
1617

1718
static {
1819
boolean loaded = false;
20+
// Cheap check to see that we are on Windows. Avoids static initialization of {@code Env}.
1921
if (File.separatorChar == '\\') {
2022
String dist = System.getenv("CODEQL_DIST");
2123
if (dist != null && !dist.isEmpty()) {
@@ -25,6 +27,7 @@ public class SubstResolver {
2527
System.load(library.toString());
2628
loaded = true;
2729
} catch (RuntimeException | UnsatisfiedLinkError ignored) {
30+
Exceptions.ignore(ignored, "Fall back to resolution being a no-op.");
2831
}
2932
}
3033
}
@@ -64,7 +67,9 @@ public static File resolve(File f) {
6467
String resolved;
6568
try {
6669
resolved = nativeResolveSubst(path.substring(0, 3));
67-
} catch (UnsatisfiedLinkError ignored) {
70+
} catch (RuntimeException | UnsatisfiedLinkError ignored) {
71+
Exceptions.ignore(ignored, "Fall back to resolution being a no-op.");
72+
6873
return f;
6974
}
7075
if (resolved == null) {

0 commit comments

Comments
 (0)