From 726705b7311301018d23eb42eba4af6ce3dc9761 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Mon, 27 Jul 2026 13:59:40 +0200 Subject: [PATCH] Address review comments --- .../src/main/java/com/semmle/util/files/SubstResolver.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/java/kotlin-extractor/src/main/java/com/semmle/util/files/SubstResolver.java b/java/kotlin-extractor/src/main/java/com/semmle/util/files/SubstResolver.java index 4d3975f19b3..017d4fb8399 100644 --- a/java/kotlin-extractor/src/main/java/com/semmle/util/files/SubstResolver.java +++ b/java/kotlin-extractor/src/main/java/com/semmle/util/files/SubstResolver.java @@ -1,5 +1,6 @@ package com.semmle.util.files; +import com.semmle.util.exception.Exceptions; import java.io.File; import java.net.URISyntaxException; import java.nio.file.Path; @@ -16,6 +17,7 @@ public class SubstResolver { static { boolean loaded = false; + // Cheap check to see that we are on Windows. Avoids static initialization of {@code Env}. if (File.separatorChar == '\\') { String dist = System.getenv("CODEQL_DIST"); if (dist != null && !dist.isEmpty()) { @@ -25,6 +27,7 @@ public class SubstResolver { System.load(library.toString()); loaded = true; } catch (RuntimeException | UnsatisfiedLinkError ignored) { + Exceptions.ignore(ignored, "Fall back to resolution being a no-op."); } } } @@ -64,7 +67,9 @@ public class SubstResolver { String resolved; try { resolved = nativeResolveSubst(path.substring(0, 3)); - } catch (UnsatisfiedLinkError ignored) { + } catch (RuntimeException | UnsatisfiedLinkError ignored) { + Exceptions.ignore(ignored, "Fall back to resolution being a no-op."); + return f; } if (resolved == null) {