private void writeXML(Writer out, Project project) throws IOException { Document document = endDocument(project); XMLWriter writer = new XMLWriter(out, OutputFormat.createPrettyPrint()); writer.write(document); }
@Override public void reportMissingClass(ClassNotFoundException ex) { String missing = AbstractBugReporter.getMissingClassName(ex); if (!isValidMissingClassMessage(missing)) { return; } bugCollection.addMissingClass(missing); super.reportMissingClass(ex); }
@Override public void doReportBug(BugInstance bugInstance) { if (bugCollection.add(bugInstance)) { printBug(bugInstance); notifyObservers(bugInstance); } }
public void toElement(BugInstance bugInstance) { String className = bugInstance.getPrimaryClass().getClassName(); Element element = (Element) root.selectSingleNode(FILE_ELEMENT_NAME + "[@classname='" + className + "']"); if (element == null) { element = root.addElement(FILE_ELEMENT_NAME); element.addAttribute("classname", className); } element = element.addElement(ELEMENT_NAME); element.addAttribute("type", bugInstance.getType()); switch (bugInstance.getPriority()) { case Priorities.EXP_PRIORITY: element.addAttribute("priority", "Experimental"); break; case Priorities.LOW_PRIORITY: element.addAttribute("priority", "Low"); break; case Priorities.NORMAL_PRIORITY: element.addAttribute("priority", "Normal"); break; case Priorities.HIGH_PRIORITY: element.addAttribute("priority", "High"); break; default: assert false; } element.addAttribute("message", xmlEscape(bugInstance.getMessage())); SourceLineAnnotation line = bugInstance.getPrimarySourceLineAnnotation(); element.addAttribute("line", Integer.toString(line.getStartLine())); }
break; case XDOCS_REPORTER: textuiBugReporter = new XDocsBugReporter(project); break; default:
@Override public void doReportBug(BugInstance bugInstance) { if (bugCollection.add(bugInstance)) { printBug(bugInstance); notifyObservers(bugInstance); } }
public void toElement(BugInstance bugInstance) { String className = bugInstance.getPrimaryClass().getClassName(); Element element = (Element) root.selectSingleNode(FILE_ELEMENT_NAME + "[@classname='" + className + "']"); if (element == null) { element = root.addElement(FILE_ELEMENT_NAME); element.addAttribute("classname", className); } element = element.addElement(ELEMENT_NAME); element.addAttribute("type", bugInstance.getType()); switch (bugInstance.getPriority()) { case Priorities.EXP_PRIORITY: element.addAttribute("priority", "Experimental"); break; case Priorities.LOW_PRIORITY: element.addAttribute("priority", "Low"); break; case Priorities.NORMAL_PRIORITY: element.addAttribute("priority", "Normal"); break; case Priorities.HIGH_PRIORITY: element.addAttribute("priority", "High"); break; default: assert false; } element.addAttribute("message", xmlEscape(bugInstance.getMessage())); SourceLineAnnotation line = bugInstance.getPrimarySourceLineAnnotation(); element.addAttribute("line", Integer.toString(line.getStartLine())); }
break; case XDOCS_REPORTER: textuiBugReporter = new XDocsBugReporter(project); break; default:
private void writeXML(Writer out, Project project) throws IOException { Document document = endDocument(project); XMLWriter writer = new XMLWriter(out, OutputFormat.createPrettyPrint()); writer.write(document); }
@Override public void reportMissingClass(ClassNotFoundException ex) { String missing = AbstractBugReporter.getMissingClassName(ex); if (!isValidMissingClassMessage(missing)) { return; } bugCollection.addMissingClass(missing); super.reportMissingClass(ex); }