BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(outputFilename));
OutputStream out; if (outputFilename.equals("-")) { out = System.out; } else { out = new BufferedOutputStream(new FileOutputStream(outputFilename)); }
	public void execute() throws IOException, DocumentException {		bugCollection.readXML(inputFilename, project);		Document document = DocumentFactory.getInstance().createDocument();		Dom4JXMLOutput xmlOutput = new Dom4JXMLOutput(document);		bugCollection.writeXML(xmlOutput, project);				int count = 0;				List bugInstanceList = document.selectNodes("/BugCollection/BugInstance");		for (Iterator i = bugInstanceList.iterator(); i.hasNext(); ) {			Element element = (Element) i.next();			Attribute uidAttr = element.attribute("uid");			if (uidAttr == null) {				element.addAttribute("uid", new Integer(count++).toString());			}		}				BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(outputFilename));		XMLWriter xmlWriter = new XMLWriter(out, OutputFormat.createPrettyPrint());		xmlWriter.write(document);	}