jdk/src/share/classes/sun/management/HotspotCompilation.java
changeset 11530 a9d059c15b80
parent 5506 202f599c92aa
child 14342 8435a30053c1
--- a/jdk/src/share/classes/sun/management/HotspotCompilation.java	Tue Jan 17 14:10:04 2012 +0000
+++ b/jdk/src/share/classes/sun/management/HotspotCompilation.java	Tue Jan 17 15:55:40 2012 -0800
@@ -120,13 +120,13 @@
         // current implementation.  We first look up in the SUN_CI namespace
         // since most counters are in SUN_CI namespace.
 
-        if ((c = (Counter) counters.get(SUN_CI + name)) != null) {
+        if ((c = counters.get(SUN_CI + name)) != null) {
             return c;
         }
-        if ((c = (Counter) counters.get(COM_SUN_CI + name)) != null) {
+        if ((c = counters.get(COM_SUN_CI + name)) != null) {
             return c;
         }
-        if ((c = (Counter) counters.get(JAVA_CI + name)) != null) {
+        if ((c = counters.get(JAVA_CI + name)) != null) {
             return c;
         }
 
@@ -136,10 +136,8 @@
 
     private void initCompilerCounters() {
         // Build a tree map of the current list of performance counters
-        ListIterator iter = getInternalCompilerCounters().listIterator();
-        counters = new TreeMap<String, Counter>();
-        while (iter.hasNext()) {
-            Counter c = (Counter) iter.next();
+        counters = new TreeMap<>();
+        for (Counter c: getInternalCompilerCounters()) {
             counters.put(c.getName(), c);
         }
 
@@ -200,7 +198,7 @@
     }
 
     public java.util.List<CompilerThreadStat> getCompilerThreadStats() {
-        List<CompilerThreadStat> list = new ArrayList<CompilerThreadStat>(threads.length);
+        List<CompilerThreadStat> list = new ArrayList<>(threads.length);
         int i = 0;
         if (threads[0] == null) {
             // no adaptor thread