if (args.length - argCount != 1) { System.err.println("Usage: " + CountBugsFast.class.getName() + " [options] <bug collection>"); System.err.println("Options:"); commandLine.printUsage(System.err); System.exit(1);
if (commandLine.getListFile() != null ){ if (args.length != argCount) { commandLine.printUsage(System.err); System.exit(1); } BufferedReader reader; if (commandLine.getListFile().equals("-")) { reader = new BufferedReader(new InputStreamReader(System.in)); } else { reader = new BufferedReader(new FileReader(commandLine.getListFile())); } String fileName; while ((fileName = reader.readLine()) != null) { fileName = fileName.trim(); try { CountBugsFast countBugs = commandLine.createAndExecute(fileName); System.out.println(fileName + "," + countBugs.getCount()); } catch (SAXException e) { throw new SAXException("Error parsing " + fileName, e); } catch (IOException e) { IOException e2 = new IOException("Error parsing " + fileName); e2.initCause(e); throw e2; } } } else { if (args.length - argCount != 1) { commandLine.printUsage(System.err); System.exit(1); }  String fileName = args[argCount]; CountBugsFast countBugs = commandLine.createAndExecute(fileName); System.out.println(countBugs.getCount());
	public static void main(String[] args) throws Exception {		DetectorFactoryCollection.instance(); // load plugins				CountBugsFastCommandLine commandLine = new CountBugsFastCommandLine();		int argCount = commandLine.parse(args);				if (args.length - argCount != 1) {			System.err.println("Usage: " + CountBugsFast.class.getName() +					" [options] <bug collection>");			System.err.println("Options:");			commandLine.printUsage(System.err);			System.exit(1);		}				CountBugsFast countBugs = new CountBugsFast(				new BufferedInputStream(new FileInputStream(args[argCount])));		if (commandLine.getAbbrevs() != null)			countBugs.setAbbrevs(commandLine.getAbbrevs());		if (commandLine.getCategories() != null)			countBugs.setCategories(commandLine.getCategories());		countBugs.setMinPriority(commandLine.getMinPriority());				countBugs.execute();		System.out.println(countBugs.getCount());	}