File tree Expand file tree Collapse file tree
src/main/java/the/bytecode/club/bytecodeviewer/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import java .io .IOException ;
66import java .net .InetAddress ;
77import java .security .Permission ;
8- import java .util .concurrent .atomic .AtomicInteger ;
98import the .bytecode .club .bytecodeviewer .BytecodeViewer ;
109import the .bytecode .club .bytecodeviewer .Configuration ;
1110import the .bytecode .club .bytecodeviewer .Constants ;
4544
4645public class SecurityMan extends SecurityManager
4746{
48- private final AtomicInteger silentExec = new AtomicInteger ( 1 ) ;
47+ private volatile boolean silentExec = true ;
4948 private boolean printing = false ;
5049 private boolean printingPackage = false ;
5150
5251 public void silenceExec (boolean b ) {
53- silentExec . addAndGet ( b ? 1 : - 1 ) ;
52+ silentExec = b ;
5453 }
5554
5655 public void setPrinting (boolean printing )
@@ -161,7 +160,7 @@ else if(canClassExecute(Thread.currentThread().getStackTrace()[7].getClassName()
161160 //log exec if allowed
162161 if (allow && validClassCall && !blocked )
163162 {
164- if (silentExec . get () >= 1 )
163+ if (silentExec )
165164 System .err .println ("Allowing exec: " + cmd );
166165 } //throw exception stopping execution
167166 else throw new SecurityException ("BCV is awesome! Blocking exec: " + cmd );
You can’t perform that action at this time.
0 commit comments