Package edu.umd.cs.findbugs

Examples of edu.umd.cs.findbugs.BugCollection


     */
    public static @CheckForNull
    BugCollection redoAnalysisKeepComments(@Nonnull Project p) {
        requireNonNull(p, "null project");

        BugCollection current = MainFrame.getInstance().getBugCollection();

        Update update = new Update();

        RedoAnalysisCallback ac = new RedoAnalysisCallback();

        AnalyzingDialog.show(p, ac, true);

        if (!ac.finished) {
            return null;
        }
        if (current == null) {
            current =  ac.getBugCollection();
        } else {
            current =  update.mergeCollections(current, ac.getBugCollection(), true, false);
            if (current.hasDeadBugs()) {
                addDeadBugMatcher(current);
            }
        }
        return current;

View Full Code Here


        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                final Project project = BugLoader.loadProject(mainFrame, f);
                final BugCollection bc = project == null ? null : BugLoader.doAnalysis(project);
                mainFrame.updateProjectAndBugCollection(bc);
                mainFrame.setProjectAndBugCollectionInSwingThread(project, bc);
            }
        };
        if (EventQueue.isDispatchThread()) {
View Full Code Here

            return;
        }

        mainFrame.acquireDisplayWait();
        try {
            BugCollection bc = BugLoader.combineBugHistories();
            mainFrame.setBugCollection(bc);
        } finally {
            mainFrame.releaseDisplayWait();
        }
View Full Code Here

        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);
        }
View Full Code Here

                                        "Project settings have been changed.  Perform a new analysis with the changed files?"),
                                        edu.umd.cs.findbugs.L10N.getLocalString("dlg.redo_analysis_question_lbl", "Redo analysis?"),
                                        JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)) {
                    AnalyzingDialog.show(p);
                } else if (!Util.nullSafeEquals(newCloudId, oldCloudId)) {
                    BugCollection bugs = mainFrame.getBugCollection();
                    try {
                        bugs.reinitializeCloud();
                        mainFrame.getComments().updateCloud();
                    } catch (Exception e) {
                        JOptionPane.showMessageDialog(NewProjectWizard.this, "Error loading " + newCloudId + "\n\n"
                                + e.getClass().getSimpleName() + ": " + e.getMessage(),
                                "FindBugs Cloud Error", JOptionPane.ERROR_MESSAGE);
View Full Code Here

            GUISaveState.getInstance().save();
        }
    }

    private Project getCurrentProject() {
        BugCollection bugCollection = MainFrame.getInstance().getBugCollection();
        return bugCollection == null ? null : bugCollection.getProject();
    }
View Full Code Here

        return commentsPane.hasFocus();
    }

    private @CheckForNull Cloud getCloud() {
        MainFrame instance = MainFrame.getInstance();
        BugCollection bugCollection = instance.getBugCollection();
        if (bugCollection == null) {
            return null;
        }
        return bugCollection.getCloud();
    }
View Full Code Here

        public void run() {
            if (project == null) {
                throw new NullPointerException("null project");
            }

            BugCollection data;
            try {
                data = BugLoader.doAnalysis(project, AnalyzingDialog.this);
            } catch (InterruptedException e) {
                callback.analysisInterrupted();
                // We don't have to clean up the dialog because the
View Full Code Here

     */
    private void work(final IProject project, final String fileName) {
        FindBugsJob runFindBugs = new FindBugsJob("Saving FindBugs XML data to " + fileName + "...", project) {
            @Override
            protected void runWithProgress(IProgressMonitor monitor) throws CoreException {
                BugCollection bugCollection = FindbugsPlugin.getBugCollection(project, monitor);
                try {
                    bugCollection.writeXML(fileName);
                } catch (IOException e) {
                    CoreException ex = new CoreException(FindbugsPlugin.createErrorStatus(
                            "Can't write FindBugs bug collection from project " + project + " to file " + fileName, e));
                    throw ex;
                }
View Full Code Here

            FindbugsPlugin.getDefault().logError("Marker does not contain unique id for warning");
            return null;
        }

        try {
            BugCollection bugCollection = FindbugsPlugin.getBugCollection(project, null);
            if (bugCollection == null) {
                FindbugsPlugin.getDefault().logError("Could not get BugCollection for FindBugs marker");
                return null;
            }

            String bugType = (String) marker.getAttribute(FindBugsMarker.BUG_TYPE);
            Integer primaryLineNumber = (Integer) marker.getAttribute(FindBugsMarker.PRIMARY_LINE);

            // compatibility
            if (primaryLineNumber == null) {
                primaryLineNumber = Integer.valueOf(getEditorLine(marker));
            }

            if (bugType == null) {
                FindbugsPlugin.getDefault().logError(
                        "Could not get find attributes for marker " + marker + ": (" + bugId + ", " + primaryLineNumber + ")");
                return null;
            }
            BugInstance bug = bugCollection.findBug(bugId, bugType, primaryLineNumber.intValue());
            if(bug == null) {
                FindbugsPlugin.getDefault().logError(
                        "Could not get find bug for marker on " + resource + ": (" + bugId + ", " + primaryLineNumber + ")");
                return null;
            }
View Full Code Here

TOP

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

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.