Skip to content

Commit 3aa8520

Browse files
committed
GH-595 handle null field value
1 parent ebb206c commit 3aa8520

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

visualvm/heapviewer/src/org/graalvm/visualvm/heapviewer/java/impl/JavaFieldsPlugin.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,9 @@ public int hashCode() {
607607
return getInstance() == null ? 37 : super.hashCode();
608608
}
609609

610+
public boolean isLeaf() {
611+
return valuesCount == 0;
612+
}
610613

611614
abstract String fieldName();
612615

@@ -643,6 +646,7 @@ protected ProgressIterator<Instance> objectsIterator(int index, final Progress _
643646
protected boolean exclude(Instance instance) {
644647
_progress.step();
645648
FieldValue value = getValueOfField(instance, fieldName);
649+
if (value == null) return _instance != null;
646650
if (!(value instanceof ObjectFieldValue)) return true;
647651
return !Objects.equals(_instance, ((ObjectFieldValue)value).getInstance());
648652
}

0 commit comments

Comments
 (0)