src/share/classes/sun/management/HotspotThread.java

Print this page
rev 10195 : 8048267: Replace uses of 'new Long()' with appropriate alternative across core classes
Reviewed-by: chegar, psandoz
Contributed-by: otaviojava@java.net

*** 58,68 **** String[] names = new String[count]; long[] times = new long[count]; int numThreads = getInternalThreadTimes0(names, times); Map<String, Long> result = new HashMap<>(numThreads); for (int i = 0; i < numThreads; i++) { ! result.put(names[i], new Long(times[i])); } return result; } public native int getInternalThreadTimes0(String[] names, long[] times); --- 58,68 ---- String[] names = new String[count]; long[] times = new long[count]; int numThreads = getInternalThreadTimes0(names, times); Map<String, Long> result = new HashMap<>(numThreads); for (int i = 0; i < numThreads; i++) { ! result.put(names[i], times[i]); } return result; } public native int getInternalThreadTimes0(String[] names, long[] times);