Package edu.umd.cs.findbugs.cloud

Examples of edu.umd.cs.findbugs.cloud.Cloud


        PreferencesFrame.getInstance().setLocationRelativeTo(this);
        PreferencesFrame.getInstance().setVisible(true);
    }

    public void displayCloudReport() {
        Cloud cloud = this.bugCollection.getCloud();
        cloud.waitUntilIssueDataDownloaded();
        StringWriter stringWriter = new StringWriter();
        PrintWriter writer = new PrintWriter(stringWriter);
        cloud.printCloudSummary(writer, getDisplayedBugs(), viewFilter.getPackagePrefixes());
        writer.close();
        String report = stringWriter.toString();
        DisplayNonmodelMessage.displayNonmodelMessage("Cloud summary", report, this, false);

    }
View Full Code Here


        JMenuItem toggleItem = new JMenuItem(text);

        toggleItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                Cloud cloud = getBugCollection().getCloud();
                if (cloud instanceof DoNothingCloud) {
                    JOptionPane.showMessageDialog(MainFrame.this, "No cloud selected; enable and select optional Bug Collection XML Pseudo-Cloud plugin to store designations in XML");
                } else if (comments.canSetDesignations()) {
                    comments.setDesignation(key);
                } else {
View Full Code Here

            mainFrameTree.rebuildBugTreeIfSortablesDependOnCloud();
        }

        @Override
        public void handleStateChange(SigninState oldState, SigninState state) {
            Cloud cloud = MainFrame.this.bugCollection.getCloudLazily();
            if (cloud != null && cloud.isInitialized()) {
                mainFrameTree.rebuildBugTreeIfSortablesDependOnCloud();
            }
        }
View Full Code Here

            bugCollection.reinitializeCloud();
        }
    }

    public void sync() {
        Cloud cloud = bugCollection.getCloud();
        cloud.initiateCommunication();
        cloud.waitUntilIssueDataDownloaded();
    }
View Full Code Here

    public void report(PrintWriter out) {
        TreeMap<BugRankCategory, Stats> stats = new TreeMap<BugRankCategory, Stats>();
        ProjectStats projectStats = bugCollection.getProjectStats();
        Collection<BugInstance> bugs = bugCollection.getCollection();
        Cloud cloud = bugCollection.getCloud();
        cloud.setMode(Cloud.Mode.COMMUNAL);

        out.printf("Cloud sync and summary report for %s%n", bugCollection.getProject().getProjectName());

        out.printf("Code dated %s%n", new Date(bugCollection.getTimestamp()));
        out.printf("Code analyzed %s%n", new Date(bugCollection.getAnalysisTimestamp()));

        out.printf("%7d total classes%n", projectStats.getNumClasses());
        out.printf("%7d total issues%n", bugs.size());
        long recentTimestamp = System.currentTimeMillis() - options.ageInHours * 3600 * 1000L;
        int allRecentIssues = 0;

        for (BugInstance b : bugs) {
            Stats s = stats.get(BugRankCategory.getRank(b.getBugRank()));
            if (s == null) {
                s = new Stats();
                stats.put(BugRankCategory.getRank(b.getBugRank()), s);
            }
            s.total++;
            long firstSeen = cloud.getFirstSeen(b);
            if (firstSeen > recentTimestamp) {
                s.recent++;
                allRecentIssues++;
            }

        }
        out.printf("%7d recent issues%n", allRecentIssues);

        if (options.cloudSummary != null && cloud.supportsCloudSummaries()) {
            try {
                PrintWriter cs = UserTextFile.printWriter(options.cloudSummary);
                cs.printf("%6s %6s %s%n", "recent", "total", "Rank category");
                for (Entry<BugRankCategory, Stats> e : stats.entrySet()) {
                    Stats s = e.getValue();
                    if (s.total > 0) {
                        cs.printf("%6d %6d %s%n", s.recent, s.total, e.getKey());
                    }
                }
                cs.println();
                cloud.printCloudSummary(cs, bugs, null);
                cs.close();
            } catch (Exception e) {
                out.println("Error writing cloud summary to " + options.cloudSummary);
                e.printStackTrace(out);
            }
View Full Code Here

        }

    }

    public void shutdown() {
        Cloud cloud = bugCollection.getCloud();
        cloud.shutdown();
    }
View Full Code Here

    void setSourceTab(String title, @CheckForNull BugInstance bug) {
        JComponent label = mainFrame.getGuiLayout().getSourceViewComponent();
        if (label != null) {
            URL u = null;
            if (bug != null) {
                Cloud plugin = mainFrame.getBugCollection().getCloud();
                if (plugin.supportsSourceLinks()) {
                    u = plugin.getSourceLink(bug);
                }
            }
            if (u != null) {
                addLink(label, u);
            } else {
View Full Code Here

                }
            });
        }
        component.setCursor(new Cursor(Cursor.HAND_CURSOR));
        Cloud plugin = mainFrame.getBugCollection().getCloud();
        if (plugin != null) {
            component.setToolTipText(plugin.getSourceLinkToolTip(null));
        }

    }
View Full Code Here

        MainFrame.getInstance().setProjectAndBugCollectionInSwingThread(project, col);
        return col;
    }

    private static void initiateCommunication(SortedBugCollection col) {
        Cloud cloud = col.getCloud();
        cloud.initiateCommunication();
    }
View Full Code Here

    @Override
    public @Nonnull Cloud getCloud() {
        if (shouldNotUsePlugin) {
            return CloudFactory.getPlainCloud(this);
        }
        Cloud result = cloud;
        if (result == null) {
            IGuiCallback callback = getProject().getGuiCallback();
            result = cloud = CloudFactory.createCloudWithoutInitializing(this);
            try {
                CloudFactory.initializeCloud(this, result);
            } catch (Exception e) {
                LOGGER.log(Level.SEVERE, "Could not load cloud plugin "+ result.getCloudName(), e);
                callback.showMessageDialog("Unable to connect to " + result.getCloudName() + ": " + Util.getNetworkErrorMessage(e));
                if (CloudFactory.FAIL_ON_CLOUD_ERROR) {
                    throw new IllegalStateException("Could not load FindBugs Cloud plugin - to avoid this message, " +
                            "set -D" + CloudFactory.FAIL_ON_CLOUD_ERROR_PROP + "=false", e);
                }
                result = cloud = CloudFactory.getPlainCloud(this);
            }
            callback.registerCloud(getProject(), this, result);


        }
        if (!result.isInitialized()) {
            LOGGER.log(Level.SEVERE, "Cloud " + result.getCloudName() + " is not initialized ");
        }
        if (bugsPopulated) {
            result.bugsPopulated();
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.cloud.Cloud

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.