changeset 58224:b82209a3f793

8235530: Removed duplicated threadByName methods in nsk/jdi tests Reviewed-by: dholmes, sspitsyn
author lmesnik
date Mon, 09 Dec 2019 13:02:07 -0800
parents 17b0f051280f
children 35d8d9b65744
files test/hotspot/jtreg/vmTestbase/nsk/jdi/BooleanType/_itself_/booleantype001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/location/location001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ByteType/_itself_/bytetype001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/CharType/_itself_/chartype001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassLoaderReference/definedClasses/definedclasses001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassLoaderReference/visibleClasses/visibleclasses001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassExclusionFilter/filter003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_rt/filter_rt002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_s/filter_s002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod015.java test/hotspot/jtreg/vmTestbase/nsk/jdi/DoubleType/_itself_/doubletype001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/request/request001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventIterator/nextEvent/nextevent001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventQueue/remove/remove004.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventQueue/remove_l/remove_l004.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/addCountFilter/addcountfilter001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/disable/disable001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/disable/disable002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/enable/enable001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/enable/enable002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/getProperty/getproperty001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/hashCode/hashcode001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/isEnabled/isenabled001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/putProperty/putproperty001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setSuspendPolicy/setsuspendpolicy001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/suspendPolicy/suspendpolicy001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/accessWatchpointRequests/accwtchpreq002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/breakpointRequests/breakpreq002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/classPrepareRequests/clsprepreq002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/classUnloadRequests/clsunlreq002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createAccessWatchpointRequest/craccwtchpreq003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createBreakpointRequest/crbreakpreq003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createClassPrepareRequest/cpreg001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createClassUnloadRequest/cureg001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createExceptionRequest/crexreq009.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createExceptionRequest/crexreq010.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createMethodEntryRequest/menreg001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createMethodExitRequest/mexreg001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createModificationWatchpointRequest/crmodwtchpreq003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq004.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq005.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq006.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq007.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq008.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq009.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq010.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createThreadDeathRequest/tdreg001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createThreadStartRequest/tsreg001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createVMDeathRequest/vmdreg001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/deleteAllBreakpoints/delallbreakp002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/deleteEventRequest/delevtreq002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/deleteEventRequests/delevtreqs002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/exceptionRequests/excreq002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/methodEntryRequests/methentreq002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/methodExitRequests/methexitreq002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/modificationWatchpointRequests/modwtchpreq002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/stepRequests/stepreq002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/threadDeathRequests/thrdeathreq002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/threadStartRequests/thrstartreq002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/vmDeathRequests/vmdeathreq001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/eventIterator/eventiterator001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/eventIterator/eventiterator002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/eventIterator/eventiterator003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/eventIterator/eventiterator004.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume004.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume005.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume006.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume007.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume010.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume011.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume012.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume013.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy004.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy005.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy006.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy007.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy008.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy009.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy010.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy011.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy012.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy013.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy014.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy015.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy016.java test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy017.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addClassExclusionFilter/filter002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addClassFilter_rt/filter_rt002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addClassFilter_s/filter_s002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addInstanceFilter/instancefilter002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addInstanceFilter/instancefilter003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addThreadFilter/threadfilter002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addThreadFilter/threadfilter003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/exception/exception001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/notifyCaught/notifycaught001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/notifyUncaught/notifyuncaught001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/FloatType/_itself_/floattype001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/IntegerType/_itself_/integertype001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/LocatableEvent/thread/thread001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/LongType/_itself_/longtype001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addClassExclusionFilter/filter002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addClassFilter_rt/filter_rt002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addClassFilter_s/filter_s002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addInstanceFilter/instancefilter002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addInstanceFilter/instancefilter003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addThreadFilter/threadfilter002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addThreadFilter/threadfilter003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addClassExclusionFilter/filter002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addClassFilter_rt/filter_rt002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addClassFilter_s/filter_s002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addInstanceFilter/instancefilter002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addInstanceFilter/instancefilter003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addThreadFilter/threadfilter002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addThreadFilter/threadfilter003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ModificationWatchpointEvent/_itself_/mwevent001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/disableCollection/disablecollection002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/PathSearchingVirtualMachine/classPath/classpath001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/PrimitiveType/_itself_/primitivetype001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/classLoader/classloader001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/getValue/getvalue001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/getValue/getvalue002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/getValue/getvalue003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/getValues/getvalues001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/isFinal/isfinal001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/isStatic/isstatic001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/isStatic/isstatic002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/nestedTypes/nestedtypes001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/nestedTypes/nestedtypes002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ShortType/_itself_/shorttype001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addClassExclusionFilter/filter002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addClassFilter_rt/filter_rt002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addClassFilter_s/filter_s002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addInstanceFilter/instancefilter002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addInstanceFilter/instancefilter003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/depth/depth001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/depth/depth002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/depth/depth003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/size/size001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/size/size002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/thread/thread001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter005.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes004.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes005.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter005.java test/hotspot/jtreg/vmTestbase/nsk/jdi/VMDeathEvent/_itself_/vmdeath002.java test/hotspot/jtreg/vmTestbase/nsk/jdi/VMDeathEvent/_itself_/vmdeath003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/allClasses/allclasses001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canAddMethod/canaddmethod001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canPopFrames/canpopframes001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canRedefineClasses/canredefineclasses001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canRequestVMDeathEvent/canreqvmdev001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canUnrestrictedlyRedefineClasses/curc001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canUseInstanceFilters/canusefilters001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canWatchFieldAccess/canwatchaccess001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canWatchFieldModification/canwatchmod001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/VoidType/_itself_/voidtype001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassExclusionFilter/filter003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassExclusionFilter/filter004.java test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt004.java test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_s/filter_s003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_s/filter_s004.java test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter004.java test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter005.java test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter006.java test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter003.java test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter004.java test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter005.java test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter006.java test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/field/field001.java test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/field/field002.java test/hotspot/jtreg/vmTestbase/nsk/share/jdi/Debugee.java test/hotspot/jtreg/vmTestbase/nsk/share/jdi/JDITestRuntimeException.java
diffstat 198 files changed, 306 insertions(+), 4126 deletions(-) [+]
line wrap: on
line diff
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/BooleanType/_itself_/booleantype001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/BooleanType/_itself_/booleantype001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -142,13 +142,6 @@
 
     static int  testExitCode = PASSED;
 
-
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -292,7 +285,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -347,20 +340,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -310,7 +304,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -419,20 +413,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -150,12 +150,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -298,7 +292,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -386,20 +380,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -156,12 +156,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -304,7 +298,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -405,19 +399,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
 
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -156,12 +156,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -285,7 +279,7 @@
         eventRManager = vm.eventRequestManager();
 
         ClassPrepareRequest cpRequest = eventRManager.createClassPrepareRequest();
-        cpRequest.setSuspendPolicy( EventRequest.SUSPEND_EVENT_THREAD);
+        cpRequest.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
         cpRequest.addClassFilter(debuggeeName);
 
         cpRequest.enable();
@@ -297,21 +291,21 @@
         debuggeeClass = event.referenceType();
 
         if (!debuggeeClass.name().equals(debuggeeName))
-           throw new JDITestRuntimeException("** Unexpected ClassName for ClassPrepareEvent **");
+            throw new JDITestRuntimeException("** Unexpected ClassName for ClassPrepareEvent **");
 
         log2("      received: ClassPrepareEvent for debuggeeClass");
 
         String bPointMethod = "methodForCommunication";
-        String lineForComm  = "lineForComm";
+        String lineForComm = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
-                                             debuggeeClass,
-                                            bPointMethod, lineForComm, "zero");
+                debuggeeClass,
+                bPointMethod, lineForComm, "zero");
         bpRequest.enable();
 
-    //------------------------------------------------------  testing section
+        //------------------------------------------------------  testing section
 
         log1("     TESTING BEGINS");
 
@@ -319,8 +313,8 @@
         EventRequest eventRequest2 = null;
         EventRequest eventRequest3 = null;
 
-        ThreadReference thread1     = null;
-        String          thread1Name = "thread1";
+        ThreadReference thread1 = null;
+        String thread1Name = "thread1";
 
         String property1 = "BreakpointRequest1";
         String property2 = "BreakpointRequest2";
