# HG changeset patch # User Doug Simon # Date 1395248700 -3600 # Node ID a6fda38d84840370306f894bf60d992ddfefacf1 # Parent a0baf4eeb01806132e13ff34c8d371d6fac6c38e refactored System.out|err into local variables to avoid need for Checkstyle disabling filters (which the Eclipse CS plugin doesn't always see) diff -r a0baf4eeb018 -r a6fda38d8484 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/logging/CountingProxy.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/logging/CountingProxy.java Wed Mar 19 16:44:07 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/logging/CountingProxy.java Wed Mar 19 18:05:00 2014 +0100 @@ -22,6 +22,7 @@ */ package com.oracle.graal.hotspot.logging; +import java.io.*; import java.lang.reflect.*; import java.util.*; import java.util.concurrent.*; @@ -94,16 +95,15 @@ } } - // CheckStyle: stop system..print check protected void print() { long sum = 0; + PrintStream out = System.out; for (Map.Entry entry : calls.entrySet()) { Method method = entry.getKey(); long count = entry.getValue().get(); sum += count; - System.out.println(delegate.getClass().getSimpleName() + "." + method.getName() + ": " + count); + out.println(delegate.getClass().getSimpleName() + "." + method.getName() + ": " + count); } - System.out.println(delegate.getClass().getSimpleName() + " calls: " + sum); + out.println(delegate.getClass().getSimpleName() + " calls: " + sum); } - // CheckStyle: resume system..print check } diff -r a0baf4eeb018 -r a6fda38d8484 graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/System_setOut.java --- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/System_setOut.java Wed Mar 19 16:44:07 2014 +0100 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/System_setOut.java Wed Mar 19 18:05:00 2014 +0100 @@ -46,19 +46,18 @@ return sum; } - // CheckStyle: stop system..print check private static void doPrint(int n) { + PrintStream out = System.out; for (int i = 0; i < n; i++) { - System.out.print('x'); + out.print('x'); } } public static void main(String[] args) throws Exception { - System.out.println(test(10000)); + PrintStream out = System.out; + out.println(test(10000)); } - // CheckStyle: resume system..print check - @LongTest public void run0() throws Throwable { runTest("test", 10000); diff -r a0baf4eeb018 -r a6fda38d8484 graal/com.oracle.graal.printer/src/com/oracle/graal/printer/HexCodeFile.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/HexCodeFile.java Wed Mar 19 16:44:07 2014 +0100 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/HexCodeFile.java Wed Mar 19 18:05:00 2014 +0100 @@ -293,9 +293,8 @@ } void warning(int offset, String message) { - // CheckStyle: stop system..print check - System.err.println("Warning: " + errorMessage(offset, message)); - // CheckStyle: resume system..print check + PrintStream err = System.err; + err.println("Warning: " + errorMessage(offset, message)); } String errorMessage(int offset, String message) { @@ -323,10 +322,9 @@ int lineStart = input.lastIndexOf(HexCodeFile.NEW_LINE, index) + 1; String l = input.substring(lineStart, lineStart + 10); - // CheckStyle: stop system..print check - System.out.println("YYY" + input.substring(index, index + 10) + "..."); - System.out.println("XXX" + l + "..."); - // CheckStyle: resume system..print check + PrintStream out = System.out; + out.println("YYY" + input.substring(index, index + 10) + "..."); + out.println("XXX" + l + "..."); int pos = input.indexOf(HexCodeFile.NEW_LINE, 0); int line = 1; diff -r a0baf4eeb018 -r a6fda38d8484 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TimedCompilationPolicy.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TimedCompilationPolicy.java Wed Mar 19 16:44:07 2014 +0100 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TimedCompilationPolicy.java Wed Mar 19 18:05:00 2014 +0100 @@ -24,6 +24,8 @@ import static com.oracle.graal.truffle.TruffleCompilerOptions.*; +import java.io.*; + public class TimedCompilationPolicy extends DefaultCompilationPolicy { @Override @@ -39,9 +41,8 @@ // maybe introduce another method? profile.reportTiminingFailed(timestamp); if (TruffleCompilationDecisionTimePrintFail.getValue()) { - // Checkstyle: stop - System.out.println(profile.getName() + ": timespan " + (timespan / 1000000) + " ms larger than threshold"); - // Checkstyle: resume + PrintStream out = System.out; + out.println(profile.getName() + ": timespan " + (timespan / 1000000) + " ms larger than threshold"); } } return false;