comparison graal/com.oracle.graal.hotspot.server/src/com/oracle/graal/hotspot/server/InvocationSocket.java @ 9146:febfb532ed2f

Removed several instances of System.out.print.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 16 Apr 2013 15:00:47 +0200
parents 7fee8bd5d2bd
children 1cde96b96673
comparison
equal deleted inserted replaced
9141:5cabfd00241e 9146:febfb532ed2f
24 24
25 import java.io.*; 25 import java.io.*;
26 import java.lang.reflect.*; 26 import java.lang.reflect.*;
27 import java.util.*; 27 import java.util.*;
28 28
29 import com.oracle.graal.debug.*;
29 import com.oracle.graal.hotspot.logging.*; 30 import com.oracle.graal.hotspot.logging.*;
30 31
31 /** 32 /**
32 * A collection of java.lang.reflect proxies that communicate over a socket connection. 33 * A collection of java.lang.reflect proxies that communicate over a socket connection.
33 * 34 *
36 * the socket: a method invocation, a method result or an exception. Method invocation can thus be 37 * the socket: a method invocation, a method result or an exception. Method invocation can thus be
37 * recursive. 38 * recursive.
38 */ 39 */
39 public class InvocationSocket { 40 public class InvocationSocket {
40 41
41 // CheckStyle: stop system..print check
42 private static final boolean DEBUG = false; 42 private static final boolean DEBUG = false;
43 private static final boolean COUNT_CALLS = false; 43 private static final boolean COUNT_CALLS = false;
44 44
45 private static final HashSet<String> cachedMethodNames = new HashSet<>(); 45 private static final HashSet<String> cachedMethodNames = new HashSet<>();
46 private static final HashSet<String> forbiddenMethodNames = new HashSet<>(); 46 private static final HashSet<String> forbiddenMethodNames = new HashSet<>();
72 SortedMap<Integer, String> sorted = new TreeMap<>(); 72 SortedMap<Integer, String> sorted = new TreeMap<>();
73 for (Map.Entry<String, Integer> entry : counts.entrySet()) { 73 for (Map.Entry<String, Integer> entry : counts.entrySet()) {
74 sorted.put(entry.getValue(), entry.getKey()); 74 sorted.put(entry.getValue(), entry.getKey());
75 } 75 }
76 for (Map.Entry<Integer, String> entry : sorted.entrySet()) { 76 for (Map.Entry<Integer, String> entry : sorted.entrySet()) {
77 System.out.println(entry.getKey() + ": " + entry.getValue()); 77 TTY.println(entry.getKey() + ": " + entry.getValue());
78 } 78 }
79 } 79 }
80 }); 80 });
81 } 81 }
82 } 82 }
245 } 245 }
246 result = method.invoke(invoke.receiver, invoke.args); 246 result = method.invoke(invoke.receiver, invoke.args);
247 } 247 }
248 result = new Result(result); 248 result = new Result(result);
249 } catch (IllegalArgumentException e) { 249 } catch (IllegalArgumentException e) {
250 System.out.println("error while invoking " + invoke.methodName); 250 TTY.println("error while invoking " + invoke.methodName);
251 e.getCause().printStackTrace(); 251 e.getCause().printStackTrace();
252 result = e.getCause(); 252 result = e.getCause();
253 } catch (InvocationTargetException e) { 253 } catch (InvocationTargetException e) {
254 System.out.println("error while invoking " + invoke.methodName); 254 TTY.println("error while invoking " + invoke.methodName);
255 e.getCause().printStackTrace(); 255 e.getCause().printStackTrace();
256 result = e.getCause(); 256 result = e.getCause();
257 } catch (IllegalAccessException e) { 257 } catch (IllegalAccessException e) {
258 System.out.println("error while invoking " + invoke.methodName); 258 TTY.println("error while invoking " + invoke.methodName);
259 e.getCause().printStackTrace(); 259 e.getCause().printStackTrace();
260 result = e.getCause(); 260 result = e.getCause();
261 } finally { 261 } finally {
262 if (DEBUG) { 262 if (DEBUG) {
263 if (result instanceof Result) { 263 if (result instanceof Result) {