@@ -337,7 +331,7 @@
             breakpointForCommunication();
 
             int instruction = ((IntegerValue)
-                               (debuggeeClass.getValue(debuggeeClass.fieldByName("instruction")))).value();
+                    (debuggeeClass.getValue(debuggeeClass.fieldByName("instruction")))).value();
 
             if (instruction == 0) {
                 vm.resume();
@@ -350,63 +344,63 @@
 
             switch (i) {
 
-              case 0:
-                     testClassReference =
+                case 0:
+                    testClassReference =
                             (ReferenceType) vm.classesByName(testedClassName).get(0);
 
-                     thread1 = (ThreadReference) debuggeeClass.getValue(
-                                        debuggeeClass.fieldByName(thread1Name));
+                    thread1 = (ThreadReference) debuggeeClass.getValue(
+                            debuggeeClass.fieldByName(thread1Name));
 
-                     eventRequest1 = setting2BreakpointRequest (null,
-                                             testClassReference, methodName, bpLineName,
-                                             EventRequest.SUSPEND_NONE, property1);
+                    eventRequest1 = setting2BreakpointRequest(null,
+                            testClassReference, methodName, bpLineName,
+                            EventRequest.SUSPEND_NONE, property1);
 
-                     try {
-                         log2("......eventRequest1.addThreadFilter(thread1);");
-                         log2("        no Exception expected");
-                         ((BreakpointRequest)eventRequest1).addThreadFilter(thread1);
-                         log2("        no Exception");
-                     } catch ( Exception e ) {
-                         log3("ERROR: Exception : " + e);
-                         testExitCode = FAILED;
-                     }
+                    try {
+                        log2("......eventRequest1.addThreadFilter(thread1);");
+                        log2("        no Exception expected");
+                        ((BreakpointRequest) eventRequest1).addThreadFilter(thread1);
+                        log2("        no Exception");
+                    } catch (Exception e) {
+                        log3("ERROR: Exception : " + e);
+                        testExitCode = FAILED;
+                    }
 
-                     break;
+                    break;
 
-              case 1:
-                     eventRequest2 = setting2BreakpointRequest (null,
-                                             testClassReference, methodName, bpLineName,
-                                             EventRequest.SUSPEND_NONE, property2);
+                case 1:
+                    eventRequest2 = setting2BreakpointRequest(null,
+                            testClassReference, methodName, bpLineName,
+                            EventRequest.SUSPEND_NONE, property2);
 
-                     try {
-                         log2("......eventRequest2.addThreadFilter(thread1);");
-                         log2("        no Exception expected");
-                         ((BreakpointRequest)eventRequest2).addThreadFilter(thread1);
-                         log2("        no Exception");
-                     } catch ( Exception e ) {
-                         log3("ERROR: Exception : " + e);
-                         testExitCode = FAILED;
-                     }
-                     break;
+                    try {
+                        log2("......eventRequest2.addThreadFilter(thread1);");
+                        log2("        no Exception expected");
+                        ((BreakpointRequest) eventRequest2).addThreadFilter(thread1);
+                        log2("        no Exception");
+                    } catch (Exception e) {
+                        log3("ERROR: Exception : " + e);
+                        testExitCode = FAILED;
+                    }
+                    break;
 
-              case 2:
-                     eventRequest3 = setting2BreakpointRequest (null,
-                                             testClassReference, methodName, bpLineName,
-                                             EventRequest.SUSPEND_NONE, property3);
+                case 2:
+                    eventRequest3 = setting2BreakpointRequest(null,
+                            testClassReference, methodName, bpLineName,
+                            EventRequest.SUSPEND_NONE, property3);
 
-                     try {
-                         log2("......eventRequest3.addThreadFilter(thread1);");
-                         log2("        no Exception expected");
-                         ((BreakpointRequest)eventRequest3).addThreadFilter(thread1);
-                         log2("        no Exception");
-                     } catch ( Exception e ) {
-                         log3("ERROR: Exception : " + e);
-                         testExitCode = FAILED;
-                     }
-                     break;
+                    try {
+                        log2("......eventRequest3.addThreadFilter(thread1);");
+                        log2("        no Exception expected");
+                        ((BreakpointRequest) eventRequest3).addThreadFilter(thread1);
+                        log2("        no Exception");
+                    } catch (Exception e) {
+                        log3("ERROR: Exception : " + e);
+                        testExitCode = FAILED;
+                    }
+                    break;
 
-              default:
-                      throw new JDITestRuntimeException("** default case 2 **");
+                default:
+                    throw new JDITestRuntimeException("** default case 2 **");
             }
             //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         }
@@ -414,20 +408,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/location/location001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/location/location001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -303,7 +297,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -377,20 +371,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ByteType/_itself_/bytetype001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ByteType/_itself_/bytetype001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -143,12 +143,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -292,7 +286,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -348,19 +342,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
 
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/CharType/_itself_/chartype001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/CharType/_itself_/chartype001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -143,12 +143,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -292,7 +286,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -348,19 +342,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
 
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassLoaderReference/definedClasses/definedclasses001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassLoaderReference/definedClasses/definedclasses001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -147,12 +147,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -296,7 +290,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -344,20 +338,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassLoaderReference/visibleClasses/visibleclasses001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassLoaderReference/visibleClasses/visibleclasses001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -160,12 +160,6 @@
         "^short(\\[\\])+", "^long(\\[\\])+", "^float(\\[\\])+", "^double(\\[\\])+"});
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -309,7 +303,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -390,21 +384,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassExclusionFilter/filter003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassExclusionFilter/filter003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -300,7 +294,7 @@
         String lineForComm  = "lineForComm";
 
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -388,20 +382,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_rt/filter_rt002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_rt/filter_rt002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -304,7 +298,7 @@
         String lineForComm  = "lineForComm";
 
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -395,20 +389,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_s/filter_s002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_s/filter_s002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -304,7 +298,7 @@
         String lineForComm  = "lineForComm";
 
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -392,20 +386,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod015.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod015.java	Mon Dec 09 13:02:07 2019 -0800
@@ -350,19 +350,6 @@
         }
     }
 
