DetectorFactoryCollection.instance(); UpdateCommandLine commandLine = new UpdateCommandLine(); int argCount = commandLine.parse(args, 2, Integer.MAX_VALUE, USAGE);  if (commandLine.outputFilename == null) verbose = false; String[] firstPathParts = getFilePathParts(args[argCount]); int commonPrefix = firstPathParts.length; for(int i = argCount+1; i <= (args.length - 1); i++) {  commonPrefix = Math.min(commonPrefix, lengthCommonPrefix( firstPathParts, getFilePathParts(args[i]))); }   String origFilename = args[argCount++]; Project project = new Project(); BugCollection origCollection; origCollection = new SortedBugCollection(); if (verbose) System.out.println("Starting with " + origFilename);  origCollection.readXML(origFilename, project);  if (commandLine.overrideRevisionNames || origCollection.getReleaseName() == null || origCollection.getReleaseName().length() == 0) origCollection.setReleaseName(firstPathParts[commonPrefix]); for (BugInstance bug : origCollection.getCollection()) if (bug.getLastVersion() >= 0 && bug.getFirstVersion() > bug.getLastVersion()) throw new IllegalStateException("Illegal Version range: " + bug.getFirstVersion() + ".." + bug.getLastVersion());   while (argCount <= (args.length - 1)) {  BugCollection newCollection = new SortedBugCollection();  String newFilename = args[argCount++]; if (verbose) System.out.println("Merging " + newFilename); project = new Project(); try { File f = new File(newFilename); if (f.length() == 0) { if (verbose) System.out.println("Empty input file: " + f); continue; } newCollection.readXML(newFilename, project);   if (commandLine.overrideRevisionNames || newCollection.getReleaseName() == null || newCollection.getReleaseName().length() == 0) newCollection.setReleaseName(getFilePathParts(newFilename)[commonPrefix]);  origCollection = mergeCollections(origCollection, newCollection, true); } catch (IOException e) { if (verbose) System.out.println(e); else throw e; } }  if (commandLine.outputFilename != null) origCollection.writeXML(commandLine.outputFilename, project); else origCollection.writeXML(System.out, project);
new Update().doit(args);
	public static void main(String[] args) throws IOException,			DocumentException {		DetectorFactoryCollection.instance();		UpdateCommandLine commandLine = new UpdateCommandLine();		int argCount = commandLine.parse(args, 2, Integer.MAX_VALUE, USAGE);		if (commandLine.outputFilename == null) verbose = false;		String[] firstPathParts = getFilePathParts(args[argCount]);		int commonPrefix = firstPathParts.length;		for(int i = argCount+1; i <= (args.length - 1); i++) {			commonPrefix = Math.min(commonPrefix, 					lengthCommonPrefix(							firstPathParts, 							getFilePathParts(args[i])));		}						String origFilename = args[argCount++];		Project project = new Project();		BugCollection origCollection;		origCollection = new SortedBugCollection();		if (verbose)			System.out.println("Starting with " + origFilename);		origCollection.readXML(origFilename, project);		if (commandLine.overrideRevisionNames || origCollection.getReleaseName() == null || origCollection.getReleaseName().length() == 0)			origCollection.setReleaseName(firstPathParts[commonPrefix]);		for (BugInstance bug : origCollection.getCollection())			if (bug.getLastVersion() >= 0					&& bug.getFirstVersion() > bug.getLastVersion())				throw new IllegalStateException("Illegal Version range: "						+ bug.getFirstVersion() + ".." + bug.getLastVersion());		while (argCount <= (args.length - 1)) {			BugCollection newCollection = new SortedBugCollection();			String newFilename = args[argCount++];			if (verbose)				System.out.println("Merging " + newFilename);			project = new Project();			try {				File f = new File(newFilename);				if (f.length() == 0) {					if (verbose) System.out.println("Empty input file: " + f);					continue;				}			newCollection.readXML(newFilename, project);			if (commandLine.overrideRevisionNames || newCollection.getReleaseName() == null || newCollection.getReleaseName().length() == 0) 					newCollection.setReleaseName(getFilePathParts(newFilename)[commonPrefix]);			origCollection = mergeCollections(origCollection, newCollection, true);			} catch (IOException e) {				if (verbose) 					System.out.println(e);				else throw e;			}		}		if (commandLine.outputFilename != null) 			origCollection.writeXML(commandLine.outputFilename, project);		else			origCollection.writeXML(System.out, project);	}