8048267: Replace uses of 'new Long()' with appropriate alternative across core classes
authorprappo
Tue, 01 Jul 2014 15:12:59 +0100
changeset 25186 63e1a2ec30f5
parent 25185 3047e0a03066
child 25187 08aff438def8
8048267: Replace uses of 'new Long()' with appropriate alternative across core classes Reviewed-by: chegar, psandoz, prappo Contributed-by: Otavio Santana <otaviojava@java.net>
jdk/src/macosx/classes/sun/font/CStrike.java
jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java
jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java
jdk/src/share/classes/com/sun/jmx/snmp/SnmpCounter64.java
jdk/src/share/classes/com/sun/jmx/snmp/SnmpInt.java
jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java
jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServer.java
jdk/src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java
jdk/src/share/classes/com/sun/jndi/ldap/NamingEventNotifier.java
jdk/src/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java
jdk/src/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java
jdk/src/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java
jdk/src/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java
jdk/src/share/classes/com/sun/tools/example/debug/tty/BreakpointSpec.java
jdk/src/share/classes/com/sun/tools/example/debug/tty/Commands.java
jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaLazyReadObject.java
jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java
jdk/src/share/classes/com/sun/tools/hat/internal/parser/HprofReader.java
jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java
jdk/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java
jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java
jdk/src/share/classes/java/text/DecimalFormat.java
jdk/src/share/classes/javax/management/loading/MLet.java
jdk/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java
jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java
jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfLongMonitor.java
jdk/src/share/classes/sun/management/GcInfoCompositeData.java
jdk/src/share/classes/sun/management/HotspotThread.java
jdk/src/share/classes/sun/management/MemoryNotifInfoCompositeData.java
jdk/src/share/classes/sun/management/MemoryUsageCompositeData.java
jdk/src/share/classes/sun/management/ThreadInfoCompositeData.java
jdk/src/share/classes/sun/management/counter/perf/LongCounterSnapshot.java
jdk/src/share/classes/sun/management/counter/perf/PerfLongCounter.java
jdk/src/share/classes/sun/management/snmp/jvminstr/JvmClassLoadingImpl.java
jdk/src/share/classes/sun/management/snmp/jvminstr/JvmCompilationImpl.java
jdk/src/share/classes/sun/management/snmp/jvminstr/JvmMemGCEntryImpl.java
jdk/src/share/classes/sun/management/snmp/jvminstr/JvmMemPoolEntryImpl.java
jdk/src/share/classes/sun/management/snmp/jvminstr/JvmMemoryImpl.java
jdk/src/share/classes/sun/management/snmp/jvminstr/JvmRuntimeImpl.java
jdk/src/share/classes/sun/management/snmp/jvminstr/JvmThreadInstanceEntryImpl.java
jdk/src/share/classes/sun/management/snmp/jvminstr/JvmThreadingImpl.java
jdk/src/share/classes/sun/nio/ch/Util.java
jdk/src/share/classes/sun/security/action/GetLongAction.java
jdk/src/share/classes/sun/security/jgss/wrapper/GSSNameElement.java
jdk/src/share/classes/sun/security/krb5/internal/KerberosTime.java
jdk/src/share/classes/sun/security/tools/keytool/Main.java
jdk/src/share/classes/sun/tools/java/BinaryConstantPool.java
jdk/src/share/classes/sun/tools/jconsole/MemoryPoolProxy.java
jdk/src/share/classes/sun/tools/tree/BitNotExpression.java
jdk/src/share/classes/sun/tools/tree/IncDecExpression.java
jdk/src/share/classes/sun/tools/tree/LongExpression.java
jdk/src/solaris/classes/java/util/prefs/FileSystemPreferences.java
jdk/src/solaris/classes/sun/awt/X11/XFocusProxyWindow.java
--- a/jdk/src/macosx/classes/sun/font/CStrike.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/macosx/classes/sun/font/CStrike.java	Tue Jul 01 15:12:59 2014 +0100
@@ -415,7 +415,7 @@
                 generalCache = new HashMap<Integer, Long>();
             }
 
-            generalCache.put(new Integer(index), new Long(value));
+            generalCache.put(new Integer(index), Long.valueOf(value));
         }
 
         public synchronized void dispose() {
--- a/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java	Tue Jul 01 15:12:59 2014 +0100
@@ -616,7 +616,7 @@
                     return index;
                 }
 
-                Long l1 = new Long(stream.getStreamPosition());
+                Long l1 = stream.getStreamPosition();
                 imageStartPosition.add(l1);
                 ++index;
             }
--- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java	Tue Jul 01 15:12:59 2014 +0100
@@ -367,10 +367,10 @@
             // Now we are at the first image if there are any, so add it
             // to the list
             if (hasNextImage()) {
-                imagePositions.add(new Long(iis.getStreamPosition()));
+                imagePositions.add(iis.getStreamPosition());
             }
         } else { // Not tables only, so add original pos to the list
-            imagePositions.add(new Long(savePos));
+            imagePositions.add(savePos);
             // And set current image since we've read it now
             currentImage = 0;
         }
@@ -498,7 +498,7 @@
                 if (!hasNextImage()) {
                     throw new IndexOutOfBoundsException();
                 }
