/** * Convert to String. This method returns the "short" message describing the * bug, as opposed to the longer format returned by getMessage(). The short * format is appropriate for the tree view in a GUI, where the annotations * are listed separately as part of the overall bug instance. */ @Override public String toString() { return I18N.instance().getShortMessage(type); }
@Override public String toString() { String desc = description; if (DEFAULT_ROLE.equals(desc) && isUnknown()) { desc = DEFAULT_ROLE_UNKNOWN_LINE; } String pattern = I18N.instance().getAnnotationDescription(desc); FindBugsMessageFormat format = new FindBugsMessageFormat(pattern); return format.format(new BugAnnotation[] { this }, null); }
@Override public String toString() { String pattern = I18N.instance().getAnnotationDescription(roleDescription); FindBugsMessageFormat format = new FindBugsMessageFormat(pattern); return format.format(new BugAnnotation[] { this }, null); }
@Override public String toString() { String pattern = I18N.instance().getAnnotationDescription(description); FindBugsMessageFormat format = new FindBugsMessageFormat(pattern); return format.format(new BugAnnotation[] { this }, null); }
@Override public String toString(ClassAnnotation primaryClass) { String pattern = I18N.instance().getAnnotationDescription(description); FindBugsMessageFormat format = new FindBugsMessageFormat(pattern); return format.format(new BugAnnotation[] { this }, primaryClass); }
@Override public String toString() { String pattern = I18N.instance().getAnnotationDescription(description); FindBugsMessageFormat format = new FindBugsMessageFormat(pattern); return format.format(new BugAnnotation[] { this }, null); }
@Override public String toString() { String pattern = I18N.instance().getAnnotationDescription(description); FindBugsMessageFormat format = new FindBugsMessageFormat(pattern); return format.format(new BugAnnotation[] { this }, null); }
/** * Add BugCode elements. * * @param bugCodeSet * all bug codes (abbrevs) referenced in the BugCollection */ private void addBugCodes(Set<String> bugCodeSet) { Element root = document.getRootElement(); for (String bugCode : bugCodeSet) { Element element = root.addElement("BugCode"); element.addAttribute("abbrev", bugCode); Element description = element.addElement("Description"); description.setText(I18N.instance().getBugTypeDescription(bugCode)); } }
/** * 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().getShortMessageWithoutCode(value); } },
/** * Convert to String. This method returns the "short" message describing the * bug, as opposed to the longer format returned by getMessage(). The short * format is appropriate for the tree view in a GUI, where the annotations * are listed separately as part of the overall bug instance. */ @Override public String toString() { return I18N.instance().getShortMessage(type); }
private void addDesignationKey(String argument) { I18N i18n = I18N.instance(); for (String x : argument.split("[,|]")) { for (String designationKey : i18n.getUserDesignationKeys()) { if (designationKey.equals(x) || i18n.getUserDesignation(designationKey).equals(x)) { this.designationKey.add(designationKey); break; } } } }
@Override public String toString() { String pattern = I18N.instance().getAnnotationDescription(roleDescription); FindBugsMessageFormat format = new FindBugsMessageFormat(pattern); return format.format(new BugAnnotation[] { this }, null); }
@Override public String toString() { String desc = description; if (DEFAULT_ROLE.equals(desc) && isUnknown()) { desc = DEFAULT_ROLE_UNKNOWN_LINE; } String pattern = I18N.instance().getAnnotationDescription(desc); FindBugsMessageFormat format = new FindBugsMessageFormat(pattern); return format.format(new BugAnnotation[] { this }, null); }
@Override public String toString() { String pattern = I18N.instance().getAnnotationDescription(description); FindBugsMessageFormat format = new FindBugsMessageFormat(pattern); return format.format(new BugAnnotation[] { this }, null); }
@Override public String toString() { String pattern = I18N.instance().getAnnotationDescription(description); FindBugsMessageFormat format = new FindBugsMessageFormat(pattern); return format.format(new BugAnnotation[] { this }, null); }
@Override public String toString() { String pattern = I18N.instance().getAnnotationDescription(description); FindBugsMessageFormat format = new FindBugsMessageFormat(pattern); return format.format(new BugAnnotation[] { this }, null); }