src/share/classes/sun/tools/jconsole/MemoryPoolProxy.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

*** 54,64 **** for (String name : mgrNames) { try { ObjectName mbeanName = new ObjectName(GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE + ",name=" + name); if (client.isRegistered(mbeanName)) { ! gcMBeans.put(mbeanName, new Long(0)); } } catch (Exception e) { assert false; } --- 54,64 ---- for (String name : mgrNames) { try { ObjectName mbeanName = new ObjectName(GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE + ",name=" + name); if (client.isRegistered(mbeanName)) { ! gcMBeans.put(mbeanName, 0L); } } catch (Exception e) { assert false; }
*** 95,105 **** client.getMXBean(e.getKey(), com.sun.management.GarbageCollectorMXBean.class); Long gcCount = e.getValue(); Long newCount = gc.getCollectionCount(); if (newCount > gcCount) { ! gcMBeans.put(e.getKey(), new Long(newCount)); lastGcInfo = gc.getLastGcInfo(); if (lastGcInfo.getEndTime() > lastGcEndTime) { gcId = lastGcInfo.getId(); lastGcStartTime = lastGcInfo.getStartTime(); lastGcEndTime = lastGcInfo.getEndTime(); --- 95,105 ---- client.getMXBean(e.getKey(), com.sun.management.GarbageCollectorMXBean.class); Long gcCount = e.getValue(); Long newCount = gc.getCollectionCount(); if (newCount > gcCount) { ! gcMBeans.put(e.getKey(), newCount); lastGcInfo = gc.getLastGcInfo(); if (lastGcInfo.getEndTime() > lastGcEndTime) { gcId = lastGcInfo.getId(); lastGcStartTime = lastGcInfo.getStartTime(); lastGcEndTime = lastGcInfo.getEndTime();