-                pos = new Long(iis.getStreamPosition());
+                pos = iis.getStreamPosition();
                 imagePositions.add(pos);
                 if (seekForwardOnly) {
                     iis.flushBefore(pos.longValue());
--- a/jdk/src/share/classes/com/sun/jmx/snmp/SnmpCounter64.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/SnmpCounter64.java	Tue Jul 01 15:12:59 2014 +0100
@@ -84,7 +84,7 @@
      * @return The <CODE>Long</CODE> representation of the value.
      */
     public Long toLong() {
-        return new Long(value) ;
+        return value;
     }
 
     /**
--- a/jdk/src/share/classes/com/sun/jmx/snmp/SnmpInt.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/SnmpInt.java	Tue Jul 01 15:12:59 2014 +0100
@@ -130,7 +130,7 @@
      * @return The <CODE>Long</CODE> representation of the value.
      */
     public Long toLong() {
-        return new Long(value) ;
+        return value;
     }
 
     /**
--- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java	Tue Jul 01 15:12:59 2014 +0100
@@ -136,7 +136,7 @@
      */
     public boolean isNestedArc(long arc) {
         if (subgroups == null) return false;
-        Object obj = subgroups.get(new Long(arc));
+        Object obj = subgroups.get(arc);
         // if the arc is registered in the hashtable,
         // it leads to a subgroup.
         return (obj != null);
@@ -260,7 +260,7 @@
      *
      */
     void registerNestedArc(long arc) {
-        Long obj = new Long(arc);
+        Long obj = arc;
         if (subgroups == null) subgroups = new Hashtable<>();
         // registers the arc in the hashtable.
         subgroups.put(obj,obj);
--- a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServer.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServer.java	Tue Jul 01 15:12:59 2014 +0100
@@ -858,7 +858,7 @@
      */
     @Override
     public Long getSnmpOutTraps() {
-        return new Long(snmpOutTraps);
+        return (long)snmpOutTraps;
     }
 
     /**
@@ -868,7 +868,7 @@
      */
     @Override
     public Long getSnmpOutGetResponses() {
-        return new Long(snmpOutGetResponses);
+        return (long)snmpOutGetResponses;
     }
 
     /**
@@ -878,7 +878,7 @@
      */
     @Override
     public Long getSnmpOutGenErrs() {
-        return new Long(snmpOutGenErrs);
+        return (long)snmpOutGenErrs;
     }
 
     /**
@@ -888,7 +888,7 @@
      */
     @Override
     public Long getSnmpOutBadValues() {
-        return new Long(snmpOutBadValues);
+        return (long)snmpOutBadValues;
     }
 
     /**
@@ -898,7 +898,7 @@
      */
     @Override
     public Long getSnmpOutNoSuchNames() {
-        return new Long(snmpOutNoSuchNames);
+        return (long)snmpOutNoSuchNames;
     }
 
     /**
@@ -908,7 +908,7 @@
      */
     @Override
     public Long getSnmpOutTooBigs() {
-        return new Long(snmpOutTooBigs);
+        return (long)snmpOutTooBigs;
     }
 
     /**
@@ -918,7 +918,7 @@
      */
     @Override
     public Long getSnmpInASNParseErrs() {
-        return new Long(snmpInASNParseErrs);
+        return (long)snmpInASNParseErrs;
     }
 
     /**
@@ -928,7 +928,7 @@
      */
     @Override
     public Long getSnmpInBadCommunityUses() {
-        return new Long(snmpInBadCommunityUses);
+        return (long)snmpInBadCommunityUses;
     }
 
     /**
@@ -939,7 +939,7 @@
      */
     @Override
     public Long getSnmpInBadCommunityNames() {
-        return new Long(snmpInBadCommunityNames);
+        return (long)snmpInBadCommunityNames;
     }
 
     /**
@@ -949,7 +949,7 @@
      */
     @Override
     public Long getSnmpInBadVersions() {
-        return new Long(snmpInBadVersions);
+        return (long)snmpInBadVersions;
     }
 
     /**
@@ -959,7 +959,7 @@
      */
     @Override
     public Long getSnmpOutPkts() {
-        return new Long(snmpOutPkts);
+        return (long)snmpOutPkts;
     }
 
     /**
@@ -969,7 +969,7 @@
      */
     @Override
     public Long getSnmpInPkts() {
-        return new Long(snmpInPkts);
+        return (long)snmpInPkts;
     }
 
     /**
@@ -979,7 +979,7 @@
      */
     @Override
     public Long getSnmpInGetRequests() {
-        return new Long(snmpInGetRequests);
+        return (long)snmpInGetRequests;
     }
 
     /**
@@ -989,7 +989,7 @@
      */
     @Override
     public Long getSnmpInGetNexts() {
-        return new Long(snmpInGetNexts);
+        return (long)snmpInGetNexts;
     }
 
     /**
@@ -999,7 +999,7 @@
      */
     @Override
     public Long getSnmpInSetRequests() {
-        return new Long(snmpInSetRequests);
+        return (long)snmpInSetRequests;
     }
 
     /**
@@ -1009,7 +1009,7 @@
      */
     @Override
     public Long getSnmpInTotalSetVars() {
-        return new Long(snmpInTotalSetVars);
+        return (long)snmpInTotalSetVars;
     }
 
     /**
@@ -1019,7 +1019,7 @@
      */
     @Override
     public Long getSnmpInTotalReqVars() {
-        return new Long(snmpInTotalReqVars);
+        return (long)snmpInTotalReqVars;
     }
 
     /**
@@ -1032,7 +1032,7 @@
      */
     @Override
     public Long getSnmpSilentDrops() {
-        return new Long(snmpSilentDrops);
+        return (long)snmpSilentDrops;
     }
 
     /**
@@ -1045,7 +1045,7 @@
      */
     @Override
     public Long getSnmpProxyDrops() {
-        return new Long(0);
+        return 0L;
     }
 
 
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java	Tue Jul 01 15:12:59 2014 +0100
@@ -421,7 +421,7 @@
                 try {
                     return Long.getLong(propName, defVal);
                 } catch (SecurityException e) {
-                    return new Long(defVal);
+                    return defVal;
                 }
             }
         });
--- a/jdk/src/share/classes/com/sun/jndi/ldap/NamingEventNotifier.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/NamingEventNotifier.java	Tue Jul 01 15:12:59 2014 +0100
@@ -221,7 +221,7 @@
             return;
 
         NamingEvent e = new NamingEvent(eventSrc, NamingEvent.OBJECT_ADDED,
-            newBd, null, new Long(changeID));
+            newBd, null, changeID);
         support.queueEvent(e, namingListeners);
     }
 
@@ -233,7 +233,7 @@
             return;
 
         NamingEvent e = new NamingEvent(eventSrc, NamingEvent.OBJECT_REMOVED,
-            null, oldBd, new Long(changeID));
+            null, oldBd, changeID);
         support.queueEvent(e, namingListeners);
     }
 
