src/share/classes/com/sun/jndi/ldap/LdapPoolManager.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


 404             new PrivilegedAction<Integer>() {
 405             public Integer run() {
 406                 try {
 407                     return Integer.getInteger(propName, defVal);
 408                 } catch (SecurityException e) {
 409                     return new Integer(defVal);
 410                 }
 411             }
 412         });
 413         return val.intValue();
 414     }
 415 
 416     private static final long getLong(final String propName,
 417         final long defVal) {
 418         Long val = AccessController.doPrivileged(
 419             new PrivilegedAction<Long>() {
 420             public Long run() {
 421                 try {
 422                     return Long.getLong(propName, defVal);
 423                 } catch (SecurityException e) {
 424                     return new Long(defVal);
 425                 }
 426             }
 427         });
 428         return val.longValue();
 429     }
 430 }


 404             new PrivilegedAction<Integer>() {
 405             public Integer run() {
 406                 try {
 407                     return Integer.getInteger(propName, defVal);
 408                 } catch (SecurityException e) {
 409                     return new Integer(defVal);
 410                 }
 411             }
 412         });
 413         return val.intValue();
 414     }
 415 
 416     private static final long getLong(final String propName,
 417         final long defVal) {
 418         Long val = AccessController.doPrivileged(
 419             new PrivilegedAction<Long>() {
 420             public Long run() {
 421                 try {
 422                     return Long.getLong(propName, defVal);
 423                 } catch (SecurityException e) {
 424                     return defVal;
 425                 }
 426             }
 427         });
 428         return val.longValue();
 429     }
 430 }