BugCollection nCollection = newCollection;
	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);		int lastInputfile = args.length - 1;		if (outputFilename == null && args.length - argCount == 3) {			outputFilename = args[args.length - 1];			lastInputfile--;		}		verbose = outputFilename != null;		String origFileName = args[argCount++];		BugCollection origCollection;		origCollection = new SortedBugCollection(				SortedBugCollection.MultiversionBugInstanceComparator.instance);		BugCollection oCollection = origCollection;		origCollection.readXML(origFileName, new Project());		for (BugInstance bug : origCollection.getCollection())			if (bug.getLastVersion() >= 0					&& bug.getFirstVersion() > bug.getLastVersion())				throw new IllegalStateException("Illegal Version range: "						+ bug.getFirstVersion() + ".." + bug.getLastVersion());		Project currentProject = new Project();		while (argCount <= lastInputfile) {			BugCollection newCollection = new SortedBugCollection(					SortedBugCollection.MultiversionBugInstanceComparator.instance);			BugCollection nCollection = newCollection;			String newFilename = args[argCount++];			if (verbose)				System.out.println("Merging " + newFilename);			newCollection.readXML(newFilename, currentProject);			if (commandLine.revisionName != null)				newCollection.setReleaseName(commandLine.revisionName);			if (commandLine.revisionTimestamp != 0)				newCollection.setTimestamp(commandLine.revisionTimestamp);			origCollection = mergeCollections(origCollection, newCollection);		}		if (outputFilename != null) 			origCollection.writeXML(outputFilename, currentProject);		else			origCollection.writeXML(System.out, currentProject);	}