public static void main(String args[]) throws Exception { if (args.length > 1 || (args.length > 0 && "-help".equals(args[0]))) { System.err.println("Usage: " + FileBugHash.class.getName() + " [<infile>]"); System.exit(1); } BugCollection origCollection = new SortedBugCollection(); int argCount = 0; if (argCount == args.length) { origCollection.readXML(System.in); } else { origCollection.readXML(args[argCount]); } FileBugHash result = compute(origCollection); for (String sourceFile : result.getSourceFiles()) { System.out.println(result.getHash(sourceFile) + "\t" + sourceFile); } }
/** * @param baseline * @throws IOException * @throws DocumentException */ public static void addToExcludedInstanceHashes(Set<String> instanceHashesToExclude, String baseline) throws IOException, DocumentException { Project project = new Project(); BugCollection origCollection; origCollection = new SortedBugCollection(project); origCollection.readXML(baseline); for (BugInstance b : origCollection.getCollection()) { instanceHashesToExclude.add(b.getInstanceHash()); } }
public static void xslt(String stylesheet, boolean applySuppression, String[] args, int argCount) throws Exception { Project proj = new Project(); HTMLBugReporter reporter = new HTMLBugReporter(proj, stylesheet); BugCollection bugCollection = reporter.getBugCollection(); bugCollection.setApplySuppressions(applySuppression); if (argCount < args.length) { bugCollection.readXML(args[argCount++]); } else { bugCollection.readXML(System.in); } if (argCount < args.length) { reporter.setOutputStream(UTF8.printStream(new FileOutputStream(args[argCount++]), true)); } reporter.finish(); Exception e = reporter.getFatalException(); if (e != null) { throw e; } }
public AddAnnotation(String resultsFile, String annotation) throws IOException, DocumentException { this(new SortedBugCollection(), annotation); bugCollection.readXML(resultsFile); }
public static void main(String args[]) throws Exception { if (args.length > 1 || (args.length > 0 && "-help".equals(args[0]))) { System.err.println("Usage: " + FileBugHash.class.getName() + " [<infile>]"); System.exit(1); } BugCollection origCollection = new SortedBugCollection(); int argCount = 0; if (argCount == args.length) { origCollection.readXML(System.in); } else { origCollection.readXML(args[argCount]); } FileBugHash result = compute(origCollection); for (String sourceFile : result.getSourceFiles()) { System.out.println(result.getHash(sourceFile) + "\t" + sourceFile); } }
/** * Scan bug instances contained in given file, reporting those whose text * annotations contain at least one of the keywords in the query. * * @param filename * an XML file containing bug instances */ public void scan(String filename) throws Exception { BugCollection bugCollection = new SortedBugCollection(); bugCollection.readXML(filename); scan(bugCollection, filename); }
/** * @param baseline * @throws IOException * @throws DocumentException */ public static void addToExcludedInstanceHashes(Set<String> instanceHashesToExclude, String baseline) throws IOException, DocumentException { Project project = new Project(); BugCollection origCollection; origCollection = new SortedBugCollection(project); origCollection.readXML(baseline); for (BugInstance b : origCollection.getCollection()) { instanceHashesToExclude.add(b.getInstanceHash()); } }
public static void main(String[] args) throws IOException, DocumentException { FindBugs.setNoAnalysis(); DetectorFactoryCollection.instance(); if (args.length > 1) { System.out.println(USAGE); return; } BugCollection bugs = new SortedBugCollection(); if (args.length == 0) { bugs.readXML(System.in); } else { bugs.readXML(args[0]); } bugs.getCloud().waitUntilIssueDataDownloaded(); PrintWriter out = UTF8.printWriter(System.out); bugs.getCloud().printCloudSummary(out, bugs, new String[0]); out.close(); } }
public static void xslt(String stylesheet, boolean applySuppression, String[] args, int argCount) throws Exception { Project proj = new Project(); HTMLBugReporter reporter = new HTMLBugReporter(proj, stylesheet); BugCollection bugCollection = reporter.getBugCollection(); bugCollection.setApplySuppressions(applySuppression); if (argCount < args.length) { bugCollection.readXML(args[argCount++]); } else { bugCollection.readXML(System.in); } if (argCount < args.length) { reporter.setOutputStream(UTF8.printStream(new FileOutputStream(args[argCount++]), true)); } reporter.finish(); Exception e = reporter.getFatalException(); if (e != null) { throw e; } }
if(findbugsReport.exists() && findbugsReport.length() > 0) { LOG.info("FindBugs report is already generated {}. Reusing the report.",findbugsReport.getAbsolutePath()); xmlBugReporter.getBugCollection().readXML(new FileReader(findbugsReport)); foundExistingReport = true; break reportPaths;
origCollection.readXML(args[0]); SourceFinder sourceFinder = new SourceFinder(origCollection.getProject());