Package edu.umd.cs.findbugs

Examples of edu.umd.cs.findbugs.BugCollectionBugReporter


     * @throws IOException
     */
    public static BugCollection doAnalysis(@Nonnull Project p, FindBugsProgress progressCallback) throws IOException,
    InterruptedException {
        StringWriter stringWriter = new StringWriter();
        BugCollectionBugReporter pcb = new BugCollectionBugReporter(p, new PrintWriter(stringWriter, true));
        pcb.setPriorityThreshold(Priorities.NORMAL_PRIORITY);
        IFindBugsEngine fb = createEngine(p, pcb);
        fb.setUserPreferences(getUserPreferences());
        fb.setProgressCallback(progressCallback);
        fb.setProjectName(p.getProjectName());

        fb.execute();
        String warnings = stringWriter.toString();
        if (warnings.length() > 0) {
            JTextArea tp = new JTextArea(warnings);
            tp.setEditable(false);
            JScrollPane pane = new JScrollPane(tp);
            pane.setPreferredSize(new Dimension(600, 400));
            JOptionPane.showMessageDialog(MainFrame.getInstance(),
                    pane, "Analysis errors",
                    JOptionPane.WARNING_MESSAGE);
        }

        return pcb.getBugCollection();
    }
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.BugCollectionBugReporter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.