diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/SecurityMan.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/SecurityMan.java index 88f0e3d7..bab31364 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/SecurityMan.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/SecurityMan.java @@ -5,7 +5,6 @@ import java.io.FileDescriptor; import java.io.IOException; import java.net.InetAddress; import java.security.Permission; -import java.util.concurrent.atomic.AtomicInteger; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.Constants; @@ -45,12 +44,12 @@ import the.bytecode.club.bytecodeviewer.resources.ExternalResources; public class SecurityMan extends SecurityManager { - private final AtomicInteger silentExec = new AtomicInteger(1); + private volatile boolean silentExec = true; private boolean printing = false; private boolean printingPackage = false; public void silenceExec(boolean b) { - silentExec.addAndGet(b ? 1 : -1); + silentExec = b; } public void setPrinting(boolean printing) @@ -161,7 +160,7 @@ public class SecurityMan extends SecurityManager //log exec if allowed if (allow && validClassCall && !blocked) { - if(silentExec.get() >= 1) + if(silentExec) System.err.println("Allowing exec: " + cmd); } //throw exception stopping execution else throw new SecurityException("BCV is awesome! Blocking exec: " + cmd);