bugHistory.setUseFuzzyComparator(commandLine.isFuzzy());
Comparator<BugInstance> comparator; switch (commandLine.getComparatorType()) { case VERSION_INSENSITIVE_COMPARATOR: comparator = VersionInsensitiveBugComparator.instance(); break; case FUZZY_COMPARATOR: FuzzyBugComparator fuzzy = new FuzzyBugComparator(); fuzzy.registerBugCollection(origCollection); fuzzy.registerBugCollection(newCollection); comparator = fuzzy; break; case SLOPPY_COMPARATOR: comparator = new SloppyBugComparator(); break; default: throw new IllegalStateException(); } bugHistory.setComparator(comparator);
	public static void main(String[] argv) throws Exception {				BugHistoryCommandLine commandLine = new BugHistoryCommandLine();		int argCount = commandLine.parse(argv);		if (argv.length - argCount != 2) {			printUsage();		}				if (commandLine.getSetOp() == null) {			System.err.println("No set operation specified");			System.exit(1);		}		Project origProject = new Project();		SortedBugCollection origCollection = readCollection(argv[argCount++], origProject);		Project newProject = new Project();		SortedBugCollection newCollection = readCollection(argv[argCount++], newProject);				BugHistory bugHistory = new BugHistory(origCollection, newCollection);		bugHistory.setUseFuzzyComparator(commandLine.isFuzzy());				SortedBugCollection result = bugHistory.performSetOperation(commandLine.getSetOp());				if (commandLine.isCount()) {			System.out.println(result.getCollection().size());		} else {			result.writeXML(					System.out, bugHistory.getOriginator() == origCollection ? origProject : newProject);		}	}