diff agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java @ 2411:63997f575155

7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue Reviewed-by: kvn, dcubed
author never
date Wed, 30 Mar 2011 07:47:19 -0700
parents c7f3d0b4570f
children 7588156f5cf9
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java	Wed Mar 30 03:48:38 2011 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java	Wed Mar 30 07:47:19 2011 -0700
@@ -839,20 +839,18 @@
   }
 
   private void readSystemProperties() {
-     final InstanceKlass systemKls = getSystemDictionary().getSystemKlass();
-     systemKls.iterate(new DefaultOopVisitor() {
-                               ObjectReader objReader = new ObjectReader();
-                               public void doOop(sun.jvm.hotspot.oops.OopField field, boolean isVMField) {
-                                  if (field.getID().getName().equals("props")) {
-                                     try {
-                                        sysProps = (Properties) objReader.readObject(field.getValue(systemKls.getJavaMirror()));
-                                     } catch (Exception e) {
-                                        if (Assert.ASSERTS_ENABLED) {
-                                           e.printStackTrace();
-                                        }
-                                     }
-                                  }
-                               }
-                        }, false);
+    final InstanceKlass systemKls = getSystemDictionary().getSystemKlass();
+    systemKls.iterateStaticFields(new DefaultOopVisitor() {
+        ObjectReader objReader = new ObjectReader();
+        public void doOop(sun.jvm.hotspot.oops.OopField field, boolean isVMField) {
+          if (field.getID().getName().equals("props")) {
+            try {
+              sysProps = (Properties) objReader.readObject(field.getValue(getObj()));
+            } catch (Exception e) {
+              e.printStackTrace();
+            }
+          }
+        }
+      });
   }
 }