# HG changeset patch # User dbuck # Date 1503475656 14400 # Node ID ea7502500b78880cf7da084d5aa5dc5176713b25 # Parent 16939858a716655165759a306696867ffe8a0c7f 6656031: SA: jmap -permstat number of classes is off by 1 Reviewed-by: sla, dholmes diff -r 16939858a716 -r ea7502500b78 agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java --- 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) {