diff graal/com.oracle.max.criutils/src/com/oracle/max/criutils/TTY.java @ 4142:bc8527f3071c

Adjust code base to new level of warnings.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sun, 18 Dec 2011 05:24:06 +0100
parents e233f5660da4
children e4e02131c58b
line wrap: on
line diff
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/TTY.java	Sun Dec 18 05:23:52 2011 +0100
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/TTY.java	Sun Dec 18 05:24:06 2011 +0100
@@ -102,16 +102,16 @@
             // In case initialize() was not called.
             cachedOut = System.out;
         }
-        PrintStream out = cachedOut;
+        PrintStream newOut = cachedOut;
         String value = System.getProperty(MAX_TTY_LOG_FILE_PROPERTY);
         if (value != null) {
             try {
-                out = new PrintStream(new FileOutputStream(value));
+                newOut = new PrintStream(new FileOutputStream(value));
             } catch (FileNotFoundException e) {
                 System.err.println("Could not open log file " + value + ": " + e);
             }
         }
-        return new LogStream(out);
+        return new LogStream(newOut);
     }
 
     private static final ThreadLocal<LogStream> out = new ThreadLocal<LogStream>() {
@@ -287,7 +287,7 @@
     private static String printMap(Map<?, ?> m) {
         StringBuilder sb = new StringBuilder();
 
-        List<String> keys = new ArrayList<String>();
+        List<String> keys = new ArrayList<>();
         for (Object key : m.keySet()) {
             keys.add((String) key);
         }
@@ -303,14 +303,6 @@
         return sb.toString();
     }
 
-    private static void printField(String fieldName, long value) {
-        TTY.print("    " + fieldName + " = " + value + "\n");
-    }
-
-    private static void printField(String fieldName, double value) {
-        TTY.print("    " + fieldName + " = " + value + "\n");
-    }
-
     public static void flush() {
         out().flush();
     }