System.out.println("\nAggregate statistics\n"); System.out.println(aggregateStats.toString());
	public static void main(String[] argv) throws Exception {		if (argv.length != 1) {			System.err.println("Usage: " + CategorizeBugs.class.getName() + " <results file>");			System.exit(1);		}		//if (BY_CODE_ONLY) System.out.println("Only dump bug codes");		DetectorFactoryCollection.instance(); // load plugins		BugCollection bugCollection = new SortedBugCollection();		bugCollection.readXML(argv[0], new Project());		Iterator<BugInstance> i = bugCollection.iterator();		while (i.hasNext()) {			BugInstance bugInstance = i.next();			String annotation = bugInstance.getAnnotationText();			if (annotation.equals(""))				continue;			Set<String> contents = parseAnnotation(annotation);			boolean isBug = contents.contains("BUG");			boolean isNotBug = contents.contains("NOT_BUG");			if (!isBug && !isNotBug) {				System.out.println("Unknown status for bug:");				dumpBug(bugInstance);				continue;			}			int severity = -1;			if (contents.contains("BENIGN") || contents.contains("HARMLESS"))				severity = BENIGN;			else if (contents.contains("DUBIOUS"))				severity = DUBIOUS;			else if (contents.contains("SERIOUS"))				severity = SERIOUS;			updateStats(bugInstance.getType(), statsByType, isBug, severity);			updateStats(bugInstance.getAbbrev(), statsByCode, isBug, severity);		}		if (!BY_CODE_ONLY)			dumpStats("Statistics by bug pattern", statsByType);		dumpStats("Statistics by bug code", statsByCode);	}