diff graal/com.oracle.max.base/src/com/sun/max/profile/GlobalMetrics.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
line wrap: on
line diff
--- a/graal/com.oracle.max.base/src/com/sun/max/profile/GlobalMetrics.java	Sun Dec 18 05:23:52 2011 +0100
+++ b/graal/com.oracle.max.base/src/com/sun/max/profile/GlobalMetrics.java	Sun Dec 18 05:24:06 2011 +0100
@@ -39,15 +39,15 @@
     }
 
     static class MetricSet<T extends Metric> {
-        private final Class<T> clazz;
-        private final Map<String, T> metrics = new HashMap<String, T>();
+        protected final Class<T> clazz;
+        private final Map<String, T> metrics = new HashMap<>();
 
         MetricSet(Class<T> mClass) {
             clazz = mClass;
         }
     }
 
-    protected static final Map<Class<? extends Metric>, MetricSet> metricSets = new HashMap<Class<? extends Metric>, MetricSet>();
+    protected static final Map<Class<? extends Metric>, MetricSet> metricSets = new HashMap<>();
 
     /**
      * This method allocates a new counter with the specified name and adds it to the global
@@ -115,7 +115,7 @@
     public static <T extends Metric> T setMetric(String name, Class<T> mClass, T metric) {
         MetricSet<T> metricSet = Utils.cast(metricSets.get(mClass));
         if (metricSet == null) {
-            metricSet = new MetricSet<T>(mClass);
+            metricSet = new MetricSet<>(mClass);
             metricSets.put(mClass, metricSet);
         }
         metricSet.metrics.put(name, metric);
@@ -139,7 +139,7 @@
      * @param stream the print stream to which to print the report
      */
     public static synchronized void report(PrintStream stream) {
-        final Map<String, Metric> allMetrics = new HashMap<String, Metric>();
+        final Map<String, Metric> allMetrics = new HashMap<>();
         for (MetricSet<? extends Metric> metricSet : metricSets.values()) {
             allMetrics.putAll(metricSet.metrics);
         }