--- old/src/hotspot/share/prims/jvmtiExport.cpp Wed Nov 8 08:12:55 2017 +++ new/src/hotspot/share/prims/jvmtiExport.cpp Wed Nov 8 08:12:54 2017 @@ -2788,9 +2788,7 @@ return; } - ThreadsListHandle tlh; - JavaThreadIterator jti(tlh.list()); - for (JavaThread *jthr = jti.first(); jthr != NULL; jthr = jti.next()) { + for (JavaThreadIteratorWithHandle jtiwh; JavaThread *jthr = jtiwh.next(); ) { JvmtiThreadState *state = jthr->jvmti_thread_state(); if (state != NULL) { JvmtiVMObjectAllocEventCollector *collector;