diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/Profiler.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/Profiler.java index 73144c884e5..247285b5732 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/Profiler.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/Profiler.java @@ -76,11 +76,11 @@ public class Profiler { } private Map timers; - private Map counters; + private Map counters; private Profiler() { timers = new HashMap(); - counters = new HashMap(); + counters = new HashMap(); } private static ThreadLocal threadProfiler = new ThreadLocal(); @@ -112,11 +112,11 @@ public class Profiler { public static void incrementCounter(String name) { Profiler profiler = threadProfiler.get(); if (profiler != null) { - Integer n = profiler.counters.get(name); + int[] n = profiler.counters.get(name); if (n == null) { - n = 1; + n = new int[] { 1 }; } else { - n = n.intValue() + 1; + n[0]++; } profiler.counters.put(name, n); } @@ -149,18 +149,18 @@ public class Profiler { } if (!profiler.counters.isEmpty()) { - List> keyList = - new ArrayList>(profiler.counters.entrySet()); - Comparator> c2 = new Comparator>() { - public int compare(Entry o1, Entry o2) { - return o2.getValue().intValue() - o1.getValue().intValue(); + List> keyList = + new ArrayList>(profiler.counters.entrySet()); + Comparator> c2 = new Comparator>() { + public int compare(Entry o1, Entry o2) { + return o2.getValue()[0] - o1.getValue()[0]; } }; Collections.sort(keyList, c2); System.out.println("==="); //$NON-NLS-1$ System.out.println("===\t" + profiler.counters.size() + " counters"); //$NON-NLS-1$ //$NON-NLS-2$ - for (Entry item : keyList) { - System.out.println("===\t" + item.getValue().intValue() + "\t" + item.getKey()); //$NON-NLS-1$ //$NON-NLS-2$ + for (Entry item : keyList) { + System.out.println("===\t" + item.getValue()[0] + "\t" + item.getKey()); //$NON-NLS-1$ //$NON-NLS-2$ } } }