src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.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

*** 779,789 **** */ if (signature != null) { type.setSignature(signature); } ! typesByID.put(new Long(id), type); typesBySignature.add(type); if ((vm.traceFlags & VirtualMachine.TRACE_REFTYPES) != 0) { vm.printTrace("Caching new ReferenceType, sig=" + signature + ", id=" + id); --- 779,789 ---- */ if (signature != null) { type.setSignature(signature); } ! typesByID.put(id, type); typesBySignature.add(type); if ((vm.traceFlags & VirtualMachine.TRACE_REFTYPES) != 0) { vm.printTrace("Caching new ReferenceType, sig=" + signature + ", id=" + id);
*** 807,817 **** ReferenceTypeImpl type = (ReferenceTypeImpl)iter.next(); int comp = signature.compareTo(type.signature()); if (comp == 0) { matches++; iter.remove(); ! typesByID.remove(new Long(type.ref())); if ((vm.traceFlags & VirtualMachine.TRACE_REFTYPES) != 0) { vm.printTrace("Uncaching ReferenceType, sig=" + signature + ", id=" + type.ref()); } /* fix for 4359077 , don't break out. list is no longer sorted --- 807,817 ---- ReferenceTypeImpl type = (ReferenceTypeImpl)iter.next(); int comp = signature.compareTo(type.signature()); if (comp == 0) { matches++; iter.remove(); ! typesByID.remove(type.ref()); if ((vm.traceFlags & VirtualMachine.TRACE_REFTYPES) != 0) { vm.printTrace("Uncaching ReferenceType, sig=" + signature + ", id=" + type.ref()); } /* fix for 4359077 , don't break out. list is no longer sorted
*** 893,903 **** return null; } else { ReferenceTypeImpl retType = null; synchronized (this) { if (typesByID != null) { ! retType = (ReferenceTypeImpl)typesByID.get(new Long(id)); } if (retType == null) { retType = addReferenceType(id, tag, signature); } } --- 893,903 ---- return null; } else { ReferenceTypeImpl retType = null; synchronized (this) { if (typesByID != null) { ! retType = (ReferenceTypeImpl)typesByID.get(id); } if (retType == null) { retType = addReferenceType(id, tag, signature); } }
*** 1245,1255 **** if (id == 0) { return null; } ObjectReferenceImpl object = null; ! Long key = new Long(id); /* * Attempt to retrieve an existing object object reference */ SoftObjectReference ref = objectsByID.get(key); --- 1245,1255 ---- if (id == 0) { return null; } ObjectReferenceImpl object = null; ! Long key = id; /* * Attempt to retrieve an existing object object reference */ SoftObjectReference ref = objectsByID.get(key);
*** 1311,1321 **** synchronized void removeObjectMirror(ObjectReferenceImpl object) { // Handle any queue elements that are not strongly reachable processQueue(); ! SoftObjectReference ref = objectsByID.remove(new Long(object.ref())); if (ref != null) { batchForDispose(ref); } else { /* * If there's a live ObjectReference about, it better be part --- 1311,1321 ---- synchronized void removeObjectMirror(ObjectReferenceImpl object) { // Handle any queue elements that are not strongly reachable processQueue(); ! SoftObjectReference ref = objectsByID.remove(object.ref()); if (ref != null) { batchForDispose(ref); } else { /* * If there's a live ObjectReference about, it better be part