if (details.objects.getAndSet(id, true)) {
continue;
}
Instance i = heap.getInstanceByID(id);
if (blacklist.contains(i.getJavaClass().getName())) {
continue;
}
++count;
@SuppressWarnings("unused")
String type = i.getJavaClass().getName();
if (!accountShared || sharedRefs.get(i.getInstanceId())) {
details.summary.accumulate(i);
}
if (i instanceof ObjectArrayInstance) {
ObjectArrayInstance array = (ObjectArrayInstance) i;
if (!isBlackListedArray(array.getJavaClass())) {
for(Long ref: array.getValueIDs()) {
if (ref != 0) {
// early check to avoid needless instantiation
if (!ignoreRefs.get(ref) && !details.objects.get(ref)) {
queue.set(ref, true);
}
}
}
}
}
else {
for(FieldValue f: i.getFieldValues()) {
@SuppressWarnings("unused")
String fieldName = f.getField().getName();
if (f instanceof ObjectFieldValue) {
ObjectFieldValue of = (ObjectFieldValue) f;
if (!isBlackListed(of.getField())) {