1 19 20 package edu.umd.cs.findbugs.detect; 21 22 23 import edu.umd.cs.findbugs.*; 24 25 import org.apache.bcel.classfile.*; 26 27 public class TestingGround extends BytecodeScanningDetector { 28 29 private static final boolean active 30 = SystemProperties.getBoolean("findbugs.tg.active"); 31 32 33 BugReporter bugReporter; 34 35 OpcodeStack stack = new OpcodeStack(); 36 public TestingGround(BugReporter bugReporter) { 37 this.bugReporter = bugReporter; 38 } 39 40 41 42 @Override 43 public void visit(JavaClass obj) { 44 } 45 46 @Override 47 public void visit(Method obj) { 48 } 49 50 @Override 51 public void visit(Code obj) { 52 if (active) { 54 stack.resetForMethodEntry(this); 56 super.visit(obj); 57 } 58 } 59 60 61 @Override 62 public void sawOpcode(int seen) { 63 stack.mergeJumps(this); 64 stack.sawOpcode(this,seen); 65 } 66 } 67 | Popular Tags |