Package edu.umd.cs.findbugs

Examples of edu.umd.cs.findbugs.SortedBugCollection


        Churn churn = new Churn();
        ChurnCommandLine commandLine = churn.new ChurnCommandLine();
        int argCount = commandLine
                .parse(args, 0, 2, "Usage: " + Churn.class.getName() + " [options] [<xml results> [<history]] ");

        SortedBugCollection bugCollection = new SortedBugCollection();
        if (argCount < args.length) {
            bugCollection.readXML(args[argCount++]);
        } else {
            bugCollection.readXML(System.in);
        }
        churn.setBugCollection(bugCollection);
        churn.execute();
        PrintStream out = System.out;
        try {
View Full Code Here


        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();

    }
View Full Code Here

        DetectorFactoryCollection.instance(); // load plugins

        CommandLine commandLine = new CommandLine();
        int argCount = commandLine.parse(args, 0, 2, "Usage: " + TestingGround.class.getName() + " [options] [<xml results>] ");

        SortedBugCollection bugCollection = new SortedBugCollection();
        if (argCount < args.length) {
            bugCollection.readXML(args[argCount++]);
        } else {
            bugCollection.readXML(System.in);
        }
        ArrayList<Bag<String>> live = new ArrayList<Bag<String>>();
        ArrayList<Bag<String>> died = new ArrayList<Bag<String>>();
        Bag<String> allBugs = new Bag<String>();
        for (int i = 0; i <= bugCollection.getSequenceNumber(); i++) {
            live.add(new Bag<String>());
            died.add(new Bag<String>());
        }
        for (BugInstance b : bugCollection) {
            int first = (int) b.getFirstVersion();
            int buried = (int) b.getLastVersion() + 1;
            int finish = buried;
            if (finish == 0) {
                finish = (int) bugCollection.getSequenceNumber();
            }

            String bugPattern = b.getBugPattern().getType();
            allBugs.add(bugPattern);

            for (int i = first; i <= finish; i++) {
                live.get(i).add(bugPattern);
            }
            if (buried > 0) {
                died.get(buried).add(bugPattern);
            }
        }
        for (int i = 0; i < bugCollection.getSequenceNumber(); i++) {
            for (Map.Entry<String, Integer> e : died.get(i).entrySet()) {
                Integer buried = e.getValue();
                int total = live.get(i).getCount(e.getKey());
                if (buried > 30 && buried * 3 > total) {
                    System.out.printf("%d/%d died at %d for %s%n", buried, total, i, e.getKey());
                }
            }

        }
        SortedBugCollection results = bugCollection.createEmptyCollectionWithMetadata();
        for (BugInstance b : bugCollection) {
            int buried = (int) b.getLastVersion() + 1;
            String bugPattern = b.getBugPattern().getType();

            if (buried > 0) {
                int buriedCount = died.get(buried).getCount(bugPattern);
                int total = live.get(buried).getCount(bugPattern);
                if (buriedCount > 30 && buriedCount * 3 > total) {
                    continue;
                }
            }
            int survied = live.get((int) bugCollection.getSequenceNumber()).getCount(bugPattern);
            if (survied == 0 && allBugs.getCount(bugPattern) > 100) {
                continue;
            }

            results.add(b, false);
        }
        if (argCount == args.length) {
            results.writeXML(System.out);
        } else {
            results.writeXML(args[argCount++]);

        }

    }
View Full Code Here

    public static void main(String[] args) throws Exception {
        FindBugs.setNoAnalysis();
        DetectorFactoryCollection.instance(); // load plugins

        SortedBugCollection bugCollection = new SortedBugCollection();
        int argCount = 0;
        if (argCount < args.length) {
            bugCollection.readXML(args[argCount++]);
        } else {
            bugCollection.readXML(System.in);
        }

        new TreemapVisualization().generateTreeMap(bugCollection);

    }
