private void reportResultsToConsole() {
        if (!isStreamReportingEnabled()) {
            return;
        }
        printToStream("Finished, found: " + bugCount + " bugs");
        ConfigurableXmlOutputStream xmlStream = new ConfigurableXmlOutputStream(stream, true);
        ProjectStats stats = bugCollection.getProjectStats();

        printToStream("\nFootprint: " + new Footprint(stats.getBaseFootprint()).toString());

        Profiler profiler = stats.getProfiler();
        PrintStream printStream;
        try {
            printStream = new PrintStream(stream, false, "UTF-8");
        } catch (UnsupportedEncodingException e1) {
            // can never happen with UTF-8
            return;
        }

        printToStream("\nTotal time:");
        profiler.report(new Profiler.TotalTimeComparator(profiler), new Profiler.FilterByTime(10000000), printStream);

        printToStream("\nTotal calls:");
        int numClasses = stats.getNumClasses();
        if(numClasses > 0) {
            profiler.report(new Profiler.TotalCallsComparator(profiler), new Profiler.FilterByCalls(numClasses),
                    printStream);

            printToStream("\nTime per call:");
            profiler.report(new Profiler.TimePerCallComparator(profiler),
                    new Profiler.FilterByTimePerCall(10000000 / numClasses), printStream);
        }
        try {
            xmlStream.finish();
        } catch (IOException e) {
            FindbugsPlugin.getDefault().logException(e, "Print to console failed");
        }
    }
private void reportResultsToConsole ( ) { if ( ! isStreamReportingEnabled ( ) ) { return ; } printToStream ( "Finished, found: " + bugCount + " bugs" ) ; ConfigurableXmlOutputStream xmlStream = new ConfigurableXmlOutputStream ( stream , true ) ; ProjectStats stats = bugCollection . getProjectStats ( ) ; printToStream ( "\nFootprint: " + new Footprint ( stats . getBaseFootprint ( ) ) . toString ( ) ) ; Profiler profiler = stats . getProfiler ( ) ; PrintStream printStream ; try { printStream = new PrintStream ( stream , false , "UTF-8" ) ; } catch ( UnsupportedEncodingException e1 ) { return ; } printToStream ( "\nTotal time:" ) ; profiler . report ( new Profiler . TotalTimeComparator ( profiler ) , new Profiler . FilterByTime ( 10000000 ) , printStream ) ; printToStream ( "\nTotal calls:" ) ; int numClasses = stats . getNumClasses ( ) ; if ( numClasses > 0 ) { profiler . report ( new Profiler . TotalCallsComparator ( profiler ) , new Profiler . FilterByCalls ( numClasses ) , printStream ) ; printToStream ( "\nTime per call:" ) ; profiler . report ( new Profiler . TimePerCallComparator ( profiler ) , new Profiler . FilterByTimePerCall ( 10000000 / numClasses ) , printStream ) ; } try { xmlStream . finish ( ) ; } catch ( IOException e ) { FindbugsPlugin . getDefault ( ) . logException ( e , "Print to console failed" ) ; } }
If there is a FB console opened, report results and statistics to it.