/** * Report accumulated warnings to the BugReporter. Clears all accumulated * warnings as a side-effect. */ public void reportAccumulatedBugs() { for (Map.Entry<BugInstance, Data> e : map.entrySet()) { BugInstance bug = e.getKey(); Data d = e.getValue(); reportBug(bug, d); } clearBugs(); }
@Override public void visit(Code code) { if (getMethodSig().indexOf("Logger") == -1) { sawGetLogger = -1; loggerEscaped = loggerImported = false; super.visit(code); // make callbacks to sawOpcode for all opcodes /* if (false) { System.out.println(getFullyQualifiedMethodName()); System.out.printf("%d %s %s\n", sawGetLogger, loggerEscaped, loggerImported); } */ if (sawGetLogger >= 0 && !loggerEscaped && !loggerImported) { bugAccumulator.reportAccumulatedBugs(); } else { bugAccumulator.clearBugs(); } } }
@Override public void visit(Code obj) { if ("equals".equals(getMethodName()) && "(Ljava/lang/Object;)Z".equals(getMethodSig())) { super.visit(obj); if (AnalysisContext.currentAnalysisContext().isApplicationClass(getThisClass())) { bugAccumulator.reportAccumulatedBugs(); } bugAccumulator.clearBugs(); } }
absoluteValueAccumulator.clearBugs(); } else { absoluteValueAccumulator.reportAccumulatedBugs();
pendingAbsoluteValueBug = null; pendingAbsoluteValueBugSourceLine = null; absoluteValueAccumulator.clearBugs();
/** * Report accumulated warnings to the BugReporter. Clears all accumulated * warnings as a side-effect. */ public void reportAccumulatedBugs() { for (Map.Entry<BugInstance, Data> e : map.entrySet()) { BugInstance bug = e.getKey(); Data d = e.getValue(); reportBug(bug, d); } clearBugs(); }
@Override public void visit(Code code) { if (getMethodSig().indexOf("Logger") == -1) { sawGetLogger = -1; loggerEscaped = loggerImported = false; super.visit(code); // make callbacks to sawOpcode for all opcodes /* if (false) { System.out.println(getFullyQualifiedMethodName()); System.out.printf("%d %s %s\n", sawGetLogger, loggerEscaped, loggerImported); } */ if (sawGetLogger >= 0 && !loggerEscaped && !loggerImported) { bugAccumulator.reportAccumulatedBugs(); } else { bugAccumulator.clearBugs(); } } }
@Override public void visit(Code obj) { if ("equals".equals(getMethodName()) && "(Ljava/lang/Object;)Z".equals(getMethodSig())) { super.visit(obj); if (AnalysisContext.currentAnalysisContext().isApplicationClass(getThisClass())) { bugAccumulator.reportAccumulatedBugs(); } bugAccumulator.clearBugs(); } }
absoluteValueAccumulator.clearBugs(); } else { absoluteValueAccumulator.reportAccumulatedBugs();
pendingAbsoluteValueBug = null; pendingAbsoluteValueBugSourceLine = null; absoluteValueAccumulator.clearBugs();