@@ -248,7 +248,7 @@
         Binding oldBd = new Binding(newBd.getName(), null, newBd.isRelative());
 
         NamingEvent e = new NamingEvent(
-            eventSrc, NamingEvent.OBJECT_CHANGED, newBd, oldBd, new Long(changeID));
+            eventSrc, NamingEvent.OBJECT_CHANGED, newBd, oldBd, changeID);
         support.queueEvent(e, namingListeners);
     }
 
@@ -273,7 +273,7 @@
         }
 
         NamingEvent e = new NamingEvent(
-            eventSrc, NamingEvent.OBJECT_RENAMED, newBd, oldBd, new Long(changeID));
+            eventSrc, NamingEvent.OBJECT_RENAMED, newBd, oldBd, changeID);
         support.queueEvent(e, namingListeners);
     }
 
--- a/jdk/src/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java	Tue Jul 01 15:12:59 2014 +0100
@@ -110,7 +110,7 @@
      *
      */
     public SolarisNumericGroupPrincipal(long name, boolean primaryGroup) {
-        this.name = (new Long(name)).toString();
+        this.name = Long.toString(name);
         this.primaryGroup = primaryGroup;
     }
 
@@ -137,7 +137,7 @@
      *          <code>SolarisNumericGroupPrincipal</code> as a long.
      */
     public long longValue() {
-        return ((new Long(name)).longValue());
+        return Long.parseLong(name);
     }
 
     /**
--- a/jdk/src/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java	Tue Jul 01 15:12:59 2014 +0100
@@ -96,7 +96,7 @@
      *                  represented as a long.
      */
     public SolarisNumericUserPrincipal(long name) {
-        this.name = (new Long(name)).toString();
+        this.name = Long.toString(name);
     }
 
     /**
@@ -122,7 +122,7 @@
      *          <code>SolarisNumericUserPrincipal</code> as a long.
      */
     public long longValue() {
-        return ((new Long(name)).longValue());
+        return Long.parseLong(name);
     }
 
     /**
--- a/jdk/src/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java	Tue Jul 01 15:12:59 2014 +0100
@@ -102,7 +102,7 @@
      *
      */
     public UnixNumericGroupPrincipal(long name, boolean primaryGroup) {
-        this.name = (new Long(name)).toString();
+        this.name = Long.toString(name);
         this.primaryGroup = primaryGroup;
     }
 
