/** * Get a string describing the bug priority and type. e.g. * "High Priority Correctness" * * @return a string describing the bug priority and type */ public String getPriorityTypeString() { String priorityString = getPriorityString(); BugPattern bugPattern = this.getBugPattern(); // then get the category and put everything together String categoryString = I18N.instance().getBugCategoryDescription(bugPattern.getCategory()); return priorityString + " Confidence " + categoryString; // TODO: internationalize the word "Confidence" }
private void writeBugCategories(XMLOutput xmlOutput) throws IOException { // Find bug categories reported Set<String> bugCatSet = new HashSet<>(); for (Iterator<BugInstance> i = iterator(); i.hasNext();) { BugInstance bugInstance = i.next(); BugPattern bugPattern = bugInstance.getBugPattern(); bugCatSet.add(bugPattern.getCategory()); } // Emit element describing each reported bug code for (String bugCat : bugCatSet) { String bugCatDescription = I18N.instance().getBugCategoryDescription(bugCat); if (bugCatDescription == null) { continue; } XMLAttributeList attributeList = new XMLAttributeList(); attributeList.addAttribute("category", bugCat); xmlOutput.openTag("BugCategory", attributeList); xmlOutput.openTag("Description"); xmlOutput.writeText(bugCatDescription); xmlOutput.closeTag("Description"); xmlOutput.closeTag("BugCategory"); } }
for (Map.Entry<String, Integer> e : lowRank.entrySet()) { System.out.printf("%4d low ranked %s issues%n", e.getValue(), I18N.instance().getBugCategoryDescription(e.getKey()));
/** * Add BugCategory elements. * * @param bugCategorySet * all bug categories referenced in the BugCollection */ private void addBugCategories(Set<String> bugCategorySet) { Element root = document.getRootElement(); for (String category : bugCategorySet) { Element element = root.addElement("BugCategory"); element.addAttribute("category", category); Element description = element.addElement("Description"); description.setText(I18N.instance().getBugCategoryDescription(category)); BugCategory bc = DetectorFactoryCollection.instance().getBugCategory(category); if (bc != null) { // shouldn't be null String s = bc.getAbbrev(); if (s != null) { Element abbrev = element.addElement("Abbreviation"); abbrev.setText(s); } s = bc.getDetailText(); if (s != null) { Element details = element.addElement("Details"); details.setText(s); } } } }
@Override public String formatValue(String value) { return I18N.instance().getBugCategoryDescription(value); }
private void emitSummaryTable() { PrintStream out = getPrintStream(); out.println("<h2>Summary</h2>"); out.println("<table width=\"100%\">"); out.println("<tr bgcolor=\"#b9b9fe\"><th>Description</th><th>Category</th></tr>"); ColorAlternator colorAlternator = new ColorAlternator(TABLE_COLORS); for (BugPattern bugPattern : bugPatternSet) { out.print("<tr bgcolor=\"" + colorAlternator.nextColor() + "\">"); out.print("<td><a href=\"#" + bugPattern.getType() + "\">" + bugPattern.getAbbrev() + ": " + bugPattern.getShortDescription() + "</a></td>"); out.println("<td>" + I18N.instance().getBugCategoryDescription(bugPattern.getCategory()) + "</td></tr>"); } out.println("</table>"); }
/** * Get a string describing the bug priority and type. e.g. * "High Priority Correctness" * * @return a string describing the bug priority and type */ public String getPriorityTypeString() { String priorityString = getPriorityString(); BugPattern bugPattern = this.getBugPattern(); // then get the category and put everything together String categoryString = I18N.instance().getBugCategoryDescription(bugPattern.getCategory()); return priorityString + " Confidence " + categoryString; // TODO: internationalize the word "Confidence" }
private void writeBugCategories(XMLOutput xmlOutput) throws IOException { // Find bug categories reported Set<String> bugCatSet = new HashSet<String>(); for (Iterator<BugInstance> i = iterator(); i.hasNext();) { BugInstance bugInstance = i.next(); BugPattern bugPattern = bugInstance.getBugPattern(); bugCatSet.add(bugPattern.getCategory()); } // Emit element describing each reported bug code for (String bugCat : bugCatSet) { String bugCatDescription = I18N.instance().getBugCategoryDescription(bugCat); if (bugCatDescription == null) { continue; } XMLAttributeList attributeList = new XMLAttributeList(); attributeList.addAttribute("category", bugCat); xmlOutput.openTag("BugCategory", attributeList); xmlOutput.openTag("Description"); xmlOutput.writeText(bugCatDescription); xmlOutput.closeTag("Description"); xmlOutput.closeTag("BugCategory"); } }
for (Map.Entry<String, Integer> e : lowRank.entrySet()) { System.out.printf("%4d low ranked %s issues%n", e.getValue(), I18N.instance().getBugCategoryDescription(e.getKey()));
/** * Add BugCategory elements. * * @param bugCategorySet * all bug categories referenced in the BugCollection */ private void addBugCategories(Set<String> bugCategorySet) { Element root = document.getRootElement(); for (String category : bugCategorySet) { Element element = root.addElement("BugCategory"); element.addAttribute("category", category); Element description = element.addElement("Description"); description.setText(I18N.instance().getBugCategoryDescription(category)); BugCategory bc = DetectorFactoryCollection.instance().getBugCategory(category); if (bc != null) { // shouldn't be null String s = bc.getAbbrev(); if (s != null) { Element abbrev = element.addElement("Abbreviation"); abbrev.setText(s); } s = bc.getDetailText(); if (s != null) { Element details = element.addElement("Details"); details.setText(s); } } } }