File tree Expand file tree Collapse file tree
java/kotlin-extractor/src/main/java/com/semmle/util/files Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .semmle .util .files ;
22
3+ import com .semmle .util .exception .Exceptions ;
34import java .io .File ;
45import java .net .URISyntaxException ;
56import 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 ) {
You can’t perform that action at this time.
0 commit comments