@@ -129,7 +129,7 @@
      *          <code>UnixNumericGroupPrincipal</code> as a long.
      */
     public long longValue() {
-        return ((new Long(name)).longValue());
+        return Long.parseLong(name);
     }
 
     /**
--- a/jdk/src/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java	Tue Jul 01 15:12:59 2014 +0100
@@ -87,7 +87,7 @@
      *                  represented as a long.
      */
     public UnixNumericUserPrincipal(long name) {
-        this.name = (new Long(name)).toString();
+        this.name = Long.toString(name);
     }
 
     /**
@@ -113,7 +113,7 @@
      *          <code>UnixNumericUserPrincipal</code> as a long.
      */
     public long longValue() {
-        return ((new Long(name)).longValue());
+        return Long.parseLong(name);
     }
 
     /**
--- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/BreakpointSpec.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/BreakpointSpec.java	Tue Jul 01 15:12:59 2014 +0100
@@ -142,8 +142,8 @@
                                          refSpec.toString()));
         } else if (e instanceof LineNotFoundException) {
             return (MessageOutput.format("No code at line",
-                                         new Object [] {new Long (lineNumber()),
-                                                        refSpec.toString()}));
+                                         new Object [] {Long.valueOf(lineNumber()),
+                                                 refSpec.toString()}));
         } else if (e instanceof InvalidTypeException) {
             return (MessageOutput.format("Breakpoints can be located only in classes.",
                                          refSpec.toString()));
--- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/Commands.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/Commands.java	Tue Jul 01 15:12:59 2014 +0100
@@ -935,7 +935,7 @@
             try {
                 methodInfo = loc.sourceName() +
                     MessageOutput.format("line number",
-                                         new Object [] {new Long(lineNumber)});
+                                         new Object [] {Long.valueOf(lineNumber)});
             } catch (AbsentInformationException e) {
                 methodInfo = MessageOutput.format("unknown");
             }
@@ -946,7 +946,7 @@
                                                  meth.declaringType().name(),
                                                  meth.name(),
                                                  methodInfo,
-                                                 new Long(pc)});
+                                                 Long.valueOf(pc)});
         } else {
             MessageOutput.println("stack frame dump",
                                   new Object [] {new Integer(frameNumber + 1),
@@ -1015,7 +1015,7 @@
                                     new Object [] {loc.declaringType().name(),
                                                    loc.method().name(),
                                                    new Integer (loc.lineNumber()),
-                                                   new Long (loc.codeIndex())});
+                                                   Long.valueOf(loc.codeIndex())});
     }
 
     void listBreakpoints() {
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaLazyReadObject.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaLazyReadObject.java	Tue Jul 01 15:12:59 2014 +0100
@@ -102,7 +102,7 @@
         if ((id & ~Snapshot.SMALL_ID_MASK) == 0) {
             return new Integer((int)id);
         } else {
-            return new Long(id);
+            return id;
         }
     }
 
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java	Tue Jul 01 15:12:59 2014 +0100
@@ -583,7 +583,7 @@
         if (identifierSize == 4) {
             return new Integer((int)id);
         } else {
-            return new Long(id);
+            return id;
         }
     }
 
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/parser/HprofReader.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/parser/HprofReader.java	Tue Jul 01 15:12:59 2014 +0100
@@ -215,7 +215,7 @@
                     long id = readID();
                     byte[] chars = new byte[(int)length - identifierSize];
                     in.readFully(chars);
-                    names.put(new Long(id), new String(chars));
+                    names.put(id, new String(chars));
                     break;
                 }
                 case HPROF_LOAD_CLASS: {
@@ -223,7 +223,7 @@
                     long classID = readID();
                     int stackTraceSerialNo = in.readInt();
                     long classNameID = readID();
-                    Long classIdI = new Long(classID);
+                    Long classIdI = classID;
                     String nm = getNameFromID(classNameID).replace('/', '.');
                     classNameFromObjectID.put(classIdI, nm);
                     if (classNameFromSerialNo != null) {
@@ -303,7 +303,7 @@
                             warn("Weird stack frame line number:  " + lineNumber);
                             lineNumber = StackFrame.LINE_NUMBER_UNKNOWN;
                         }
-                        stackFrames.put(new Long(id),
+                        stackFrames.put(id,
                                         new StackFrame(methodName, methodSig,
                                                        className, sourceFile,
                                                        lineNumber));
@@ -319,7 +319,7 @@
                         StackFrame[] frames = new StackFrame[in.readInt()];
                         for (int i = 0; i < frames.length; i++) {
                             long fid = readID();
-                            frames[i] = stackFrames.get(new Long(fid));
+                            frames[i] = stackFrames.get(fid);
                             if (frames[i] == null) {
                                 throw new IOException("Stack frame " + toHex(fid) + " not found");
                             }
@@ -619,7 +619,7 @@
     }
 
     private String getNameFromID(long id) throws IOException {
-        return getNameFromID(new Long(id));
+        return getNameFromID(Long.valueOf(id));
     }
 
     private String getNameFromID(Long id) throws IOException {
@@ -703,7 +703,7 @@
             String signature = "" + ((char) type);
             fields[i] = new JavaField(fieldName, signature);
         }
-        String name = classNameFromObjectID.get(new Long(id));
+        String name = classNameFromObjectID.get(id);
         if (name == null) {
             warn("Class name not found for " + toHex(id));
             name = "unknown-name@" + toHex(id);
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java	Tue Jul 01 15:12:59 2014 +0100
@@ -63,9 +63,9 @@
                     }
                     Long count = referrersStat.get(cl);
                     if (count == null) {
-                        count = new Long(1);
+                        count = 1L;
                     } else {
-                        count = new Long(count.longValue() + 1);
+                        count = count + 1L;
                     }
                     referrersStat.put(cl, count);
                 }
@@ -75,9 +75,9 @@
                             JavaClass cl = obj.getClazz();
                             Long count = refereesStat.get(cl);
                             if (count == null) {
-                                count = new Long(1);
+                                count = 1L;
                             } else {
-                                count = new Long(count.longValue() + 1);
+                                count = count + 1L;
                             }
                             refereesStat.put(cl, count);
                         }
--- a/jdk/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java	Tue Jul 01 15:12:59 2014 +0100
@@ -781,7 +781,7 @@
             type.setSignature(signature);
         }
 
-        typesByID.put(new Long(id), type);
+        typesByID.put(id, type);
         typesBySignature.add(type);
 
         if ((vm.traceFlags & VirtualMachine.TRACE_REFTYPES) != 0) {
@@ -809,7 +809,7 @@
             if (comp == 0) {
                 matches++;
                 iter.remove();
-                typesByID.remove(new Long(type.ref()));
+                typesByID.remove(type.ref());
                 if ((vm.traceFlags & VirtualMachine.TRACE_REFTYPES) != 0) {
                    vm.printTrace("Uncaching ReferenceType, sig=" + signature +
                                  ", id=" + type.ref());
@@ -895,7 +895,7 @@
             ReferenceTypeImpl retType = null;
             synchronized (this) {
                 if (typesByID != null) {
-                    retType = (ReferenceTypeImpl)typesByID.get(new Long(id));
+                    retType = (ReferenceTypeImpl)typesByID.get(id);
                 }
                 if (retType == null) {
                     retType = addReferenceType(id, tag, signature);
@@ -1247,7 +1247,7 @@
             return null;
         }
         ObjectReferenceImpl object = null;
-        Long key = new Long(id);
+        Long key = id;
 
         /*
          * Attempt to retrieve an existing object object reference
@@ -1313,7 +1313,7 @@
         // Handle any queue elements that are not strongly reachable
         processQueue();
 
-        SoftObjectReference ref = objectsByID.remove(new Long(object.ref()));
+        SoftObjectReference ref = objectsByID.remove(object.ref());
         if (ref != null) {
             batchForDispose(ref);
         } else {
--- a/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java	Tue Jul 01 15:12:59 2014 +0100
@@ -381,7 +381,7 @@
      *         the specified parameter.
      */
     public ParameterBlock add(long l) {
-        return add(new Long(l));
+        return add(Long.valueOf(l));
     }
 
     /**
@@ -505,7 +505,7 @@
      *        the specified parameter.
      */
     public ParameterBlock set(long l, int index) {
-        return set(new Long(l), index);
+        return set(Long.valueOf(l), index);
     }
 
     /**
--- a/jdk/src/share/classes/java/text/DecimalFormat.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/java/text/DecimalFormat.java	Tue Jul 01 15:12:59 2014 +0100
@@ -2094,7 +2094,7 @@
             }
 
             return gotDouble ?
-                (Number)new Double(doubleResult) : (Number)new Long(longResult);
+                (Number)new Double(doubleResult) : (Number)Long.valueOf(longResult);
         }
     }
 
--- a/jdk/src/share/classes/javax/management/loading/MLet.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/javax/management/loading/MLet.java	Tue Jul 01 15:12:59 2014 +0100
@@ -1311,7 +1311,7 @@
         if (type.compareTo("java.lang.Short") == 0)
              return new Short(param);
         if (type.compareTo("java.lang.Long") == 0)
-             return new Long(param);
+             return Long.valueOf(param);
         if (type.compareTo("java.lang.Integer") == 0)
              return new Integer(param);
         if (type.compareTo("java.lang.Float") == 0)
--- a/jdk/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java	Tue Jul 01 15:12:59 2014 +0100
@@ -544,7 +544,7 @@
             }
 
             // convert seconds to milliseconds for time comparison
-            currencyPeriod = ((new Long(expTime)).longValue()) * 1000;
+            currencyPeriod = Long.parseLong(expTime) * 1000;
             if (currencyPeriod < 0) {
                 /* if currencyTimeLimit is -1 then value is never cached */
                 returnCachedValue = false;
