Skip to content

Commit

Permalink
Removed debug prints, added cause to UnsatisfiedLinkException
Browse files Browse the repository at this point in the history
  • Loading branch information
CerielJacobs committed Apr 10, 2018
1 parent 73f0551 commit e5725d1
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions src/vlog/java/karmaresearch/vlog/VLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
*/
public class VLog {

private static final boolean DEBUG = false;

private static final AtomicInteger VlogCounter = new AtomicInteger(0);

static {
Expand All @@ -33,10 +31,6 @@ private static void loadLibrary(String s) {
// First try to just load the shared library.
try {
System.loadLibrary(s);
if (DEBUG) {
System.out
.println("Loaded " + s + " with System.loadLibrary()");
}
} catch (Throwable ex) {
// Did not work, now try to load it from the same directory as the
// jar file. First determine prefix and suffix, depending on OS.
Expand All @@ -47,7 +41,9 @@ private static void loadLibrary(String s) {
jarFile = new File(VLog.class.getProtectionDomain()
.getCodeSource().getLocation().toURI());
} catch (Throwable e) {
throw new UnsatisfiedLinkError(e.getMessage());
throw (UnsatisfiedLinkError) new UnsatisfiedLinkError(
"while loading " + s + ": " + e.getMessage())
.initCause(e.getCause());
}

// Next, determine OS.
Expand All @@ -69,21 +65,16 @@ private static void loadLibrary(String s) {

try {
loadFromDir(jarFile, libName);
if (DEBUG) {
System.out.println("Loaded " + s
+ " from the directory in which the jar resides");
}
} catch (Throwable e) {
try {
loadFromJar(jarFile, libName, os);
if (DEBUG) {
System.out.println("Loaded " + s + " from the jar");
}
} catch (Throwable e1) {
// System.err.println("Could not load library " + s
// + ", exceptions are temporarily disabled to accomodate
// windows version");
throw new UnsatisfiedLinkError(e1.getMessage());
throw (UnsatisfiedLinkError) new UnsatisfiedLinkError(
"while loading " + s + ": " + e1.getMessage())
.initCause(e1.getCause());
}
}
}
Expand Down

0 comments on commit e5725d1

Please sign in to comment.