-
-    private ThreadReference threadByName(String name) throws Failure{
-        List all = vm.allThreads();
-        ListIterator li = all.listIterator();
-
-        while (li.hasNext()) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new Failure("Thread with searching for name is not found: " + name);
-    }
-
     private ReferenceType waitForDebuggeeClassPrepared () {
         display("Creating request for ClassPrepareEvent for debuggee.");
         ClassPrepareRequest cpRequest = eventRManager.createClassPrepareRequest();
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/DoubleType/_itself_/doubletype001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/DoubleType/_itself_/doubletype001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -143,12 +143,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -292,7 +286,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -348,20 +342,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/request/request001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/request/request001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -168,12 +168,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
 
     //  Event #:
     //  0-6  : AccessWatchpoint, ModificationWatchpoint, Breakpoint, Exception,
@@ -361,7 +355,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        ThreadReference mainThread = threadByName("main");
+        ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
 
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
@@ -632,20 +626,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventIterator/nextEvent/nextevent001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventIterator/nextEvent/nextevent001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -168,12 +168,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //  Event #:
     //  0-6  : AccessWatchpoint, ModificationWatchpoint, Breakpoint, Exception,
     //         MethodEntry, MethodExit, Step
@@ -360,7 +354,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        ThreadReference mainThread = threadByName("main");
+        ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
 
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
@@ -620,20 +614,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventQueue/remove/remove004.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventQueue/remove/remove004.java	Mon Dec 09 13:02:07 2019 -0800
@@ -145,12 +145,6 @@
 
     static int  testExitCode = PASSED;
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -297,7 +291,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -380,20 +374,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventQueue/remove_l/remove_l004.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventQueue/remove_l/remove_l004.java	Mon Dec 09 13:02:07 2019 -0800
@@ -140,12 +140,6 @@
 
     static int  testExitCode = PASSED;
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -292,7 +286,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -354,20 +348,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/addCountFilter/addcountfilter001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/addCountFilter/addcountfilter001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -153,12 +153,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -301,7 +295,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -349,7 +343,7 @@
             switch (i) {
 
               case 0:
-                     thread1 = threadByName(threadName1);
+                     thread1 = debuggee.threadByNameOrThrow(threadName1);
 
                      log2("......setting up StepRequest");
                      eventRequest1 = eventRManager.createStepRequest
@@ -478,20 +472,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/disable/disable001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/disable/disable001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -299,7 +293,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -343,7 +337,7 @@
             switch (i) {
 
               case 0:
-                     thread1 = threadByName(threadName1);
+                     thread1 = debuggee.threadByNameOrThrow(threadName1);
 
                      log2("......setting up StepRequest");
                      eventRequest1 = eventRManager.createStepRequest
@@ -436,20 +430,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/disable/disable002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/disable/disable002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -299,7 +293,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -343,7 +337,7 @@
             switch (i) {
 
               case 0:
-                     thread1 = threadByName(threadName1);
+                     thread1 = debuggee.threadByNameOrThrow(threadName1);
 
                      log2("......setting up StepRequest");
                      eventRequest1 = eventRManager.createStepRequest
@@ -434,20 +428,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/enable/enable001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/enable/enable001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -299,7 +293,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -343,7 +337,7 @@
             switch (i) {
 
               case 0:
-                     thread1 = threadByName(threadName1);
+                     thread1 = debuggee.threadByNameOrThrow(threadName1);
 
                      log2("......setting up StepRequest");
                      eventRequest1 = eventRManager.createStepRequest
@@ -432,20 +426,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/enable/enable002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/enable/enable002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -154,12 +154,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -302,7 +296,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -346,7 +340,7 @@
             switch (i) {
 
               case 0:
-                     thread1 = threadByName(threadName1);
+                     thread1 = debuggee.threadByNameOrThrow(threadName1);
 
                      log2("......setting up StepRequest");
                      eventRequest1 = eventRManager.createStepRequest
@@ -450,20 +444,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/getProperty/getproperty001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/getProperty/getproperty001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -153,12 +153,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -301,7 +295,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -349,7 +343,7 @@
             switch (i) {
 
               case 0:
-                     thread1 = threadByName(threadName1);
+                     thread1 = debuggee.threadByNameOrThrow(threadName1);
 
                      log2("......setting up StepRequest");
                      eventRequest1 = eventRManager.createStepRequest
@@ -446,20 +440,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/hashCode/hashcode001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/hashCode/hashcode001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -115,7 +115,7 @@
             switch (i) {
 
                 case 0:
-                       ThreadReference thread = threadByName(methodName);
+                       ThreadReference thread = debuggee.threadByNameOrThrow(methodName);
 
                        display(".....setting up StepRequest");
                        eventRequest = eventRequestManager.createStepRequest
@@ -224,18 +224,5 @@
         return method;
     }
 
-    static private ThreadReference threadByName(String name) {
-
-        List all = debuggee.VM().allThreads();
-        ListIterator li  = all.listIterator();
-
-        while (li.hasNext()) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new Failure("Thread IS NOT found : " + name);
-    }
-
 }
 //--------------------------------------------------------- test specific classes
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/isEnabled/isenabled001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/isEnabled/isenabled001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -299,7 +293,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -343,7 +337,7 @@
             switch (i) {
 
               case 0:
-                     thread1 = threadByName(threadName1);
+                     thread1 = debuggee.threadByNameOrThrow(threadName1);
 
                      log2("......setting up StepRequest");
                      eventRequest1 = eventRManager.createStepRequest
@@ -440,20 +434,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/putProperty/putproperty001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/putProperty/putproperty001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -153,12 +153,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -301,7 +295,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -349,7 +343,7 @@
             switch (i) {
 
               case 0:
-                     thread1 = threadByName(threadName1);
+                     thread1 = debuggee.threadByNameOrThrow(threadName1);
 
                      log2("......setting up StepRequest");
                      eventRequest1 = eventRManager.createStepRequest
@@ -451,20 +445,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -150,12 +150,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -298,7 +292,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -342,7 +336,7 @@
             switch (i) {
 
               case 0:
-                     thread1 = threadByName(threadName1);
+                     thread1 = debuggee.threadByNameOrThrow(threadName1);
 
                      log2("......setting up StepRequest");
                      eventRequest1 = eventRManager.createStepRequest
@@ -439,20 +433,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -154,12 +154,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -302,7 +296,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -346,7 +340,7 @@
             switch (i) {
 
               case 0:
-                     thread1 = threadByName(threadName1);
+                     thread1 = debuggee.threadByNameOrThrow(threadName1);
 
                      log2("......setting up StepRequest");
                      eventRequest1 = eventRManager.createStepRequest
@@ -466,20 +460,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -299,7 +293,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -418,19 +412,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
 
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setSuspendPolicy/setsuspendpolicy001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setSuspendPolicy/setsuspendpolicy001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -303,7 +297,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -351,7 +345,7 @@
             switch (i) {
 
               case 0:
-                     thread1 = threadByName(threadName1);
+                     thread1 = debuggee.threadByNameOrThrow(threadName1);
 
                      log2("......setting up StepRequest");
                      eventRequest1 = eventRManager.createStepRequest
@@ -482,20 +476,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/suspendPolicy/suspendpolicy001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/suspendPolicy/suspendpolicy001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -150,12 +150,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -298,7 +292,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -346,7 +340,7 @@
             switch (i) {
 
               case 0:
-                     thread1 = threadByName(threadName1);
+                     thread1 = debuggee.threadByNameOrThrow(threadName1);
 
                      log2("......setting up StepRequest");
                      eventRequest1 = eventRManager.createStepRequest
@@ -455,19 +449,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
 
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/accessWatchpointRequests/accwtchpreq002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/accessWatchpointRequests/accwtchpreq002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -146,12 +146,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -300,7 +294,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -431,19 +425,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
 
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/breakpointRequests/breakpreq002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/breakpointRequests/breakpreq002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -149,12 +149,6 @@
     Location breakpLocation = null;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -297,7 +291,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -424,20 +418,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/classPrepareRequests/clsprepreq002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/classPrepareRequests/clsprepreq002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -146,12 +146,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -294,7 +288,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -424,20 +418,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/classUnloadRequests/clsunlreq002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/classUnloadRequests/clsunlreq002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -146,12 +146,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -294,7 +288,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -419,20 +413,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createAccessWatchpointRequest/craccwtchpreq003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createAccessWatchpointRequest/craccwtchpreq003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -149,12 +149,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -297,7 +291,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -381,20 +375,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createBreakpointRequest/crbreakpreq003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createBreakpointRequest/crbreakpreq003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -149,12 +149,6 @@
     Location breakpLocation = null;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -297,7 +291,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -362,20 +356,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createClassPrepareRequest/cpreg001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createClassPrepareRequest/cpreg001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -144,12 +144,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -292,7 +286,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -337,19 +331,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
 
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createClassUnloadRequest/cureg001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createClassUnloadRequest/cureg001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -144,12 +144,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -292,7 +286,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -337,20 +331,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createExceptionRequest/crexreq009.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createExceptionRequest/crexreq009.java	Mon Dec 09 13:02:07 2019 -0800
@@ -147,12 +147,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -295,7 +289,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -361,20 +355,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createExceptionRequest/crexreq010.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createExceptionRequest/crexreq010.java	Mon Dec 09 13:02:07 2019 -0800
@@ -148,12 +148,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -296,7 +290,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -352,20 +346,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createMethodEntryRequest/menreg001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createMethodEntryRequest/menreg001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -144,12 +144,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -292,7 +286,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -337,20 +331,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createMethodExitRequest/mexreg001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createMethodExitRequest/mexreg001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -144,12 +144,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -292,7 +286,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -337,19 +331,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
 
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createModificationWatchpointRequest/crmodwtchpreq003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createModificationWatchpointRequest/crmodwtchpreq003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -148,12 +148,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -296,7 +290,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -380,19 +374,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
 
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -148,12 +148,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -296,7 +290,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -333,7 +327,7 @@
 
             //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ variable part
 
-            thread = threadByName(threadName);
+            thread = debuggee.threadByNameOrThrow(threadName);
 
             if (StepRequest.STEP_MIN > StepRequest.STEP_LINE) {
                 maxSize = StepRequest.STEP_MIN;
@@ -448,20 +442,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -154,7 +154,7 @@
     //--------------------------------------------------------- mutable common methods
 
     private void execTest() {
-        ThreadReference mainThread = threadByName("main");
+        ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
 /*
         BreakpointRequest bpRequest = setBreakpoint( mainThread,
                                                      debuggeeClass,
@@ -252,7 +252,7 @@
             exitCode = FAILED;
         }
 
-        ThreadReference thread = threadByName(threadName);
+        ThreadReference thread = debuggee.threadByNameOrThrow(threadName);
         StepRequest stepRequest = setStepRequest( thread,
                                                   StepRequest.STEP_LINE,
                                                   stepDepth,
@@ -421,19 +421,6 @@
         }
     }
 
-
-    private ThreadReference threadByName(String name) throws Failure{
-        List all = vm.allThreads();
-        ListIterator li = all.listIterator();
-
-        while (li.hasNext()) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new Failure("Thread with searching for name is not found: " + name);
-    }
-
     private ReferenceType waitForDebuggeeClassPrepared () {
         display("Creating request for ClassPrepareEvent for debuggee.");
         ClassPrepareRequest cpRequest = eventRManager.createClassPrepareRequest();
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq004.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq004.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,7 +155,7 @@
     //--------------------------------------------------------- mutable common methods
 
     private void execTest() {
-        ThreadReference mainThread = threadByName("main");
+        ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = setBreakpoint( mainThread,
                                                      debuggeeClass,
@@ -247,7 +247,7 @@
             exitCode = FAILED;
         }
 
-        ThreadReference thread = threadByName(threadName);
+        ThreadReference thread = debuggee.threadByNameOrThrow(threadName);
         StepRequest stepRequest = setStepRequest( thread,
                                                   StepRequest.STEP_LINE,
                                                   stepDepth,
@@ -418,19 +418,6 @@
         }
     }
 
-
-    private ThreadReference threadByName(String name) throws Failure{
-        List all = vm.allThreads();
-        ListIterator li = all.listIterator();
-
-        while (li.hasNext()) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new Failure("Thread with searching for name is not found: " + name);
-    }
-
     private ReferenceType waitForDebuggeeClassPrepared () {
         display("Creating request for ClassPrepareEvent for debuggee.");
         ClassPrepareRequest cpRequest = eventRManager.createClassPrepareRequest();
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq005.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq005.java	Mon Dec 09 13:02:07 2019 -0800
@@ -217,7 +217,7 @@
             }
 
             display("Getting mirror of thread: " + threadName);
-            ThreadReference thread = threadByName(threadName);
+            ThreadReference thread = debuggee.threadByNameOrThrow(threadName);
 
             display("Getting ReferenceType of thread: " + threadName);
             ReferenceType debuggeeThread = debuggee.classByName(debuggeeThreadName);
@@ -441,19 +441,6 @@
         }
     }
 
-
-    private ThreadReference threadByName(String name) throws Failure{
-        List all = vm.allThreads();
-        ListIterator li = all.listIterator();
-
-        while (li.hasNext()) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new Failure("Thread with searching for name is not found: " + name);
-    }
-
     private ReferenceType waitForDebuggeeClassPrepared () {
         display("Creating request for ClassPrepareEvent for debuggee.");
         ClassPrepareRequest cpRequest = eventRManager.createClassPrepareRequest();
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq006.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq006.java	Mon Dec 09 13:02:07 2019 -0800
@@ -215,7 +215,7 @@
             }
 
             display("Getting mirror of thread: " + threadName);
-            ThreadReference thread = threadByName(threadName);
+            ThreadReference thread = debuggee.threadByNameOrThrow(threadName);
 
             display("Getting ReferenceType of thread: " + threadName);
             ReferenceType debuggeeThread = debuggee.classByName(debuggeeThreadName);
@@ -439,19 +439,6 @@
         }
     }
 
-
-    private ThreadReference threadByName(String name) throws Failure{
-        List all = vm.allThreads();
-        ListIterator li = all.listIterator();
-
-        while (li.hasNext()) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new Failure("Thread with searching for name is not found: " + name);
-    }
-
     private ReferenceType waitForDebuggeeClassPrepared () {
         display("Creating request for ClassPrepareEvent for debuggee.");
         ClassPrepareRequest cpRequest = eventRManager.createClassPrepareRequest();
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq007.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq007.java	Mon Dec 09 13:02:07 2019 -0800
@@ -217,7 +217,7 @@
             }
 
             display("Getting mirror of thread: " + threadName);
-            ThreadReference thread = threadByName(threadName);
+            ThreadReference thread = debuggee.threadByNameOrThrow(threadName);
 
             display("Getting ReferenceType of thread: " + threadName);
             ReferenceType debuggeeThread = debuggee.classByName(debuggeeThreadName);
@@ -441,19 +441,6 @@
         }
     }
 
-
-    private ThreadReference threadByName(String name) throws Failure{
-        List all = vm.allThreads();
-        ListIterator li = all.listIterator();
-
-        while (li.hasNext()) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new Failure("Thread with searching for name is not found: " + name);
-    }
-
     private ReferenceType waitForDebuggeeClassPrepared () {
         display("Creating request for ClassPrepareEvent for debuggee.");
         ClassPrepareRequest cpRequest = eventRManager.createClassPrepareRequest();
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq008.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq008.java	Mon Dec 09 13:02:07 2019 -0800
@@ -217,7 +217,7 @@
             }
 
             display("Getting mirror of thread: " + threadName);
-            ThreadReference thread = threadByName(threadName);
+            ThreadReference thread = debuggee.threadByNameOrThrow(threadName);
 
             display("Getting ReferenceType of thread: " + threadName);
             ReferenceType debuggeeThread = debuggee.classByName(debuggeeThreadName);
@@ -441,19 +441,6 @@
         }
     }
 
-
-    private ThreadReference threadByName(String name) throws Failure{
-        List all = vm.allThreads();
-        ListIterator li = all.listIterator();
-
-        while (li.hasNext()) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new Failure("Thread with searching for name is not found: " + name);
-    }
-
     private ReferenceType waitForDebuggeeClassPrepared () {
         display("Creating request for ClassPrepareEvent for debuggee.");
         ClassPrepareRequest cpRequest = eventRManager.createClassPrepareRequest();
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq009.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq009.java	Mon Dec 09 13:02:07 2019 -0800
@@ -215,7 +215,7 @@
             }
 
             display("Getting mirror of thread: " + threadName);
-            ThreadReference thread = threadByName(threadName);
+            ThreadReference thread = debuggee.threadByNameOrThrow(threadName);
 
             display("Getting ReferenceType of thread: " + threadName);
             ReferenceType debuggeeThread = debuggee.classByName(debuggeeThreadName);
@@ -439,19 +439,6 @@
         }
     }
 
-
-    private ThreadReference threadByName(String name) throws Failure{
-        List all = vm.allThreads();
-        ListIterator li = all.listIterator();
-
-        while (li.hasNext()) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new Failure("Thread with searching for name is not found: " + name);
-    }
-
     private ReferenceType waitForDebuggeeClassPrepared () {
         display("Creating request for ClassPrepareEvent for debuggee.");
         ClassPrepareRequest cpRequest = eventRManager.createClassPrepareRequest();
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq010.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq010.java	Mon Dec 09 13:02:07 2019 -0800
@@ -219,7 +219,7 @@
             }
 
             display("Getting mirror of thread: " + threadName);
-            ThreadReference thread = threadByName(threadName);
+            ThreadReference thread = debuggee.threadByNameOrThrow(threadName);
 
             display("Getting ReferenceType of thread: " + threadName);
             ReferenceType debuggeeThread = debuggee.classByName(debuggeeThreadName);
@@ -443,19 +443,6 @@
         }
     }
 
-
-    private ThreadReference threadByName(String name) throws Failure{
-        List all = vm.allThreads();
-        ListIterator li = all.listIterator();
-
-        while (li.hasNext()) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new Failure("Thread with searching for name is not found: " + name);
-    }
-
     private ReferenceType waitForDebuggeeClassPrepared () {
         display("Creating request for ClassPrepareEvent for debuggee.");
         ClassPrepareRequest cpRequest = eventRManager.createClassPrepareRequest();
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createThreadDeathRequest/tdreg001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createThreadDeathRequest/tdreg001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -144,12 +144,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -292,7 +286,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -337,20 +331,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createThreadStartRequest/tsreg001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createThreadStartRequest/tsreg001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -144,12 +144,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -292,7 +286,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -337,20 +331,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createVMDeathRequest/vmdreg001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createVMDeathRequest/vmdreg001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -146,12 +146,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -294,7 +288,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -349,20 +343,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/deleteAllBreakpoints/delallbreakp002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/deleteAllBreakpoints/delallbreakp002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -148,12 +148,6 @@
     Location breakpLocation = null;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -296,7 +290,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -348,20 +342,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/deleteEventRequest/delevtreq002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/deleteEventRequest/delevtreq002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -154,12 +154,6 @@
     Location breakpLocation = null;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -302,7 +296,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -433,20 +427,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/deleteEventRequests/delevtreqs002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/deleteEventRequests/delevtreqs002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -152,12 +152,6 @@
     Location breakpLocation = null;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -300,7 +294,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -502,20 +496,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/exceptionRequests/excreq002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/exceptionRequests/excreq002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -146,12 +146,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -294,7 +288,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -424,20 +418,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/methodEntryRequests/methentreq002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/methodEntryRequests/methentreq002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -146,12 +146,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -294,7 +288,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -419,20 +413,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/methodExitRequests/methexitreq002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/methodExitRequests/methexitreq002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -146,12 +146,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -294,7 +288,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -419,20 +413,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/modificationWatchpointRequests/modwtchpreq002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/modificationWatchpointRequests/modwtchpreq002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -146,12 +146,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -300,7 +294,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -431,20 +425,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/stepRequests/stepreq002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/stepRequests/stepreq002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -146,12 +146,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -294,7 +288,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -426,20 +420,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/threadDeathRequests/thrdeathreq002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/threadDeathRequests/thrdeathreq002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -146,12 +146,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -294,7 +288,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -419,20 +413,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/threadStartRequests/thrstartreq002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/threadStartRequests/thrstartreq002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -146,12 +146,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -294,7 +288,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -419,20 +413,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/vmDeathRequests/vmdeathreq001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/vmDeathRequests/vmdeathreq001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -146,12 +146,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -294,7 +288,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -419,20 +413,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/eventIterator/eventiterator001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/eventIterator/eventiterator001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -144,12 +144,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
 
     //------------------------------------------------------ methods
 
@@ -320,7 +314,7 @@
 
                 String          bPointMethod = "methodForCommunication";
                 String          lineForComm  = "lineForComm";
-                ThreadReference mainThread   = threadByName("main");
+                ThreadReference mainThread   = debuggee.threadByNameOrThrow("main");
 
                 BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                               debuggeeClass,
@@ -367,20 +361,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/eventIterator/eventiterator002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/eventIterator/eventiterator002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -150,12 +150,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -309,7 +303,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        ThreadReference mainThread = threadByName("main");
+        ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
 
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
@@ -431,20 +425,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/eventIterator/eventiterator003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/eventIterator/eventiterator003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
 
     static int testExitCode = PASSED;
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis(String argv[], PrintStream out) {
@@ -311,7 +305,7 @@
         String lineForComm = "lineForComm";
         BreakpointRequest bpRequest;
 
-        ThreadReference mainThread = threadByName("main");
+        ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
 
         bpRequest = settingBreakpoint(mainThread, debuggeeClass, bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -392,19 +386,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name) throws JDITestRuntimeException {
-
-        List all = vm.allThreads();
-        ListIterator li = all.listIterator();
-
-        for (; li.hasNext();) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
     /*
      * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
      *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/eventIterator/eventiterator004.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/eventIterator/eventiterator004.java	Mon Dec 09 13:02:07 2019 -0800
@@ -138,12 +138,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //  Event #:
     //  0-6  : AccessWatchpoint, ModificationWatchpoint, Breakpoint, Exception,
     //         MethodEntry, MethodExit, Step
@@ -330,7 +324,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        ThreadReference mainThread = threadByName("main");
+        ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
 
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
@@ -363,20 +357,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -158,12 +158,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -313,7 +307,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -510,20 +504,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -158,12 +158,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -313,7 +307,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -511,20 +505,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume004.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume004.java	Mon Dec 09 13:02:07 2019 -0800
@@ -158,12 +158,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -306,7 +300,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -504,20 +498,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume005.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume005.java	Mon Dec 09 13:02:07 2019 -0800
@@ -158,12 +158,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -306,7 +300,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -504,20 +498,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume006.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume006.java	Mon Dec 09 13:02:07 2019 -0800
@@ -158,12 +158,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -306,7 +300,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -502,20 +496,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume007.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume007.java	Mon Dec 09 13:02:07 2019 -0800
@@ -158,12 +158,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -306,7 +300,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -501,20 +495,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume010.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume010.java	Mon Dec 09 13:02:07 2019 -0800
@@ -158,12 +158,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -306,7 +300,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -499,20 +493,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume011.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume011.java	Mon Dec 09 13:02:07 2019 -0800
@@ -142,12 +142,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -307,7 +301,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -344,20 +338,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume012.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume012.java	Mon Dec 09 13:02:07 2019 -0800
@@ -143,12 +143,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -308,7 +302,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -345,20 +339,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume013.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume013.java	Mon Dec 09 13:02:07 2019 -0800
@@ -143,12 +143,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -308,7 +302,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -344,20 +338,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -153,12 +153,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -311,7 +305,7 @@
         String            bPointMethod = "methodForCommunication";
         String            lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -492,20 +486,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -154,12 +154,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -312,7 +306,7 @@
         String            bPointMethod = "methodForCommunication";
         String            lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -487,20 +481,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -154,12 +154,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -318,7 +312,7 @@
         String            bPointMethod = "methodForCommunication";
         String            lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -494,20 +488,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy004.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy004.java	Mon Dec 09 13:02:07 2019 -0800
@@ -154,12 +154,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -312,7 +306,7 @@
         String            bPointMethod = "methodForCommunication";
         String            lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -489,20 +483,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy005.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy005.java	Mon Dec 09 13:02:07 2019 -0800
@@ -154,12 +154,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -312,7 +306,7 @@
         String            bPointMethod = "methodForCommunication";
         String            lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -489,20 +483,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy006.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy006.java	Mon Dec 09 13:02:07 2019 -0800
@@ -153,12 +153,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -311,7 +305,7 @@
         String            bPointMethod = "methodForCommunication";
         String            lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -487,20 +481,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy007.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy007.java	Mon Dec 09 13:02:07 2019 -0800
@@ -153,12 +153,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -311,7 +305,7 @@
         String            bPointMethod = "methodForCommunication";
         String            lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -486,20 +480,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy008.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy008.java	Mon Dec 09 13:02:07 2019 -0800
@@ -153,12 +153,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -311,7 +305,7 @@
         String            bPointMethod = "methodForCommunication";
         String            lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -463,20 +457,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy009.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy009.java	Mon Dec 09 13:02:07 2019 -0800
@@ -153,12 +153,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -311,7 +305,7 @@
         String            bPointMethod = "methodForCommunication";
         String            lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -463,20 +457,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy010.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy010.java	Mon Dec 09 13:02:07 2019 -0800
@@ -152,12 +152,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -310,7 +304,7 @@
         String            bPointMethod = "methodForCommunication";
         String            lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -418,20 +412,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy011.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy011.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     int policyToCheck = 0;
 
     //------------------------------------------------------ methods
@@ -319,7 +313,7 @@
         String            bPointMethod = "methodForCommunication";
         String            lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -365,20 +359,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy012.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy012.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     int policyToCheck = 0;
 
     //------------------------------------------------------ methods
@@ -319,7 +313,7 @@
         String            bPointMethod = "methodForCommunication";
         String            lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -365,20 +359,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy013.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy013.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     int policyToCheck = 0;
 
     //------------------------------------------------------ methods
@@ -319,7 +313,7 @@
         String            bPointMethod = "methodForCommunication";
         String            lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -365,20 +359,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy014.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy014.java	Mon Dec 09 13:02:07 2019 -0800
@@ -152,12 +152,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     int policyToCheck = 0;
 
     //------------------------------------------------------ methods
@@ -320,7 +314,7 @@
         String            bPointMethod = "methodForCommunication";
         String            lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -368,20 +362,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy015.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy015.java	Mon Dec 09 13:02:07 2019 -0800
@@ -152,12 +152,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     int policyToCheck = 0;
 
     //------------------------------------------------------ methods
@@ -320,7 +314,7 @@
         String            bPointMethod = "methodForCommunication";
         String            lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -368,20 +362,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy016.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy016.java	Mon Dec 09 13:02:07 2019 -0800
@@ -152,12 +152,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     int policyToCheck = 0;
 
     //------------------------------------------------------ methods
@@ -320,7 +314,7 @@
         String            bPointMethod = "methodForCommunication";
         String            lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -368,19 +362,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
 
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy017.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy017.java	Mon Dec 09 13:02:07 2019 -0800
@@ -152,12 +152,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     int policyToCheck = 0;
 
     //------------------------------------------------------ methods
@@ -320,7 +314,7 @@
         String            bPointMethod = "methodForCommunication";
         String            lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
@@ -370,20 +364,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addClassExclusionFilter/filter002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addClassExclusionFilter/filter002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -154,12 +154,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -302,7 +296,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -392,20 +386,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addClassFilter_rt/filter_rt002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addClassFilter_rt/filter_rt002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -303,7 +297,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -394,20 +388,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addClassFilter_s/filter_s002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addClassFilter_s/filter_s002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -303,7 +297,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -393,20 +387,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addInstanceFilter/instancefilter002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addInstanceFilter/instancefilter002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -310,7 +304,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -415,20 +409,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addInstanceFilter/instancefilter003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addInstanceFilter/instancefilter003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -150,12 +150,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -298,7 +292,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -382,20 +376,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addThreadFilter/threadfilter002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addThreadFilter/threadfilter002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -157,12 +157,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -305,7 +299,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -402,20 +396,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addThreadFilter/threadfilter003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addThreadFilter/threadfilter003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -157,12 +157,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -305,7 +299,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -407,20 +401,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/exception/exception001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/exception/exception001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -149,12 +149,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -297,7 +291,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -382,20 +376,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/notifyCaught/notifycaught001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/notifyCaught/notifycaught001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -147,12 +147,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -295,7 +289,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -371,20 +365,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/notifyUncaught/notifyuncaught001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/notifyUncaught/notifyuncaught001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -147,12 +147,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -295,7 +289,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -371,20 +365,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/FloatType/_itself_/floattype001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/FloatType/_itself_/floattype001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -143,12 +143,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -292,7 +286,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -348,20 +342,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/IntegerType/_itself_/integertype001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/IntegerType/_itself_/integertype001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -143,12 +143,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -292,7 +286,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -348,20 +342,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/LocatableEvent/thread/thread001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/LocatableEvent/thread/thread001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -158,12 +158,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -307,7 +301,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -542,20 +536,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/LongType/_itself_/longtype001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/LongType/_itself_/longtype001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -143,12 +143,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -292,7 +286,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -348,20 +342,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addClassExclusionFilter/filter002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addClassExclusionFilter/filter002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -154,12 +154,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -302,7 +296,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -389,20 +383,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addClassFilter_rt/filter_rt002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addClassFilter_rt/filter_rt002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -303,7 +297,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -394,20 +388,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addClassFilter_s/filter_s002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addClassFilter_s/filter_s002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -154,12 +154,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -302,7 +296,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -389,20 +383,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addInstanceFilter/instancefilter002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addInstanceFilter/instancefilter002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -310,7 +304,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -420,20 +414,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addInstanceFilter/instancefilter003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addInstanceFilter/instancefilter003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -299,7 +293,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -387,20 +381,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addThreadFilter/threadfilter002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addThreadFilter/threadfilter002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -157,12 +157,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -305,7 +299,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -402,20 +396,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addThreadFilter/threadfilter003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addThreadFilter/threadfilter003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -157,12 +157,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -305,7 +299,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -405,20 +399,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addClassExclusionFilter/filter002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addClassExclusionFilter/filter002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -154,12 +154,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -302,7 +296,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -389,20 +383,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addClassFilter_rt/filter_rt002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addClassFilter_rt/filter_rt002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -303,7 +297,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -394,20 +388,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addClassFilter_s/filter_s002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addClassFilter_s/filter_s002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -154,12 +154,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -302,7 +296,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -389,20 +383,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addInstanceFilter/instancefilter002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addInstanceFilter/instancefilter002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -310,7 +304,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -420,20 +414,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addInstanceFilter/instancefilter003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addInstanceFilter/instancefilter003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -299,7 +293,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -387,20 +381,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addThreadFilter/threadfilter002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addThreadFilter/threadfilter002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -156,12 +156,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -304,7 +298,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -402,20 +396,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addThreadFilter/threadfilter003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addThreadFilter/threadfilter003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -156,12 +156,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -304,7 +298,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -408,20 +402,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ModificationWatchpointEvent/_itself_/mwevent001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ModificationWatchpointEvent/_itself_/mwevent001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -150,12 +150,6 @@
 
     static int  testExitCode = PASSED;
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -304,7 +298,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -379,20 +373,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/disableCollection/disablecollection002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/disableCollection/disablecollection002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -167,12 +167,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -316,7 +310,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -383,20 +377,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/PathSearchingVirtualMachine/classPath/classpath001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/PathSearchingVirtualMachine/classPath/classpath001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -149,12 +149,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -299,7 +293,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -376,20 +370,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/PrimitiveType/_itself_/primitivetype001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/PrimitiveType/_itself_/primitivetype001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -142,12 +142,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -291,7 +285,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -344,20 +338,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/classLoader/classloader001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/classLoader/classloader001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -134,12 +134,6 @@
 
     static int  testExitCode = PASSED;
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -284,7 +278,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -359,20 +353,6 @@
          }
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/getValue/getvalue001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/getValue/getvalue001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -135,12 +135,6 @@
 
     static int  testExitCode = PASSED;
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -285,7 +279,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -368,20 +362,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/getValue/getvalue002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/getValue/getvalue002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -134,12 +134,6 @@
 
     static int  testExitCode = PASSED;
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -284,7 +278,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -369,20 +363,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/getValue/getvalue003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/getValue/getvalue003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -134,12 +134,6 @@
 
     static int  testExitCode = PASSED;
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -284,7 +278,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -369,20 +363,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/getValues/getvalues001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/getValues/getvalues001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -138,12 +138,6 @@
 
     static int  testExitCode = PASSED;
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -288,7 +282,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -396,20 +390,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/isFinal/isfinal001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/isFinal/isfinal001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -122,12 +122,6 @@
 
     static int  testExitCode = PASSED;
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -272,7 +266,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -445,20 +439,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/isStatic/isstatic001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/isStatic/isstatic001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -300,7 +294,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -463,20 +457,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/isStatic/isstatic002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/isStatic/isstatic002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -300,7 +294,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -374,20 +368,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/nestedTypes/nestedtypes001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/nestedTypes/nestedtypes001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -128,12 +128,6 @@
 
     static int  testExitCode = PASSED;
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -278,7 +272,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -384,20 +378,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/nestedTypes/nestedtypes002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/nestedTypes/nestedtypes002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -128,12 +128,6 @@
 
     static int  testExitCode = PASSED;
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -280,7 +274,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -401,20 +395,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ShortType/_itself_/shorttype001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ShortType/_itself_/shorttype001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -143,12 +143,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -292,7 +286,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -348,20 +342,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addClassExclusionFilter/filter002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addClassExclusionFilter/filter002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -153,12 +153,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -301,7 +295,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -337,7 +331,7 @@
             switch (i) {
 
               case 0:
-                     ThreadReference thread1 = threadByName("main");
+                     ThreadReference thread1 = debuggee.threadByNameOrThrow("main");
                      eventRequest1 = setting23StepRequest(thread1, testedClassName1,
                                               EventRequest.SUSPEND_NONE, property1);
 
@@ -388,20 +382,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addClassFilter_rt/filter_rt002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addClassFilter_rt/filter_rt002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -303,7 +297,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -348,7 +342,7 @@
                      testClassReference =
                           (ReferenceType) vm.classesByName(testedClassName).get(0);
 
-                     thread1 = threadByName(threadName1);
+                     thread1 = debuggee.threadByNameOrThrow(threadName1);
 
                      eventRequest1 = setting21StepRequest(thread1, testClassReference,
                                               EventRequest.SUSPEND_NONE, property1);
@@ -399,20 +393,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addClassFilter_s/filter_s002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addClassFilter_s/filter_s002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -303,7 +297,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -340,7 +334,7 @@
             switch (i) {
 
               case 0:
-                     ThreadReference thread1 = threadByName("thread1");
+                     ThreadReference thread1 = debuggee.threadByNameOrThrow("thread1");
                      eventRequest1 = setting23StepRequest(thread1, testedClassName1,
                                               EventRequest.SUSPEND_NONE, property1);
 
@@ -391,20 +385,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addInstanceFilter/instancefilter002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addInstanceFilter/instancefilter002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -310,7 +304,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -419,20 +413,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addInstanceFilter/instancefilter003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addInstanceFilter/instancefilter003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -299,7 +293,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -386,20 +380,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/depth/depth001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/depth/depth001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -299,7 +293,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -339,7 +333,7 @@
             switch (i) {
 
               case 0:
-                     thread1 = threadByName(threadName1);
+                     thread1 = debuggee.threadByNameOrThrow(threadName1);
 
                      log2("......setting up StepRequest with depth StepRequest.STEP_INTO");
                      eventRequest1 = setting24StepRequest(thread1, StepRequest.STEP_LINE,
@@ -366,20 +360,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/depth/depth002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/depth/depth002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -299,7 +293,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -339,7 +333,7 @@
             switch (i) {
 
               case 0:
-                     thread1 = threadByName(threadName1);
+                     thread1 = debuggee.threadByNameOrThrow(threadName1);
 
                      log2("......setting up StepRequest with depth StepRequest.STEP_OVER");
                      eventRequest1 = setting24StepRequest(thread1, StepRequest.STEP_LINE,
@@ -366,20 +360,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/depth/depth003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/depth/depth003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -299,7 +293,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -339,7 +333,7 @@
             switch (i) {
 
               case 0:
-                     thread1 = threadByName(threadName1);
+                     thread1 = debuggee.threadByNameOrThrow(threadName1);
 
                      log2("......setting up StepRequest with depth StepRequest.STEP_OUT");
                      eventRequest1 = setting24StepRequest(thread1, StepRequest.STEP_LINE,
@@ -366,20 +360,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/size/size001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/size/size001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -299,7 +293,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -339,7 +333,7 @@
             switch (i) {
 
               case 0:
-                     thread1 = threadByName(threadName1);
+                     thread1 = debuggee.threadByNameOrThrow(threadName1);
 
                      log2("......setting up StepRequest with size StepRequest.STEP_MIN");
                      eventRequest1 = setting24StepRequest(thread1, StepRequest.STEP_MIN,
@@ -366,20 +360,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/size/size002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/size/size002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -151,12 +151,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -299,7 +293,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -339,7 +333,7 @@
             switch (i) {
 
               case 0:
-                     thread1 = threadByName(threadName1);
+                     thread1 = debuggee.threadByNameOrThrow(threadName1);
 
                      log2("......setting up StepRequest with size StepRequest.STEP_LINE");
                      eventRequest1 = setting24StepRequest(thread1, StepRequest.STEP_LINE,
@@ -366,20 +360,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/thread/thread001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/thread/thread001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -152,12 +152,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -300,7 +294,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -340,7 +334,7 @@
             switch (i) {
 
               case 0:
-                     thread1 = threadByName(threadName1);
+                     thread1 = debuggee.threadByNameOrThrow(threadName1);
 
                      log2("......setting up StepRequest with size StepRequest.STEP_MIN");
                      eventRequest1 = setting24StepRequest(thread1, StepRequest.STEP_MIN,
@@ -367,20 +361,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -148,12 +148,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -297,7 +291,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        ThreadReference mainThread = threadByName("main");
+        ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
 
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
@@ -384,20 +378,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -145,12 +145,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -294,7 +288,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        ThreadReference mainThread = threadByName("main");
+        ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
 
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
@@ -380,20 +374,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -159,12 +159,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -308,7 +302,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -399,20 +393,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter005.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter005.java	Mon Dec 09 13:02:07 2019 -0800
@@ -159,12 +159,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -307,7 +301,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -411,20 +405,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -162,12 +162,6 @@
 
     BreakpointRequest breakpointRequest;
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -312,7 +306,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -360,7 +354,7 @@
             }
 
             String thread2Name         = "thread2";
-            ThreadReference thread2Ref = threadByName(thread2Name);
+            ThreadReference thread2Ref = debuggee.threadByNameOrThrow(thread2Name);
 
 
             String poppedMethod    = "poppedMethod";
@@ -369,7 +363,7 @@
 
             log2("......setting breakpoint in poppedMethod");
             try {
-                breakpointRequest = settingBreakpoint(threadByName(thread2Name),
+                breakpointRequest = settingBreakpoint(debuggee.threadByNameOrThrow(thread2Name),
                                           debuggeeClass,
                                           poppedMethod, breakpointLine, "one");
             } catch ( Exception e ) {
@@ -428,20 +422,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -157,12 +157,6 @@
     BreakpointRequest breakpointRequest3;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -313,7 +307,7 @@
         String lineForComm  = "lineForComm";
 
         log2("......setting BreakpointRequest (bpRequest) in main thread");
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         log2("bpRequest.enable();");
@@ -329,10 +323,10 @@
             breakpointForCommunication();
 
             String thread2Name         = "thread2";
-            ThreadReference thread2Ref = threadByName(thread2Name);
+            ThreadReference thread2Ref = debuggee.threadByNameOrThrow(thread2Name);
 
             String thread3Name         = "thread3";
-            ThreadReference thread3Ref = threadByName(thread3Name);
+            ThreadReference thread3Ref = debuggee.threadByNameOrThrow(thread3Name);
 
             String poppedMethod    = "poppedMethod";
             String breakpointLine  = "breakpointLine";
@@ -407,20 +401,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -158,12 +158,6 @@
     MethodEntryRequest meRequest3;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -313,7 +307,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference threadMainRef = threadByName("main");
+        ThreadReference threadMainRef = debuggee.threadByNameOrThrow("main");
         try {
             bpRequest = settingBreakpoint(threadMainRef,
                                           debuggeeClass,
@@ -344,10 +338,10 @@
 
 
         String thread2Name         = "thread2";
-        ThreadReference thread2Ref = threadByName(thread2Name);
+        ThreadReference thread2Ref = debuggee.threadByNameOrThrow(thread2Name);
 
         String thread3Name         = "thread3";
-        ThreadReference thread3Ref = threadByName(thread3Name);
+        ThreadReference thread3Ref = debuggee.threadByNameOrThrow(thread3Name);
 
         String poppedMethod    = "poppedMethod";
         String breakpointLine  = "breakpointLine";
@@ -478,21 +472,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
-
   /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes004.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes004.java	Mon Dec 09 13:02:07 2019 -0800
@@ -154,12 +154,6 @@
     BreakpointRequest breakpointRequest2;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -309,7 +303,7 @@
         String lineForComm  = "lineForComm";
 
         log2("......setting BreakpointRequest (bpRequest) in main thread");
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         log2("bpRequest.enable();");
@@ -325,7 +319,7 @@
             breakpointForCommunication();
 
             String thread2Name         = "thread2";
-            ThreadReference thread2Ref = threadByName(thread2Name);
+            ThreadReference thread2Ref = debuggee.threadByNameOrThrow(thread2Name);
 
             StackFrame stackFrame = null;
             int var;
@@ -418,20 +412,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes005.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes005.java	Mon Dec 09 13:02:07 2019 -0800
@@ -158,12 +158,6 @@
     BreakpointRequest breakpointRequest2;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -313,7 +307,7 @@
         String lineForComm  = "lineForComm";
 
         log2("......setting BreakpointRequest (bpRequest) in main thread");
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         log2("bpRequest.enable();");
@@ -329,7 +323,7 @@
             breakpointForCommunication();
 
             String thread2Name         = "thread2";
-            ThreadReference thread2Ref = threadByName(thread2Name);
+            ThreadReference thread2Ref = debuggee.threadByNameOrThrow(thread2Name);
 
             StackFrame stackFrame0 = null;
             StackFrame stackFrame1 = null;
@@ -400,20 +394,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -148,12 +148,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -297,7 +291,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        ThreadReference mainThread = threadByName("main");
+        ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
 
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
@@ -383,20 +377,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -145,12 +145,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -295,7 +289,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        ThreadReference mainThread = threadByName("main");
+        ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
 
         bpRequest = settingBreakpoint(mainThread,
                                       debuggeeClass,
@@ -382,20 +376,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -159,12 +159,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -308,7 +302,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -399,20 +393,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter005.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter005.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -303,7 +297,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -406,20 +400,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VMDeathEvent/_itself_/vmdeath002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VMDeathEvent/_itself_/vmdeath002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -134,12 +134,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -291,7 +285,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -330,19 +324,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
 
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VMDeathEvent/_itself_/vmdeath003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VMDeathEvent/_itself_/vmdeath003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -140,12 +140,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -296,7 +290,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -333,20 +327,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/allClasses/allclasses001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/allClasses/allclasses001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -140,12 +140,6 @@
     static final int returnCode0 = 0;
     static final int returnCode1 = 1;
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -290,7 +284,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -448,20 +442,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                            throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canAddMethod/canaddmethod001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canAddMethod/canaddmethod001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -130,12 +130,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -280,7 +274,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -321,20 +315,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canPopFrames/canpopframes001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canPopFrames/canpopframes001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -130,12 +130,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -280,7 +274,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -321,20 +315,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canRedefineClasses/canredefineclasses001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canRedefineClasses/canredefineclasses001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -130,12 +130,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -280,7 +274,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -321,20 +315,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canRequestVMDeathEvent/canreqvmdev001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canRequestVMDeathEvent/canreqvmdev001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -130,12 +130,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -280,7 +274,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -321,20 +315,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canUnrestrictedlyRedefineClasses/curc001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canUnrestrictedlyRedefineClasses/curc001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -130,12 +130,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -280,7 +274,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -321,20 +315,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canUseInstanceFilters/canusefilters001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canUseInstanceFilters/canusefilters001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -130,12 +130,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -280,7 +274,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -321,20 +315,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canWatchFieldAccess/canwatchaccess001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canWatchFieldAccess/canwatchaccess001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -141,12 +141,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -291,7 +285,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -332,20 +326,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canWatchFieldModification/canwatchmod001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canWatchFieldModification/canwatchmod001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -142,12 +142,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -292,7 +286,7 @@
         BreakpointRequest bpRequest;
 
         try {
-            bpRequest = settingBreakpoint(threadByName("main"),
+            bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           debuggeeClass,
                                           bPointMethod, lineForComm, "zero");
         } catch ( Exception e ) {
@@ -333,20 +327,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -164,12 +164,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-    //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
 
@@ -318,7 +312,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -359,7 +353,7 @@
               case 0:
                   List          classes = vm.classesByName(bpClassName);
                   bpClass = (ReferenceType) classes.get(0);
-                  bpRequest2 = settingBreakpoint(threadByName("main"),
+                  bpRequest2 = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           bpClass,
                                           bpMethodName, bpLineName, "one");
                   bpRequest2.enable();
@@ -384,7 +378,7 @@
 
               case 1:
 
-                  bpRequest3 = settingBreakpoint(threadByName("main"),
+                  bpRequest3 = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                           bpClass,
                                           bpMethodName, bpLineName, "one");
 
@@ -416,20 +410,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/VoidType/_itself_/voidtype001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/VoidType/_itself_/voidtype001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -142,12 +142,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -291,7 +285,7 @@
         String lineForComm  = "lineForComm";
         BreakpointRequest bpRequest;
 
-        bpRequest = settingBreakpoint(threadByName("main"),
+        bpRequest = settingBreakpoint(debuggee.threadByNameOrThrow("main"),
                                       debuggeeClass,
                                       bPointMethod, lineForComm, "zero");
         bpRequest.enable();
@@ -350,20 +344,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassExclusionFilter/filter003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassExclusionFilter/filter003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -303,7 +297,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -397,20 +391,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassExclusionFilter/filter004.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassExclusionFilter/filter004.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -303,7 +297,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -397,20 +391,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -303,7 +297,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -396,20 +390,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt004.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt004.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -303,7 +297,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -396,20 +390,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_s/filter_s003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_s/filter_s003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -303,7 +297,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -396,20 +390,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_s/filter_s004.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_s/filter_s004.java	Mon Dec 09 13:02:07 2019 -0800
@@ -155,12 +155,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -303,7 +297,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -396,20 +390,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -156,12 +156,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -311,7 +305,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -423,20 +417,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter004.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter004.java	Mon Dec 09 13:02:07 2019 -0800
@@ -156,12 +156,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -311,7 +305,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -423,20 +417,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter005.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter005.java	Mon Dec 09 13:02:07 2019 -0800
@@ -152,12 +152,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -300,7 +294,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -390,20 +384,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter006.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter006.java	Mon Dec 09 13:02:07 2019 -0800
@@ -152,12 +152,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -300,7 +294,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -390,20 +384,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter003.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter003.java	Mon Dec 09 13:02:07 2019 -0800
@@ -159,12 +159,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -314,7 +308,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -413,20 +407,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter004.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter004.java	Mon Dec 09 13:02:07 2019 -0800
@@ -159,12 +159,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -314,7 +308,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -413,20 +407,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter005.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter005.java	Mon Dec 09 13:02:07 2019 -0800
@@ -159,12 +159,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -314,7 +308,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -416,20 +410,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter006.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter006.java	Mon Dec 09 13:02:07 2019 -0800
@@ -159,12 +159,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -314,7 +308,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -416,20 +410,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/field/field001.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/field/field001.java	Mon Dec 09 13:02:07 2019 -0800
@@ -153,12 +153,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -301,7 +295,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -369,20 +363,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/field/field002.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/field/field002.java	Mon Dec 09 13:02:07 2019 -0800
@@ -154,12 +154,6 @@
     static int  testExitCode = PASSED;
 
 
-    class JDITestRuntimeException extends RuntimeException {
-        JDITestRuntimeException(String str) {
-            super("JDITestRuntimeException : " + str);
-        }
-    }
-
     //------------------------------------------------------ methods
 
     private int runThis (String argv[], PrintStream out) {
@@ -302,7 +296,7 @@
         String bPointMethod = "methodForCommunication";
         String lineForComm  = "lineForComm";
 
-        ThreadReference   mainThread = threadByName("main");
+        ThreadReference   mainThread = debuggee.threadByNameOrThrow("main");
 
         BreakpointRequest bpRequest = settingBreakpoint(mainThread,
                                              debuggeeClass,
@@ -370,20 +364,6 @@
         return;
     }
 
-    private ThreadReference threadByName(String name)
-                 throws JDITestRuntimeException {
-
-        List         all = vm.allThreads();
-        ListIterator li  = all.listIterator();
-
-        for (; li.hasNext(); ) {
-            ThreadReference thread = (ThreadReference) li.next();
-            if (thread.name().equals(name))
-                return thread;
-        }
-        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
-    }
-
    /*
     * private BreakpointRequest settingBreakpoint(ThreadReference, ReferenceType,
     *                                             String, String, String)
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/Debugee.java	Mon Dec 09 12:27:57 2019 -0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/Debugee.java	Mon Dec 09 13:02:07 2019 -0800
@@ -48,6 +48,7 @@
  * @see DebugeeProcess
  */
 abstract public class Debugee extends DebugeeProcess {
+
     /**
      * Mirror of the debugee VM. This must be initialized by every
      * particular non-abstract class extending Debugee class.
@@ -240,6 +241,19 @@
         return threads[index];
     }
 
+
+    public ThreadReference threadByNameOrThrow(String name) throws JDITestRuntimeException {
+
+        List all = vm.allThreads();
+        ListIterator li = all.listIterator();
+        for (; li.hasNext(); ) {
+            ThreadReference thread = (ThreadReference) li.next();
+            if (thread.name().equals(name))
+                return thread;
+        }
+        throw new JDITestRuntimeException("** Thread IS NOT found ** : " + name);
+    }
+
     // --------------------------------------------------- //
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/JDITestRuntimeException.java	Mon Dec 09 13:02:07 2019 -0800
@@ -0,0 +1,7 @@
+package nsk.share.jdi;
+
+public class JDITestRuntimeException extends RuntimeException {
+    public JDITestRuntimeException(String str) {
+        super("JDITestRuntimeException : " + str);
+    }
+}