src/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.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

@@ -85,11 +85,11 @@
      *
      * @param name the user identification number (UID) for this user
      *                  represented as a long.
      */
     public UnixNumericUserPrincipal(long name) {
-        this.name = (new Long(name)).toString();
+        this.name = Long.valueOf(name).toString();
     }
 
     /**
      * Return the user identification number (UID) for this
      * <code>UnixNumericUserPrincipal</code>.

@@ -111,11 +111,11 @@
      *
      * @return the user identification number (UID) for this
      *          <code>UnixNumericUserPrincipal</code> as a long.
      */
     public long longValue() {
-        return ((new Long(name)).longValue());
+        return Long.valueOf(name);
     }
 
     /**
      * Return a string representation of this
      * <code>UnixNumericUserPrincipal</code>.