X-Git-Url: http://jaekl.net/gitweb/?p=cfb.git;a=blobdiff_plain;f=prod%2Fnet%2Fjaekl%2Fcfb%2Fanalyze%2FAnalyzer.java;h=03aeb1c6a4db718198e2eca9da9b9538829eab39;hp=5e72fe0499db0b7d2f50c3b67ec09f13eb8b7da8;hb=3c10b6100c6035a65ce37dea846b027135289f67;hpb=88c635ae6a039a873cba2d794c55d726dcdc616d diff --git a/prod/net/jaekl/cfb/analyze/Analyzer.java b/prod/net/jaekl/cfb/analyze/Analyzer.java index 5e72fe0..03aeb1c 100644 --- a/prod/net/jaekl/cfb/analyze/Analyzer.java +++ b/prod/net/jaekl/cfb/analyze/Analyzer.java @@ -17,14 +17,15 @@ import net.jaekl.cfb.util.Command; import net.jaekl.qd.xml.XmlParseException; public class Analyzer { - File m_findbugsDir; + MessageMap m_msgMap; - public Analyzer(File findbugsDir) { - m_findbugsDir = findbugsDir; + public Analyzer(MessageMap msgMap) { + m_msgMap = msgMap; } - public Analysis analyze(PrintWriter pw, File workDir, File fbp) throws IOException, XmlParseException { - Analysis result = new Analysis(); + public Analysis analyze(PrintWriter pw, File workDir, File fbp, String buildNumber) throws IOException, XmlParseException, SAXException + { + Analysis result = new Analysis(buildNumber); File fbOutput = outputWorkFile(workDir, fbp); @@ -45,7 +46,7 @@ public class Analyzer { return null; } - result = parseFbOutput(new InputSource(fbOutput.getAbsolutePath())); + result.parse(new InputSource(fbOutput.getAbsolutePath())); result.dump(pw); return result; } @@ -62,7 +63,7 @@ public class Analyzer { StringBuilder sb = new StringBuilder(); - sb.append(m_findbugsDir.getAbsolutePath()) + sb.append(m_msgMap.getFindBugsDir().getAbsolutePath()) .append(File.separator) .append("bin") .append(File.separator) @@ -95,17 +96,4 @@ public class Analyzer { return new File(workPath + File.separator + projName + ".xml"); } - - // Parse the output.xml that resulted from a FindBugs run, - // and store its findings into an Analysis object. - Analysis parseFbOutput(InputSource fbOutput) throws XmlParseException - { - Analysis result = new Analysis(); - try { - result.parse(fbOutput); - } catch (IOException | SAXException exc) { - throw new XmlParseException(exc); - } - return result; - } }