src/share/classes/sun/management/snmp/jvminstr/JvmMemPoolEntryImpl.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

*** 189,291 **** /** * Getter for the "JvmMemPoolMaxSize" variable. */ public Long getJvmMemPoolMaxSize() throws SnmpStatusException { final long val = getMemoryUsage().getMax(); ! if (val > -1) return new Long(val); else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolUsed" variable. */ public Long getJvmMemPoolUsed() throws SnmpStatusException { final long val = getMemoryUsage().getUsed(); ! if (val > -1) return new Long(val); else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolInitSize" variable. */ public Long getJvmMemPoolInitSize() throws SnmpStatusException { final long val = getMemoryUsage().getInit(); ! if (val > -1) return new Long(val); else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolCommitted" variable. */ public Long getJvmMemPoolCommitted() throws SnmpStatusException { final long val = getMemoryUsage().getCommitted(); ! if (val > -1) return new Long(val); else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolPeakMaxSize" variable. */ public Long getJvmMemPoolPeakMaxSize() throws SnmpStatusException { final long val = getPeakMemoryUsage().getMax(); ! if (val > -1) return new Long(val); else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolPeakUsed" variable. */ public Long getJvmMemPoolPeakUsed() throws SnmpStatusException { final long val = getPeakMemoryUsage().getUsed(); ! if (val > -1) return new Long(val); else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolPeakCommitted" variable. */ public Long getJvmMemPoolPeakCommitted() throws SnmpStatusException { final long val = getPeakMemoryUsage().getCommitted(); ! if (val > -1) return new Long(val); else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolCollectMaxSize" variable. */ public Long getJvmMemPoolCollectMaxSize() throws SnmpStatusException { final long val = getCollectMemoryUsage().getMax(); ! if (val > -1) return new Long(val); else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolCollectUsed" variable. */ public Long getJvmMemPoolCollectUsed() throws SnmpStatusException { final long val = getCollectMemoryUsage().getUsed(); ! if (val > -1) return new Long(val); else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolCollectCommitted" variable. */ public Long getJvmMemPoolCollectCommitted() throws SnmpStatusException { final long val = getCollectMemoryUsage().getCommitted(); ! if (val > -1) return new Long(val); else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolThreshold" variable. */ public Long getJvmMemPoolThreshold() throws SnmpStatusException { if (!pool.isUsageThresholdSupported()) return JvmMemoryImpl.Long0; final long val = pool.getUsageThreshold(); ! if (val > -1) return new Long(val); else return JvmMemoryImpl.Long0; } /** * Setter for the "JvmMemPoolThreshold" variable. --- 189,291 ---- /** * Getter for the "JvmMemPoolMaxSize" variable. */ public Long getJvmMemPoolMaxSize() throws SnmpStatusException { final long val = getMemoryUsage().getMax(); ! if (val > -1) return val; else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolUsed" variable. */ public Long getJvmMemPoolUsed() throws SnmpStatusException { final long val = getMemoryUsage().getUsed(); ! if (val > -1) return val; else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolInitSize" variable. */ public Long getJvmMemPoolInitSize() throws SnmpStatusException { final long val = getMemoryUsage().getInit(); ! if (val > -1) return val; else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolCommitted" variable. */ public Long getJvmMemPoolCommitted() throws SnmpStatusException { final long val = getMemoryUsage().getCommitted(); ! if (val > -1) return val; else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolPeakMaxSize" variable. */ public Long getJvmMemPoolPeakMaxSize() throws SnmpStatusException { final long val = getPeakMemoryUsage().getMax(); ! if (val > -1) return val; else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolPeakUsed" variable. */ public Long getJvmMemPoolPeakUsed() throws SnmpStatusException { final long val = getPeakMemoryUsage().getUsed(); ! if (val > -1) return val; else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolPeakCommitted" variable. */ public Long getJvmMemPoolPeakCommitted() throws SnmpStatusException { final long val = getPeakMemoryUsage().getCommitted(); ! if (val > -1) return val; else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolCollectMaxSize" variable. */ public Long getJvmMemPoolCollectMaxSize() throws SnmpStatusException { final long val = getCollectMemoryUsage().getMax(); ! if (val > -1) return val; else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolCollectUsed" variable. */ public Long getJvmMemPoolCollectUsed() throws SnmpStatusException { final long val = getCollectMemoryUsage().getUsed(); ! if (val > -1) return val; else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolCollectCommitted" variable. */ public Long getJvmMemPoolCollectCommitted() throws SnmpStatusException { final long val = getCollectMemoryUsage().getCommitted(); ! if (val > -1) return val; else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolThreshold" variable. */ public Long getJvmMemPoolThreshold() throws SnmpStatusException { if (!pool.isUsageThresholdSupported()) return JvmMemoryImpl.Long0; final long val = pool.getUsageThreshold(); ! if (val > -1) return val; else return JvmMemoryImpl.Long0; } /** * Setter for the "JvmMemPoolThreshold" variable.
*** 332,353 **** public Long getJvmMemPoolThreshdCount() throws SnmpStatusException { if (!pool.isUsageThresholdSupported()) return JvmMemoryImpl.Long0; final long val = pool.getUsageThresholdCount(); ! if (val > -1) return new Long(val); else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolCollectThreshold" variable. */ public Long getJvmMemPoolCollectThreshold() throws SnmpStatusException { if (!pool.isCollectionUsageThresholdSupported()) return JvmMemoryImpl.Long0; final long val = pool.getCollectionUsageThreshold(); ! if (val > -1) return new Long(val); else return JvmMemoryImpl.Long0; } /** * Setter for the "JvmMemPoolCollectThreshold" variable. --- 332,353 ---- public Long getJvmMemPoolThreshdCount() throws SnmpStatusException { if (!pool.isUsageThresholdSupported()) return JvmMemoryImpl.Long0; final long val = pool.getUsageThresholdCount(); ! if (val > -1) return val; else return JvmMemoryImpl.Long0; } /** * Getter for the "JvmMemPoolCollectThreshold" variable. */ public Long getJvmMemPoolCollectThreshold() throws SnmpStatusException { if (!pool.isCollectionUsageThresholdSupported()) return JvmMemoryImpl.Long0; final long val = pool.getCollectionUsageThreshold(); ! if (val > -1) return val; else return JvmMemoryImpl.Long0; } /** * Setter for the "JvmMemPoolCollectThreshold" variable.
*** 397,407 **** public Long getJvmMemPoolCollectThreshdCount() throws SnmpStatusException { if (!pool.isCollectionUsageThresholdSupported()) return JvmMemoryImpl.Long0; final long val = pool.getCollectionUsageThresholdCount(); ! if (val > -1) return new Long(val); else return JvmMemoryImpl.Long0; } public static EnumJvmMemPoolType jvmMemPoolType(MemoryType type) throws SnmpStatusException { --- 397,407 ---- public Long getJvmMemPoolCollectThreshdCount() throws SnmpStatusException { if (!pool.isCollectionUsageThresholdSupported()) return JvmMemoryImpl.Long0; final long val = pool.getCollectionUsageThresholdCount(); ! if (val > -1) return val; else return JvmMemoryImpl.Long0; } public static EnumJvmMemPoolType jvmMemPoolType(MemoryType type) throws SnmpStatusException {
*** 448,458 **** /** * Getter for the "JvmMemPoolPeakReset" variable. */ public synchronized Long getJvmMemPoolPeakReset() throws SnmpStatusException { ! return new Long(jvmMemPoolPeakReset); } /** * Setter for the "JvmMemPoolPeakReset" variable. */ --- 448,458 ---- /** * Getter for the "JvmMemPoolPeakReset" variable. */ public synchronized Long getJvmMemPoolPeakReset() throws SnmpStatusException { ! return jvmMemPoolPeakReset; } /** * Setter for the "JvmMemPoolPeakReset" variable. */