@@ -580,7 +580,7 @@
                 if (tStamp == null)
                     tStamp = "0";
 
-                long lastTime = (new Long(tStamp)).longValue();
+                long lastTime = Long.parseLong(tStamp);
 
                 if (tracing) {
                     MODELMBEAN_LOGGER.logp(Level.FINER,
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java	Tue Jul 01 15:12:59 2014 +0100
@@ -458,7 +458,7 @@
         Integer fiveHundred = new Integer(500);
 
         // *** Shared Longs
-        Long oneThousand = new Long(1000);
+        Long oneThousand = 1000L;
 
         LazyValue dialogPlain12 = t ->
             new FontUIResource(Font.DIALOG, Font.PLAIN, 12);
--- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfLongMonitor.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfLongMonitor.java	Tue Jul 01 15:12:59 2014 +0100
@@ -66,7 +66,7 @@
      *                  return type is guaranteed to be of type Long.
      */
     public Object getValue() {
-        return new Long(lb.get(0));
+        return Long.valueOf(lb.get(0));
     }
 
     /**
--- a/jdk/src/share/classes/sun/management/GcInfoCompositeData.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/management/GcInfoCompositeData.java	Tue Jul 01 15:12:59 2014 +0100
@@ -105,10 +105,10 @@
 
         try {
             baseGcInfoItemValues = new Object[] {
-                new Long(info.getId()),
-                new Long(info.getStartTime()),
-                new Long(info.getEndTime()),
-                new Long(info.getDuration()),
+                info.getId(),
+                info.getStartTime(),
+                info.getEndTime(),
+                info.getDuration(),
                 memoryUsageMapType.toOpenTypeData(info.getMemoryUsageBeforeGc()),
                 memoryUsageMapType.toOpenTypeData(info.getMemoryUsageAfterGc()),
             };
--- a/jdk/src/share/classes/sun/management/HotspotThread.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/management/HotspotThread.java	Tue Jul 01 15:12:59 2014 +0100
@@ -60,7 +60,7 @@
         int numThreads = getInternalThreadTimes0(names, times);
         Map<String, Long> result = new HashMap<>(numThreads);
         for (int i = 0; i < numThreads; i++) {
-            result.put(names[i], new Long(times[i]));
+            result.put(names[i], times[i]);
         }
         return result;
     }
--- a/jdk/src/share/classes/sun/management/MemoryNotifInfoCompositeData.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/management/MemoryNotifInfoCompositeData.java	Tue Jul 01 15:12:59 2014 +0100
@@ -60,7 +60,7 @@
         final Object[] memoryNotifInfoItemValues = {
             memoryNotifInfo.getPoolName(),
             MemoryUsageCompositeData.toCompositeData(memoryNotifInfo.getUsage()),
-            new Long(memoryNotifInfo.getCount()),
+            memoryNotifInfo.getCount(),
         };
 
         try {
--- a/jdk/src/share/classes/sun/management/MemoryUsageCompositeData.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/management/MemoryUsageCompositeData.java	Tue Jul 01 15:12:59 2014 +0100
@@ -56,10 +56,10 @@
         // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH
         // memoryUsageItemNames!
         final Object[] memoryUsageItemValues = {
-            new Long(usage.getInit()),
-            new Long(usage.getUsed()),
-            new Long(usage.getCommitted()),
-            new Long(usage.getMax()),
+            usage.getInit(),
+            usage.getUsed(),
+            usage.getCommitted(),
+            usage.getMax(),
         };
 
         try {
--- a/jdk/src/share/classes/sun/management/ThreadInfoCompositeData.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/management/ThreadInfoCompositeData.java	Tue Jul 01 15:12:59 2014 +0100
@@ -108,16 +108,16 @@
         // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH
         // threadInfoItemNames!
         final Object[] threadInfoItemValues = {
-            new Long(threadInfo.getThreadId()),
+            threadInfo.getThreadId(),
             threadInfo.getThreadName(),
             threadInfo.getThreadState().name(),
-            new Long(threadInfo.getBlockedTime()),
-            new Long(threadInfo.getBlockedCount()),
-            new Long(threadInfo.getWaitedTime()),
-            new Long(threadInfo.getWaitedCount()),
+            threadInfo.getBlockedTime(),
+            threadInfo.getBlockedCount(),
+            threadInfo.getWaitedTime(),
+            threadInfo.getWaitedCount(),
             lockInfoData,
             threadInfo.getLockName(),
-            new Long(threadInfo.getLockOwnerId()),
+            threadInfo.getLockOwnerId(),
             threadInfo.getLockOwnerName(),
             stackTraceData,
                 threadInfo.isSuspended(),
--- a/jdk/src/share/classes/sun/management/counter/perf/LongCounterSnapshot.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/management/counter/perf/LongCounterSnapshot.java	Tue Jul 01 15:12:59 2014 +0100
@@ -43,7 +43,7 @@
     }
 
     public Object getValue() {
-        return new Long(value);
+        return Long.valueOf(value);
     }
 
     /**
--- a/jdk/src/share/classes/sun/management/counter/perf/PerfLongCounter.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/management/counter/perf/PerfLongCounter.java	Tue Jul 01 15:12:59 2014 +0100
@@ -42,7 +42,7 @@
     }
 
     public Object getValue() {
-        return new Long(lb.get(0));
+        return Long.valueOf(lb.get(0));
     }
 
     /**
--- a/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmClassLoadingImpl.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmClassLoadingImpl.java	Tue Jul 01 15:12:59 2014 +0100
@@ -129,21 +129,21 @@
      * Getter for the "JvmClassesUnloadedCount" variable.
      */
     public Long getJvmClassesUnloadedCount() throws SnmpStatusException {
-        return new Long(getClassLoadingMXBean().getUnloadedClassCount());
+        return getClassLoadingMXBean().getUnloadedClassCount();
     }
 
     /**
      * Getter for the "JvmClassesTotalLoadedCount" variable.
      */
     public Long getJvmClassesTotalLoadedCount() throws SnmpStatusException {
-        return new Long(getClassLoadingMXBean().getTotalLoadedClassCount());
+        return getClassLoadingMXBean().getTotalLoadedClassCount();
     }
 
     /**
      * Getter for the "JvmClassesLoadedCount" variable.
      */
     public Long getJvmClassesLoadedCount() throws SnmpStatusException {
-        return new Long(getClassLoadingMXBean().getLoadedClassCount());
+        return (long)getClassLoadingMXBean().getLoadedClassCount();
     }
 
 }
--- a/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmCompilationImpl.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmCompilationImpl.java	Tue Jul 01 15:12:59 2014 +0100
@@ -115,7 +115,7 @@
             t = getCompilationMXBean().getTotalCompilationTime();
         else
             t = 0;
-        return new Long(t);
+        return t;
     }
 
     /**
--- a/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmMemGCEntryImpl.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmMemGCEntryImpl.java	Tue Jul 01 15:12:59 2014 +0100
@@ -70,7 +70,7 @@
      */
     // Don't bother to uses the request contextual cache for this.
     public Long getJvmMemGCTimeMs() throws SnmpStatusException {
-        return new Long(gcm.getCollectionTime());
+        return gcm.getCollectionTime();
     }
 
     /**
@@ -78,7 +78,7 @@
      */
     // Don't bother to uses the request contextual cache for this.
     public Long getJvmMemGCCount() throws SnmpStatusException {
-        return new Long(gcm.getCollectionCount());
+        return gcm.getCollectionCount();
     }
 
     /**
--- a/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmMemPoolEntryImpl.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmMemPoolEntryImpl.java	Tue Jul 01 15:12:59 2014 +0100
@@ -191,7 +191,7 @@
      */
     public Long getJvmMemPoolMaxSize() throws SnmpStatusException {
         final long val = getMemoryUsage().getMax();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -200,7 +200,7 @@
      */
     public Long getJvmMemPoolUsed() throws SnmpStatusException {
         final long val = getMemoryUsage().getUsed();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -209,7 +209,7 @@
      */
     public Long getJvmMemPoolInitSize() throws SnmpStatusException {
         final long val = getMemoryUsage().getInit();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -218,7 +218,7 @@
      */
     public Long getJvmMemPoolCommitted() throws SnmpStatusException {
         final long val = getMemoryUsage().getCommitted();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -227,7 +227,7 @@
      */
     public Long getJvmMemPoolPeakMaxSize() throws SnmpStatusException {
         final long val = getPeakMemoryUsage().getMax();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -236,7 +236,7 @@
      */
     public Long getJvmMemPoolPeakUsed() throws SnmpStatusException {
         final long val = getPeakMemoryUsage().getUsed();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -245,7 +245,7 @@
      */
     public Long getJvmMemPoolPeakCommitted() throws SnmpStatusException {
         final long val = getPeakMemoryUsage().getCommitted();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -254,7 +254,7 @@
      */
     public Long getJvmMemPoolCollectMaxSize() throws SnmpStatusException {
         final long val = getCollectMemoryUsage().getMax();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -263,7 +263,7 @@
      */
     public Long getJvmMemPoolCollectUsed() throws SnmpStatusException {
         final long val = getCollectMemoryUsage().getUsed();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -272,7 +272,7 @@
      */
     public Long getJvmMemPoolCollectCommitted() throws SnmpStatusException {
         final long val = getCollectMemoryUsage().getCommitted();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -283,7 +283,7 @@
         if (!pool.isUsageThresholdSupported())
             return JvmMemoryImpl.Long0;
         final long val = pool.getUsageThreshold();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -334,7 +334,7 @@
         if (!pool.isUsageThresholdSupported())
             return JvmMemoryImpl.Long0;
         final long val = pool.getUsageThresholdCount();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -345,7 +345,7 @@
         if (!pool.isCollectionUsageThresholdSupported())
             return JvmMemoryImpl.Long0;
         final long val = pool.getCollectionUsageThreshold();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -399,7 +399,7 @@
         if (!pool.isCollectionUsageThresholdSupported())
             return JvmMemoryImpl.Long0;
         final long val = pool.getCollectionUsageThresholdCount();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return JvmMemoryImpl.Long0;
     }
 
@@ -450,7 +450,7 @@
      */
     public synchronized Long getJvmMemPoolPeakReset()
         throws SnmpStatusException {
-        return new Long(jvmMemPoolPeakReset);
+        return jvmMemPoolPeakReset;
     }
 
     /**
--- a/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmMemoryImpl.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmMemoryImpl.java	Tue Jul 01 15:12:59 2014 +0100
@@ -222,7 +222,7 @@
         }
     }
 
-    static final Long Long0 = new Long(0);
+    static final Long Long0 = 0L;
 
     /**
      * Getter for the "JvmMemoryNonHeapMaxSize" variable.
@@ -230,7 +230,7 @@
     public Long getJvmMemoryNonHeapMaxSize()
         throws SnmpStatusException {
         final long val = getNonHeapMemoryUsage().getMax();
-        if (val > -1) return  new Long(val);
+        if (val > -1) return  val;
         else return Long0;
     }
 
@@ -239,7 +239,7 @@
      */
     public Long getJvmMemoryNonHeapCommitted() throws SnmpStatusException {
         final long val = getNonHeapMemoryUsage().getCommitted();
-        if (val > -1) return new Long(val);
+        if (val > -1) return val;
         else return Long0;
     }
 
@@ -248,7 +248,7 @@
      */
     public Long getJvmMemoryNonHeapUsed() throws SnmpStatusException {
         final long val = getNonHeapMemoryUsage().getUsed();
-        if (val > -1) return new Long(val);
+        if (val > -1) return val;
         else return Long0;
     }
 
@@ -257,7 +257,7 @@
      */
     public Long getJvmMemoryNonHeapInitSize() throws SnmpStatusException {
         final long val = getNonHeapMemoryUsage().getInit();
-        if (val > -1) return new Long(val);
+        if (val > -1) return val;
         else return Long0;
     }
 
@@ -266,7 +266,7 @@
      */
     public Long getJvmMemoryHeapMaxSize() throws SnmpStatusException {
         final long val = getHeapMemoryUsage().getMax();
-        if (val > -1) return new Long(val);
+        if (val > -1) return val;
         else return Long0;
     }
 
@@ -320,7 +320,7 @@
      */
     public Long getJvmMemoryHeapCommitted() throws SnmpStatusException {
         final long val = getHeapMemoryUsage().getCommitted();
-        if (val > -1) return new Long(val);
+        if (val > -1) return val;
         else return Long0;
     }
 
@@ -359,7 +359,7 @@
      */
     public Long getJvmMemoryHeapUsed() throws SnmpStatusException {
         final long val = getHeapMemoryUsage().getUsed();
-        if (val > -1) return new Long(val);
+        if (val > -1) return val;
         else return Long0;
     }
 
@@ -368,7 +368,7 @@
      */
     public Long getJvmMemoryHeapInitSize() throws SnmpStatusException {
         final long val = getHeapMemoryUsage().getInit();
-        if (val > -1) return new Long(val);
+        if (val > -1) return val;
         else return Long0;
     }
 
@@ -380,11 +380,11 @@
         final long val = ManagementFactory.getMemoryMXBean().
             getObjectPendingFinalizationCount();
 
-        if (val > -1) return new Long((int)val);
+        if (val > -1) return Long.valueOf((int) val);
 
         // Should never happen... but stay safe all the same.
         //
-        else return new Long(0);
+        else return 0L;
     }
 
     static final MibLogger log = new MibLogger(JvmMemoryImpl.class);
--- a/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmRuntimeImpl.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmRuntimeImpl.java	Tue Jul 01 15:12:59 2014 +0100
@@ -259,14 +259,14 @@
      * Getter for the "JvmRTUptimeMs" variable.
      */
     public Long getJvmRTUptimeMs() throws SnmpStatusException {
-        return new Long(getRuntimeMXBean().getUptime());
+        return getRuntimeMXBean().getUptime();
     }
 
     /**
      * Getter for the "JvmRTStartTimeMs" variable.
      */
     public Long getJvmRTStartTimeMs() throws SnmpStatusException {
-        return new Long(getRuntimeMXBean().getStartTime());
+        return getRuntimeMXBean().getStartTime();
     }
 
     /**
--- a/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmThreadInstanceEntryImpl.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmThreadInstanceEntryImpl.java	Tue Jul 01 15:12:59 2014 +0100
@@ -231,7 +231,7 @@
             log.debug("getJvmThreadInstCpuTimeNs",
                       "Operation not supported: " + e);
         }
-        return new Long(l);
+        return l;
     }
 
     /**
@@ -248,14 +248,14 @@
             //Monitoring is disabled
             if(l == -1) l = 0;
         }
-        return new Long(l);
+        return l;
     }
 
     /**
      * Getter for the "JvmThreadInstBlockCount" variable.
      */
     public Long getJvmThreadInstBlockCount() throws SnmpStatusException {
-        return new Long(info.getBlockedCount());
+        return info.getBlockedCount();
     }
 
     /**
@@ -272,14 +272,14 @@
             //Monitoring is disabled
             if(l == -1) l = 0;
         }
-        return new Long(l);
+        return l;
     }
 
     /**
      * Getter for the "JvmThreadInstWaitCount" variable.
      */
     public Long getJvmThreadInstWaitCount() throws SnmpStatusException {
-        return new Long(info.getWaitedCount());
+        return info.getWaitedCount();
     }
 
     /**
@@ -294,7 +294,7 @@
      * Getter for the "JvmThreadInstId" variable.
      */
     public Long getJvmThreadInstId() throws SnmpStatusException {
-        return new Long(info.getThreadId());
+        return info.getThreadId();
     }
 
     /**
--- a/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmThreadingImpl.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmThreadingImpl.java	Tue Jul 01 15:12:59 2014 +0100
@@ -303,28 +303,28 @@
      * 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();
     }
 
    /**
@@ -332,7 +332,7 @@
      */
     public synchronized Long getJvmThreadPeakCountReset()
         throws SnmpStatusException {
-        return new Long(jvmThreadPeakCountReset);
+        return jvmThreadPeakCountReset;
     }
 
     /**
--- a/jdk/src/share/classes/sun/nio/ch/Util.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/nio/ch/Util.java	Tue Jul 01 15:12:59 2014 +0100
@@ -329,7 +329,7 @@
         try {
             dbb = (MappedByteBuffer)directByteBufferConstructor.newInstance(
               new Object[] { new Integer(size),
-                             new Long(addr),
+                             addr,
                              fd,
                              unmapper });
         } catch (InstantiationException |
@@ -374,7 +374,7 @@
         try {
             dbb = (MappedByteBuffer)directByteBufferRConstructor.newInstance(
               new Object[] { new Integer(size),
-                             new Long(addr),
+                             addr,
                              fd,
                              unmapper });
         } catch (InstantiationException |
--- a/jdk/src/share/classes/sun/security/action/GetLongAction.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/security/action/GetLongAction.java	Tue Jul 01 15:12:59 2014 +0100
@@ -106,7 +106,7 @@
     public Long run() {
         Long value = Long.getLong(theProp);
         if ((value == null) && defaultSet)
-            return new Long(defaultVal);
+            return defaultVal;
         return value;
     }
 }
--- a/jdk/src/share/classes/sun/security/jgss/wrapper/GSSNameElement.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/security/jgss/wrapper/GSSNameElement.java	Tue Jul 01 15:12:59 2014 +0100
@@ -203,7 +203,7 @@
     }
 
     public int hashCode() {
-        return new Long(pName).hashCode();
+        return Long.hashCode(pName);
     }
 
     public byte[] export() throws GSSException {
--- a/jdk/src/share/classes/sun/security/krb5/internal/KerberosTime.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/security/krb5/internal/KerberosTime.java	Tue Jul 01 15:12:59 2014 +0100
@@ -188,8 +188,8 @@
     }
 
     public int getMicroSeconds() {
-        Long temp_long = new Long((kerberosTime % 1000L) * 1000L);
-        return temp_long.intValue() + microSeconds;
+        int temp_int = (int) ((kerberosTime % 1000L) * 1000L);
+        return temp_int + microSeconds;
     }
 
     /**
@@ -250,8 +250,7 @@
     }
 
     public int getSeconds() {
-        Long temp_long = new Long(kerberosTime / 1000L);
-        return temp_long.intValue();
+        return (int) (kerberosTime / 1000L);
     }
 
     /**
--- a/jdk/src/share/classes/sun/security/tools/keytool/Main.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/security/tools/keytool/Main.java	Tue Jul 01 15:12:59 2014 +0100
@@ -1675,7 +1675,7 @@
             Object[] source = {new Integer(keysize),
                                 privKey.getAlgorithm(),
                                 chain[0].getSigAlgName(),
-                                new Long(validity),
+                                validity,
                                 x500Name};
             System.err.println(form.format(source));
         }
--- a/jdk/src/share/classes/sun/tools/java/BinaryConstantPool.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/tools/java/BinaryConstantPool.java	Tue Jul 01 15:12:59 2014 +0100
@@ -66,7 +66,7 @@
                 cpool[i] = new Float(in.readFloat());
                 break;
               case CONSTANT_LONG:
-                cpool[i++] = new Long(in.readLong());
+                cpool[i++] = in.readLong();
                 break;
               case CONSTANT_DOUBLE:
                 cpool[i++] = new Double(in.readDouble());
--- a/jdk/src/share/classes/sun/tools/jconsole/MemoryPoolProxy.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/tools/jconsole/MemoryPoolProxy.java	Tue Jul 01 15:12:59 2014 +0100
@@ -56,7 +56,7 @@
                 ObjectName mbeanName = new ObjectName(GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE +
                                                       ",name=" + name);
                 if (client.isRegistered(mbeanName)) {
-                    gcMBeans.put(mbeanName, new Long(0));
+                    gcMBeans.put(mbeanName, 0L);
                 }
             } catch (Exception e) {
                 assert false;
@@ -97,7 +97,7 @@
             Long gcCount = e.getValue();
             Long newCount = gc.getCollectionCount();
             if (newCount > gcCount) {
-                gcMBeans.put(e.getKey(), new Long(newCount));
+                gcMBeans.put(e.getKey(), newCount);
                 lastGcInfo = gc.getLastGcInfo();
                 if (lastGcInfo.getEndTime() > lastGcEndTime) {
                     gcId = lastGcInfo.getId();
--- a/jdk/src/share/classes/sun/tools/tree/BitNotExpression.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/BitNotExpression.java	Tue Jul 01 15:12:59 2014 +0100
@@ -83,7 +83,7 @@
             asm.add(where, opc_ldc, new Integer(-1));
             asm.add(where, opc_ixor);
         } else {
-            asm.add(where, opc_ldc2_w, new Long(-1));
+            asm.add(where, opc_ldc2_w, -1L);
             asm.add(where, opc_lxor);
         }
     }
--- a/jdk/src/share/classes/sun/tools/tree/IncDecExpression.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/IncDecExpression.java	Tue Jul 01 15:12:59 2014 +0100
@@ -131,7 +131,7 @@
             asm.add(where, inc ? opc_iadd : opc_isub);
             break;
           case TC_LONG:
-            asm.add(where, opc_ldc2_w, new Long(1));
+            asm.add(where, opc_ldc2_w, 1L);
             asm.add(where, inc ? opc_ladd : opc_lsub);
             break;
           case TC_FLOAT:
--- a/jdk/src/share/classes/sun/tools/tree/LongExpression.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/LongExpression.java	Tue Jul 01 15:12:59 2014 +0100
@@ -50,7 +50,7 @@
      * Get the value
      */
     public Object getValue() {
-        return new Long(value);
+        return value;
     }
 
     /**
@@ -71,7 +71,7 @@
      * Code
      */
     public void codeValue(Environment env, Context ctx, Assembler asm) {
-        asm.add(where, opc_ldc2_w, new Long(value));
+        asm.add(where, opc_ldc2_w, value);
     }
 
     /**
--- a/jdk/src/solaris/classes/java/util/prefs/FileSystemPreferences.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/solaris/classes/java/util/prefs/FileSystemPreferences.java	Tue Jul 01 15:12:59 2014 +0100
@@ -747,7 +747,7 @@
                        nmt = systemRootModFile.lastModified();
                        isSystemRootModified = systemRootModTime == nmt;
                    }
-                   return new Long(nmt);
+                   return nmt;
                }
            });
            try {
--- a/jdk/src/solaris/classes/sun/awt/X11/XFocusProxyWindow.java	Tue Jul 01 17:58:14 2014 +0200
+++ b/jdk/src/solaris/classes/sun/awt/X11/XFocusProxyWindow.java	Tue Jul 01 15:12:59 2014 +0100
@@ -38,8 +38,9 @@
     public XFocusProxyWindow(XWindowPeer owner) {
         super(new XCreateWindowParams(new Object[] {
             BOUNDS, new Rectangle(-1, -1, 1, 1),
-            PARENT_WINDOW, new Long(owner.getWindow()),
-            EVENT_MASK, new Long(XConstants.FocusChangeMask | XConstants.KeyPressMask | XConstants.KeyReleaseMask)
+            PARENT_WINDOW, Long.valueOf(owner.getWindow()),
+            EVENT_MASK, Long.valueOf(XConstants.FocusChangeMask | XConstants
+                .KeyPressMask | XConstants.KeyReleaseMask)
         }));
         this.owner = owner;
     }