getReady(); if (sorted) { if (addMessages) computeBugHashes(); for(BugInstance bugInstance : getBugCollection().getCollection()) bugInstance.writeXML(xmlOutput, addMessages); } if (addMessages) { writeBugCategories(); writeBugPatterns(); writeBugCodes(); }  getBugCollection().writeEpilogue(xmlOutput);
getBugCollection().writeXML(new OutputStreamXMLOutput(outputStream), getProject());
	public void finish() {		try {			getReady(); // If no warnings were issued, then nothing has been written yet			if (sorted) {				if (addMessages) computeBugHashes();				for(BugInstance bugInstance : getBugCollection().getCollection())					bugInstance.writeXML(xmlOutput, addMessages);			}			if (addMessages) {				writeBugCategories();				writeBugPatterns();				writeBugCodes();			}						getBugCollection().writeEpilogue(xmlOutput);		} catch (IOException e) {			throw new FatalException("Error writing XML output", e);		} finally {			try {				xmlOutput.finish();			} catch (IOException e) {				// Ignore			}		}	}