Detector[] detectors = new Detector[analysisPass.getNumDetectors()]; int count = 0; for (Iterator<DetectorFactory> i = analysisPass.iterator(); i.hasNext();) { detectors[count++] = i.next().create(bugReporter); }
Detector[] detectors = analysisPass.instantiateDetectorsInPass(bugReporter);
	private void executeAnalysisPass(AnalysisPass analysisPass, List<String> repositoryClassList) throws InterruptedException {		// Callback for progress dialog: analysis is starting		progressCallback.startAnalysis(repositoryClassList.size());				if (ExecutionPlan.DEBUG) {			System.out.println("************* Analysis pass " + (passCount++) + " *************");			for (Iterator<DetectorFactory> i = analysisPass.iterator(); i.hasNext();) {				DetectorFactory factory = i.next();				System.out.println("\t" + factory.getFullName());			}		}				// Create detectors		Detector[] detectors = new Detector[analysisPass.getNumDetectors()];		int count = 0;		for (Iterator<DetectorFactory> i = analysisPass.iterator(); i.hasNext();) {			detectors[count++] = i.next().create(bugReporter);		}		// Examine each class in the application		Set<String> examinedClassSet = new HashSet<String>();		for (String className : repositoryClassList) {			if (examinedClassSet.add(className))				examineClass(detectors, className);		}				if (DEBUG) {			long total = 0;			for (Long aLong : detectorTimings.values()) {				total += aLong.longValue();			}			System.out.println();			System.out.println("Detector Timings");			for (Map.Entry<String, Long> entry : detectorTimings.entrySet()) {				String detectorName = entry.getKey();				long detectorTime = entry.getValue().longValue();				System.out.println(detectorName + ": " + detectorTime + " ms  -> (" + (detectorTime * 100.0f / (float) total) + ") %");			}			System.out.println();			detectorTimings = new HashMap<String,Long>();		}		// Callback for progress dialog: analysis finished		progressCallback.finishPerClassAnalysis();		// Force any detectors which defer work until all classes have		// been seen to do that work.		this.reportFinal(detectors);	}