Set<String> examinedClassSet = new HashSet<String>(); for (Iterator<String> i = repositoryClassList.iterator(); i.hasNext();) { String className = i.next(); if (examinedClassSet.add(className)) examineClass(className);
for (Iterator<AnalysisPass> i = executionPlan.passIterator(); i.hasNext();) { AnalysisPass analysisPass = i.next(); analysisPass.createDetectors(bugReporter); executeAnalysisPass(analysisPass, repositoryClassList);
	public void execute() throws java.io.IOException, InterruptedException {		// Configure the analysis context		analysisContext = new AnalysisContext(bugReporter);		analysisContext.setSourcePath(project.getSourceDirList());				if (relaxedReportingMode) {			analysisContext.setBoolProperty(FindBugsAnalysisProperties.RELAXED_REPORTING_MODE,true);		}		// Give the BugReporter a reference to this object,		// in case it wants to access information such		// as the AnalysisContext		bugReporter.setEngine(this);		// Create detectors		createDetectors();		// Clear the repository of classes		analysisContext.clearRepository();				// Get list of files to analyze.		// Note that despite the name getJarFileArray(),		// they can also be zip files, directories,		// and single class files.		LinkedList<ArchiveWorkListItem> archiveWorkList = new LinkedList<ArchiveWorkListItem>();		for (Iterator<String> i = project.getFileList().iterator(); i.hasNext(); ) {			String fileName = i.next();			archiveWorkList.add(new ArchiveWorkListItem(fileName, true));		}		// Report how many archives/directories/files will be analyzed,		// for progress dialog in GUI		progressCallback.reportNumberOfArchives(archiveWorkList.size());		// Keep track of the names of all classes to be analyzed		List<String> repositoryClassList = new LinkedList<String>();		// set the initial repository classpath.		setRepositoryClassPath();				// Record additional entries that should be added to		// the aux classpath.  These occur when one or more classes		// in a directory or archive are skipped, to ensure that		// the skipped classes can still be referenced.		List<String> additionalAuxClasspathEntryList = new LinkedList<String>();		// Add all classes in analyzed archives/directories/files		while (!archiveWorkList.isEmpty()) {			ArchiveWorkListItem item = archiveWorkList.removeFirst();			scanArchiveOrDirectory(item, archiveWorkList, repositoryClassList,				additionalAuxClasspathEntryList);		}						// Add "extra" aux classpath entries needed to ensure that		// skipped classes can be referenced.		addCollectionToClasspath(additionalAuxClasspathEntryList);		// Callback for progress dialog: analysis is starting		progressCallback.startAnalysis(repositoryClassList.size());		// Examine all classes for bugs.		// Don't examine the same class more than once.		// (The user might specify two jar files that contain		// the same class.)				if (DEBUG)			detectorTimings = new HashMap<String,Long>();				Set<String> examinedClassSet = new HashSet<String>();		for (Iterator<String> i = repositoryClassList.iterator(); i.hasNext();) {			String className = i.next();			if (examinedClassSet.add(className))				examineClass(className);		}				if (DEBUG) {			long total = 0;			Iterator<Long> timingsIt = detectorTimings.values().iterator();			while (timingsIt.hasNext()) {				total += timingsIt.next().longValue();			}			System.out.println();			System.out.println("Detector Timings");			Iterator<Map.Entry<String,Long>> it = detectorTimings.entrySet().iterator();			while (it.hasNext()) {				Map.Entry<String,Long> entry = it.next();				String detectorName = entry.getKey();				long detectorTime = entry.getValue().longValue();				System.out.println(detectorName + ": " + detectorTime + " ms  -> (" + (detectorTime * 100.0f / (float)total) + ") %");			}			System.out.println();			detectorTimings = null;		}		// 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();		// Flush any queued bug reports		bugReporter.finish();		// Flush any queued error reports		bugReporter.reportQueuedErrors();		// Free up memory for reports		analysisContext.clearRepository();	}