Map javaClasses = new HashMap();
Iterator itClassLoader = jr.getJavaClassLoaders().iterator();
// create Map of all classes in this JavaRuntime's class loaders
while (itClassLoader.hasNext()) {
JavaClassLoader jcl = (JavaClassLoader)itClassLoader.next();
// Check for any corrupt data for this classloader
Iterator itCache = jcl.getCachedClasses().iterator();
while (itCache.hasNext()) {
Object next = itCache.next();
if (next instanceof CorruptData){
// Warn the user that the classloader data is corrupt
try {
long jclAddress = jcl.getObject().getID().getAddress();
out.print("\t classloader ID: " + Utils.toHex(jclAddress) + " " + Exceptions.getCorruptDataExceptionString() + "\n");
} catch (CorruptDataException e) {
out.print("\t classloader ID: <unknown> " + Exceptions.getCorruptDataExceptionString() + "\n");
}
break;
}
}
Iterator itClass = jcl.getDefinedClasses().iterator();
while (itClass.hasNext()) {
javaClasses.put((JavaClass)itClass.next(), new Datum());
}
}