public String getDetailHTML(String detailText) { StringBuilder buf = new StringBuilder(); buf.append("<!DOCTYPE HTML\">\n"); buf.append("<HTML><HEAD><TITLE>"); buf.append(getShortDescription()); buf.append("</TITLE></HEAD><BODY><H1>"); buf.append(wrapInDescriptionLink(getShortDescription())); buf.append("</H1>\n"); buf.append(detailText); buf.append("</BODY></HTML>\n"); return buf.toString(); }
public @Nonnull String getShortMessageWithoutCode(String key) { BugPattern bugPattern = DetectorFactoryCollection.instance().lookupBugPattern(key); if (bugPattern == null) { return L10N.getLocalString("err.missing_pattern", "Error: missing bug pattern for key") + " " + key; } return bugPattern.getShortDescription(); }
public String getAbridgedMessage() { BugPattern bugPattern = getBugPattern(); String pattern = getLongDescription().replaceAll(" in \\{1\\}", ""); String shortPattern = bugPattern.getShortDescription(); try { FindBugsMessageFormat format = new FindBugsMessageFormat(pattern); return format.format(annotationList.toArray(new BugAnnotation[annotationList.size()]), getPrimaryClass(), true); } catch (RuntimeException e) { AnalysisContext.logError("Error generating bug msg ", e); return shortPattern + " [Error3 generating customized description]"; } }
/** * Get a short message string. This is a concrete string (not a format * pattern) which briefly describes the type of bug, without mentioning * particular a particular class/method/field. * * @param key * which short message to retrieve */ public @Nonnull String getShortMessage(String key) { BugPattern bugPattern = DetectorFactoryCollection.instance().lookupBugPattern(key); if (bugPattern == null) { return L10N.getLocalString("err.missing_pattern", "Error: missing bug pattern for key") + " " + key; } return bugPattern.getAbbrev() + ": " + bugPattern.getShortDescription(); }
/** * Format a string describing this bug instance. * * @return the description */ @Nonnull public String getMessageWithoutPrefix() { BugPattern bugPattern = getBugPattern(); String pattern, shortPattern; pattern = getLongDescription(); shortPattern = bugPattern.getShortDescription(); try { FindBugsMessageFormat format = new FindBugsMessageFormat(pattern); return format.format(annotationList.toArray(new BugAnnotation[annotationList.size()]), getPrimaryClass()); } catch (RuntimeException e) { AnalysisContext.logError("Error generating bug msg ", e); return shortPattern + " [Error generating customized description]"; } }
bugCodeSet.add(bugPattern.getAbbrev()); element.addElement("ShortMessage").addText(bugPattern.getShortDescription()); element.addElement("LongMessage").addText(bugInstance.getMessage());
/** * Format a string describing this bug instance. * * @return the description */ public String getMessage() { BugPattern bugPattern = getBugPattern(); String pattern = bugPattern.getAbbrev() + ": " + getLongDescription(); FindBugsMessageFormat format = new FindBugsMessageFormat(pattern); try { return format.format(annotationList.toArray(new BugAnnotation[annotationList.size()]), getPrimaryClass()); } catch (RuntimeException e) { AnalysisContext.logError("Error generating bug msg ", e); return bugPattern.getShortDescription() + " [Error generating customized description]"; } }
private void addBugPatterns(Set<String> bugTypeSet) { Element root = document.getRootElement(); for (String bugType : bugTypeSet) { BugPattern bugPattern = DetectorFactoryCollection.instance().lookupBugPattern(bugType); if (bugPattern == null) { continue; } Element details = root.addElement("BugPattern"); details.addAttribute("type", bugType).addAttribute("abbrev", bugPattern.getAbbrev()) .addAttribute("category", bugPattern.getCategory()); details.addElement("ShortDescription").addText(bugPattern.getShortDescription()); details.addElement("Details").addCDATA(bugPattern.getDetailText()); } }
xmlOutput.writeText(bugPattern.getShortDescription()); xmlOutput.closeTag("ShortMessage");
xmlOutput.writeText(bugPattern.getShortDescription()); xmlOutput.closeTag("ShortDescription");
public String getDetailHTML(String detailText) { StringBuilder buf = new StringBuilder(); buf.append("<!DOCTYPE HTML\">\n"); buf.append("<HTML><HEAD><TITLE>"); buf.append(getShortDescription()); buf.append("</TITLE></HEAD><BODY><H1>"); buf.append(wrapInDescriptionLink(getShortDescription())); buf.append("</H1>\n"); buf.append(detailText); buf.append("</BODY></HTML>\n"); return buf.toString(); }
@Override protected void emit(BugPattern bugPattern) throws IOException { out.println("<h2>" + bugPattern.getAbbrev() + ": " + bugPattern.getShortDescription() + "</h2>"); out.println(bugPattern.getDetailText()); }
public @Nonnull String getShortMessageWithoutCode(String key) { BugPattern bugPattern = DetectorFactoryCollection.instance().lookupBugPattern(key); if (bugPattern == null) { return L10N.getLocalString("err.missing_pattern", "Error: missing bug pattern for key") + " " + key; } return bugPattern.getShortDescription(); }
private void emitBugDescriptions() { PrintStream out = getPrintStream(); out.println("<h2>Descriptions</h2>"); for (BugPattern bugPattern : bugPatternSet) { out.println("<h3><a name=\"" + bugPattern.getType() + "\">" + bugPattern.getAbbrev() + ": " + bugPattern.getShortDescription() + " (" + bugPattern.getType() + ")" + "</a></h3>"); out.println(bugPattern.getDetailText()); } }
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>"); }
public String getAbridgedMessage() { BugPattern bugPattern = getBugPattern(); String pattern = getLongDescription().replaceAll(" in \\{1\\}", ""); String shortPattern = bugPattern.getShortDescription(); try { FindBugsMessageFormat format = new FindBugsMessageFormat(pattern); return format.format(annotationList.toArray(new BugAnnotation[annotationList.size()]), getPrimaryClass(), true); } catch (RuntimeException e) { AnalysisContext.logError("Error generating bug msg ", e); return shortPattern + " [Error3 generating customized description]"; } }
/** * Get a short message string. This is a concrete string (not a format * pattern) which briefly describes the type of bug, without mentioning * particular a particular class/method/field. * * @param key * which short message to retrieve */ public @Nonnull String getShortMessage(String key) { BugPattern bugPattern = DetectorFactoryCollection.instance().lookupBugPattern(key); if (bugPattern == null) { return L10N.getLocalString("err.missing_pattern", "Error: missing bug pattern for key") + " " + key; } return bugPattern.getAbbrev() + ": " + bugPattern.getShortDescription(); }
/** * Format a string describing this bug instance. * * @return the description */ @Nonnull public String getMessageWithoutPrefix() { BugPattern bugPattern = getBugPattern(); String pattern, shortPattern; pattern = getLongDescription(); shortPattern = bugPattern.getShortDescription(); try { FindBugsMessageFormat format = new FindBugsMessageFormat(pattern); return format.format(annotationList.toArray(new BugAnnotation[annotationList.size()]), getPrimaryClass()); } catch (RuntimeException e) { AnalysisContext.logError("Error generating bug msg ", e); return shortPattern + " [Error generating customized description]"; } }
/** * Format a string describing this bug instance. * * @return the description */ public String getMessage() { BugPattern bugPattern = getBugPattern(); String pattern = bugPattern.getAbbrev() + ": " + getLongDescription(); FindBugsMessageFormat format = new FindBugsMessageFormat(pattern); try { return format.format(annotationList.toArray(new BugAnnotation[annotationList.size()]), getPrimaryClass()); } catch (RuntimeException e) { AnalysisContext.logError("Error generating bug msg ", e); return bugPattern.getShortDescription() + " [Error generating customized description]"; } }
private void addBugPatterns(Set<String> bugTypeSet) { Element root = document.getRootElement(); for (String bugType : bugTypeSet) { BugPattern bugPattern = DetectorFactoryCollection.instance().lookupBugPattern(bugType); if (bugPattern == null) { continue; } Element details = root.addElement("BugPattern"); details.addAttribute("type", bugType).addAttribute("abbrev", bugPattern.getAbbrev()) .addAttribute("category", bugPattern.getCategory()); details.addElement("ShortDescription").addText(bugPattern.getShortDescription()); details.addElement("Details").addCDATA(bugPattern.getDetailText()); } }