IFile bugCollectionFile = FindbugsPlugin.getBugCollectionFile(project);  FileOutput fileOutput = new FileOutput() { public void writeFile(OutputStream os) throws IOException { bugCollection.writeXML(os, findbugsProject); }  public String getTaskDescription() { return "creating XML FindBugs data file"; } };  IO.writeFile(bugCollectionFile, fileOutput, monitor);
writeBugCollection(project, bugCollection, findbugsProject, monitor);
	public static void storeBugCollection(			IProject project,			final SortedBugCollection bugCollection,			final Project findbugsProject,			IProgressMonitor monitor) throws IOException, CoreException {				// Store the bug collection and findbugs project in the session		project.setSessionProperty(SESSION_PROPERTY_BUG_COLLECTION, bugCollection);		project.setSessionProperty(SESSION_PROPERTY_FB_PROJECT, findbugsProject);		// Save to file		IFile bugCollectionFile = FindbugsPlugin.getBugCollectionFile(project);				FileOutput fileOutput = new FileOutput() {			public void writeFile(OutputStream os) throws IOException {				bugCollection.writeXML(os, findbugsProject);			}			public String getTaskDescription() {				return "creating XML FindBugs data file";			}		};		IO.writeFile(bugCollectionFile, fileOutput, monitor);	}