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(); } }