mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8244203: sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java fails with NullPointerException
Reviewed-by: sspitsyn, dtitov
This commit is contained in:
parent
4aa057013c
commit
9dc6f10755
4 changed files with 34 additions and 6 deletions
|
@ -145,6 +145,18 @@ public class InstanceKlass extends Klass {
|
|||
|
||||
public InstanceKlass(Address addr) {
|
||||
super(addr);
|
||||
|
||||
// If the class hasn't yet reached the "loaded" init state, then don't go any further
|
||||
// or we'll run into problems trying to look at fields that are not yet setup.
|
||||
// Attempted lookups of this InstanceKlass via ClassLoaderDataGraph, ClassLoaderData,
|
||||
// and Dictionary will all refuse to return it. The main purpose of allowing this
|
||||
// InstanceKlass to initialize is so ClassLoaderData.getKlasses() will succeed, allowing
|
||||
// ClassLoaderData.classesDo() to iterate over all Klasses (skipping those that are
|
||||
// not yet fully loaded).
|
||||
if (!isLoaded()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (getJavaFieldsCount() != getAllFieldsCount()) {
|
||||
// Exercise the injected field logic
|
||||
for (int i = getJavaFieldsCount(); i < getAllFieldsCount(); i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue