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

@@ -301,40 +301,40 @@
 
     /**
      * Getter for the "JvmThreadTotalStartedCount" variable.
      */
     public Long getJvmThreadTotalStartedCount() throws SnmpStatusException {
-        return new Long(getThreadMXBean().getTotalStartedThreadCount());
+        return getThreadMXBean().getTotalStartedThreadCount();
     }
 
     /**
      * Getter for the "JvmThreadPeakCount" variable.
      */
     public Long getJvmThreadPeakCount() throws SnmpStatusException {
-        return  new Long(getThreadMXBean().getPeakThreadCount());
+        return  (long)getThreadMXBean().getPeakThreadCount();
     }
 
     /**
      * Getter for the "JvmThreadDaemonCount" variable.
      */
     public Long getJvmThreadDaemonCount() throws SnmpStatusException {
-        return new Long(getThreadMXBean().getDaemonThreadCount());
+        return (long)getThreadMXBean().getDaemonThreadCount();
     }
 
     /**
      * Getter for the "JvmThreadCount" variable.
      */
     public Long getJvmThreadCount() throws SnmpStatusException {
-        return new Long(getThreadMXBean().getThreadCount());
+        return (long)getThreadMXBean().getThreadCount();
     }
 
    /**
      * Getter for the "JvmThreadPeakCountReset" variable.
      */
     public synchronized Long getJvmThreadPeakCountReset()
         throws SnmpStatusException {
-        return new Long(jvmThreadPeakCountReset);
+        return jvmThreadPeakCountReset;
     }
 
     /**
      * Setter for the "JvmThreadPeakCountReset" variable.
      */