public HangingExecutors(BugReporter reporter) { this.bugReporter = reporter; this.localHEDetector = new LocalHangingExecutor(this, reporter); }
/** * finds ExecutorService objects that don't get a call to the terminating methods, and thus, never appear to be shutdown properly (the threads exist until * shutdown is called) * * @param classContext * the class context object of the currently parsed java class */ @Override public void visitClassContext(ClassContext classContext) { localHEDetector.visitClassContext(classContext); try { hangingFieldCandidates = new HashMap<>(); exemptExecutors = new HashMap<>(); parseFieldsForHangingCandidates(classContext); if (!hangingFieldCandidates.isEmpty()) { stack = new OpcodeStack(); super.visitClassContext(classContext); reportHangingExecutorFieldBugs(); } } finally { stack = null; hangingFieldCandidates = null; exemptExecutors = null; } }
/** * finds ExecutorService objects that don't get a call to the terminating methods, and thus, never appear to be shutdown properly (the threads exist until * shutdown is called) * * @param classContext * the class context object of the currently parsed java class */ @Override public void visitClassContext(ClassContext classContext) { localHEDetector.visitClassContext(classContext); try { hangingFieldCandidates = new HashMap<>(); exemptExecutors = new HashMap<>(); parseFieldsForHangingCandidates(classContext); if (!hangingFieldCandidates.isEmpty()) { stack = new OpcodeStack(); super.visitClassContext(classContext); reportHangingExecutorFieldBugs(); } } finally { stack = null; hangingFieldCandidates = null; exemptExecutors = null; } }
public HangingExecutors(BugReporter reporter) { this.bugReporter = reporter; this.localHEDetector = new LocalHangingExecutor(this, reporter); }