/** * Format a string describing this bug pattern, with the priority and type * at the beginning. e.g. * "(High Priority Correctness) Guaranteed null pointer dereference..." */ public String getMessageWithPriorityType() { return "(" + this.getPriorityTypeString() + ") " + this.getMessage(); }
public String getMessageWithPriorityTypeAbbreviation() { return this.getPriorityTypeAbbreviation() + " " + this.getMessage(); }
public void setHistory(BugInstance from) { long first = from.getFirstVersion(); long last = from.getLastVersion(); if (first > 0 && last >= 0 && first > last) { throw new IllegalArgumentException("from has version range " + first + "..." + last + " in " + from.getBugPattern() + "\n" + from.getMessage()); } setFirstVersion(first); setLastVersion(last); this.removedByChangeOfPersistingClass = from.removedByChangeOfPersistingClass; this.introducedByChangeOfExistingClass = from.introducedByChangeOfExistingClass; }
element.addElement("LongMessage").addText(bugInstance.getMessage());
outputStream.println(bugInstance.getMessage().replace('\n', ' ') + " " + line.toString());
outputStream.print(fullPath + ":" + lineStart + ":" + lineEnd + " " + bugInstance.getMessage());
int newSize = resultCollection.getCollection().size(); if (newSize != oldSize + 1) { System.out.println("Failed to add bug" + newBug.getMessage());
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())); }
/** * Format a string describing this bug pattern, with the priority and type * at the beginning. e.g. * "(High Priority Correctness) Guaranteed null pointer dereference..." */ public String getMessageWithPriorityType() { return "(" + this.getPriorityTypeString() + ") " + this.getMessage(); }
public String getMessageWithPriorityTypeAbbreviation() { return this.getPriorityTypeAbbreviation() + " " + this.getMessage(); }
private String printBug(BugInstance bug, List<AnalyzerConfig.Path> sources) { final int rank = BugRanker.findRank(bug); final SourceLineAnnotation line = bug.getPrimarySourceLineAnnotation(); final int startLine = line.getStartLine() <= 0 ? 0 : line.getStartLine(); final String msg = bug.getMessage(); final int pos = msg.indexOf(':'); final String message = msg.substring(pos + 2).replace('\n', ' '); return String.format("%2d %-8s %-45s %s:%d %s", rank, priority(bug), bug.getType(), sourcePath(line.getSourcePath(), sources), startLine, message); }
private String printBug(BugInstance bug, List<AnalyzerConfig.Path> sources) { final int rank = BugRanker.findRank(bug); final SourceLineAnnotation line = bug.getPrimarySourceLineAnnotation(); final int startLine = line.getStartLine() <= 0 ? 0 : line.getStartLine(); final String msg = bug.getMessage(); final int pos = msg.indexOf(':'); final String message = msg.substring(pos + 2).replace('\n', ' '); return String.format("%2d %-8s %-45s %s:%d %s", rank, priority(bug), bug.getType(), sourcePath(line.getSourcePath(), sources), startLine, message); }
public void setHistory(BugInstance from) { long first = from.getFirstVersion(); long last = from.getLastVersion(); if (first > 0 && last >= 0 && first > last) { throw new IllegalArgumentException("from has version range " + first + "..." + last + " in " + from.getBugPattern() + "\n" + from.getMessage()); } setFirstVersion(first); setLastVersion(last); this.removedByChangeOfPersistingClass = from.removedByChangeOfPersistingClass; this.introducedByChangeOfExistingClass = from.introducedByChangeOfExistingClass; }
if (claimedBy != null && !plugin.getUser().equals(claimedBy)) { int result = JOptionPane.showConfirmDialog(null, bug.getMessage() + "\n" + claimedBy + " has already said they will fix this issue\n" + "Do you want to also be listed as fixing this issue?\n"
element.addElement("LongMessage").addText(bugInstance.getMessage());
outputStream.print(fullPath + ":" + lineStart + ":" + lineEnd + " " + bugInstance.getMessage());
@Override public void doReportBug(BugInstance bugInstance) { if(includeCategories.size() > 0 && !includeCategories.contains(bugInstance.getCategoryAbbrev())) { return; } StringBuilder bugDetail = new StringBuilder(); bugDetail .append("\n------------------------------------------------------") .append("\nNew Bug Instance: [" + ++bugInstanceCount + "]") .append("\n message=" + bugInstance.getMessage()) .append("\n bugType=" + bugInstance.getBugPattern().getType()) .append(" priority=" + bugInstance.getPriorityString()) .append(" category=" + bugInstance.getCategoryAbbrev()); if (bugInstance.getPrimaryClass() != null) { bugDetail.append("\n class=" + bugInstance.getPrimaryClass().getClassName()); } if (bugInstance.getPrimaryMethod() != null) { bugDetail.append(" method=" + bugInstance.getPrimaryMethod().getMethodName()); } if (bugInstance.getPrimaryField() != null) { bugDetail.append(" field=" + bugInstance.getPrimaryField().getFieldName()); } if (bugInstance.getPrimarySourceLineAnnotation() != null) { bugDetail.append(" line=" + bugInstance.getPrimarySourceLineAnnotation().getStartLine()); } bugDetail.append("\n------------------------------------------------------"); log.info(bugDetail.toString()); //bugCollection.add(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())); }
SourceLineAnnotation sourceLine = warning.getPrimarySourceLineAnnotation(); String message = warning.getMessage(); if (message.contains("TEST: Unknown")) { message = FindBugsMessages.getInstance().getShortMessage(warning.getType(), LocaleProvider.getLocale());
SourceLineAnnotation sourceLine = warning.getPrimarySourceLineAnnotation(); String message = warning.getMessage(); if (message.contains("TEST: Unknown")) { message = FindBugsMessages.getInstance().getShortMessage(warning.getType(), LocaleProvider.getLocale());