View Full Code Here

        if (args.length != 2) {
            System.err.println("Usage: " + RegenerateClassFeatures.class.getName() + " <bug collection> <jar file>");
            System.exit(1);
        }

        SortedBugCollection bugCollection = new SortedBugCollection();

        bugCollection.readXML(args[0]);

        new RegenerateClassFeatures(bugCollection, args[1]).execute();

        bugCollection.writeXML(System.out);
    }
View Full Code Here

    SortedBugCollection loadBugs(MainFrame mainFrame, Project project, File source) {
        if (!source.isFile() || !source.canRead()) {
            JOptionPane.showMessageDialog(mainFrame, "Unable to read " + source);
            return null;
        }
        SortedBugCollection col = new SortedBugCollection(project);
        try {
            col.readXML(source);
            initiateCommunication(col);
            if (col.hasDeadBugs()) {
                addDeadBugMatcher(col);
            }
        } catch (Exception e) {
            e.printStackTrace();
            JOptionPane.showMessageDialog(mainFrame, "Could not read " + source + "; " + e.getMessage());
View Full Code Here

    }

    public static @CheckForNull
    SortedBugCollection loadBugs(MainFrame mainFrame, Project project, URL url) {

        SortedBugCollection col = new SortedBugCollection(project);
        try {
            if (MainFrame.GUI2_DEBUG) {
                System.out.println("loading from: " + url);
                JOptionPane.showMessageDialog(mainFrame, "loading from: " + url);

            }
            col.readXML(url);
            if (MainFrame.GUI2_DEBUG) {
                System.out.println("finished reading: " + url);
                JOptionPane.showMessageDialog(mainFrame, "loaded: " + url);
            }
            initiateCommunication(col);
View Full Code Here

            chooser.setDialogTitle(edu.umd.cs.findbugs.L10N.getLocalString("dlg.choose_xmls_ttl", "Choose All XML's To Combine"));
            if (chooser.showOpenDialog(MainFrame.getInstance()) == JFileChooser.CANCEL_OPTION) {
                return null;
            }

            SortedBugCollection conglomeration = new SortedBugCollection();
            conglomeration.readXML(chooser.getSelectedFiles()[0]);
            Update update = new Update();
            for (int x = 1; x < chooser.getSelectedFiles().length; x++) {
                File f = chooser.getSelectedFiles()[x];
                SortedBugCollection col = new SortedBugCollection();
                col.readXML(f);
                conglomeration = (SortedBugCollection) update.mergeCollections(conglomeration, col, false, false);// False
                // means
                // dont
                // show
                // dead
View Full Code Here

    private CloudPlugin plugin;

    @Override
    public void setUp() {
        projectStats = new ProjectStats();
        bugCollection = new SortedBugCollection(projectStats);
        plugin = new CloudPluginBuilder().setCloudid("myAbstractCloud").setClassLoader(this.getClass().getClassLoader())
                .setCloudClass(MyAbstractCloud.class).setUsernameClass(NoNameLookup.class).setProperties(new PropertyBundle())
                .setDescription("no description").setDetails("no details").createCloudPlugin();
        cloud = new MyAbstractCloud(plugin, bugCollection, new Properties());
        summary = new StringWriter();
View Full Code Here

        MineBugHistory mineBugHistory = new MineBugHistory();
        MineBugHistoryCommandLine commandLine = mineBugHistory.new MineBugHistoryCommandLine();
        int argCount = commandLine.parse(args, 0, 2, "Usage: " + MineBugHistory.class.getName()
                + " [options] [<xml results> [<history]] ");

        SortedBugCollection bugCollection = new SortedBugCollection();
        if (argCount < args.length) {
            bugCollection.readXML(args[argCount++]);
        } else {
            bugCollection.readXML(System.in);
        }
        mineBugHistory.setBugCollection(bugCollection);

        mineBugHistory.execute();
        PrintStream out = System.out;
View Full Code Here

TOP

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

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.