changeset 8427:ea7502500b78

6656031: SA: jmap -permstat number of classes is off by 1 Reviewed-by: sla, dholmes
author dbuck
date Wed, 23 Aug 2017 04:07:36 -0400
parents 16939858a716
children 96e9e479ff8a
files agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java	Mon Aug 21 11:34:41 2017 -0400
+++ b/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java	Wed Aug 23 04:07:36 2017 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -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) {