6656031: SA: jmap -permstat number of classes is off by 1
authorjbachorik
Thu, 30 Jan 2014 09:41:45 +0100
changeset 22733 61060412fd34
parent 22543 7c65ca499b9b
child 22734 41757c1f3946
6656031: SA: jmap -permstat number of classes is off by 1 Reviewed-by: sla, dholmes
hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java	Tue Jan 28 06:26:36 2014 -0800
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java	Thu Jan 30 09:41:45 2014 +0100
@@ -103,11 +103,12 @@
       }
 
       SystemDictionary dict = VM.getVM().getSystemDictionary();
-      dict.classesDo(new SystemDictionary.ClassAndLoaderVisitor() {
-                        public void visit(Klass k, Oop loader) {
+      dict.classesDo(new SystemDictionary.ClassVisitor() {
+                        public void visit(Klass k) {
                            if (! (k instanceof InstanceKlass)) {
                               return;
                            }
+                           Oop loader = ((InstanceKlass) k).getClassLoader();
                            LoaderData ld = (loader != null) ? (LoaderData)loaderMap.get(loader)
                                                             : bootstrapLoaderData;
                            if (ld != null) {