src/share/classes/javax/management/modelmbean/RequiredModelMBean.java

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

@@ -542,11 +542,11 @@
                     RequiredModelMBean.class.getName(),
                         mth,"currencyTimeLimit: " + expTime);
             }
 
             // convert seconds to milliseconds for time comparison
-            currencyPeriod = ((new Long(expTime)).longValue()) * 1000;
+            currencyPeriod = ((Long.valueOf(expTime)).longValue()) * 1000;
             if (currencyPeriod < 0) {
                 /* if currencyTimeLimit is -1 then value is never cached */
                 returnCachedValue = false;
                 resetValue = true;
                 if (tracing) {

@@ -578,11 +578,11 @@
                 }
 
                 if (tStamp == null)
                     tStamp = "0";
 
-                long lastTime = (new Long(tStamp)).longValue();
+                long lastTime = Long.parseLong(tStamp);
 
                 if (tracing) {
                     MODELMBEAN_LOGGER.logp(Level.FINER,
                             RequiredModelMBean.class.getName(),mth,
                         "currencyPeriod:" + currencyPeriod +