public final void reportBugsFromXml(@WillClose InputStream in, Project theProject)
     throws IOException, DocumentException {
   SortedBugCollection theCollection = new SortedBugCollection(theProject);
   theCollection.readXML(in);
   for (BugInstance bug : theCollection.getCollection()) {
     doReportBug(bug);
   }
 }
Ejemplo n.º 2
0
 private SortedBugCollection readXml(final InputStream file)
     throws IOException, DocumentException {
   SaxSetup sax = new SaxSetup();
   ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
   try {
     Thread.currentThread().setContextClassLoader(FindBugsParser.class.getClassLoader());
     SortedBugCollection collection = new SortedBugCollection();
     collection.readXML(file);
     return collection;
   } finally {
     Thread.currentThread().setContextClassLoader(contextClassLoader);
     sax.cleanup();
   }
 }