8032763: Remove use of sun.misc.Ref from hprof parser in testlibrary
authorykantser
Thu, 09 Jul 2015 12:56:38 +0200
changeset 31764 c8288a6fc39a
parent 31576 e9ea6d99c16c
child 31765 67d0d016d33a
8032763: Remove use of sun.misc.Ref from hprof parser in testlibrary Reviewed-by: jbachorik, alanb
test/lib/share/classes/jdk/test/lib/hprof/model/Snapshot.java
--- a/test/lib/share/classes/jdk/test/lib/hprof/model/Snapshot.java	Mon Jul 06 22:19:29 2015 -0400
+++ b/test/lib/share/classes/jdk/test/lib/hprof/model/Snapshot.java	Thu Jul 09 12:56:38 2015 +0200
@@ -276,10 +276,8 @@
         fakeClasses.clear();
 
         weakReferenceClass = findClass("java.lang.ref.Reference");
-        if (weakReferenceClass == null)  {      // JDK 1.1.x
-            weakReferenceClass = findClass("sun.misc.Ref");
-            referentFieldIndex = 0;
-        } else {
+        referentFieldIndex = 0;
+        if (weakReferenceClass != null)  {
             JavaField[] fields = weakReferenceClass.getFieldsForInstance();
             for (int i = 0; i < fields.length; i++) {
                 if ("referent".equals(fields[i].getName())) {