1 /*
2  * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.
8  *
9  * This code is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12  * version 2 for more details (a copy is included in the LICENSE file that
13  * accompanied this code).
14  *
15  * You should have received a copy of the GNU General Public License version
16  * 2 along with this work; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20  * or visit www.oracle.com if you need additional information or have any
21  * questions.
22  */
23 
24 package nsk.jdi.BreakpointRequest._bounds_;
25 
26 import nsk.share.*;
27 import nsk.share.jpda.*;
28 import nsk.share.jdi.*;
29 
30 //    THIS TEST IS LINE NUMBER SENSITIVE
31 
32 /**
33  *  <code>filters001a</code> is deugee's part of the test.
34  */
35 public class filters001a {
36 
37     static String classToCheck = "filters001b";
38     static String objName = "testedObjNULL";
39     static filters001b testedObjNULL = null;
40 
41     static final String brkptMethodName = "run";
42     static final int brkptLineNumber = 75;
43 
main(String argv[])44     public static void main (String argv[]) {
45 
46         // create temporary object to load <filters001b> class
47         filters001b tmp = new filters001b("tmp");
48 
49         ArgumentHandler argHandler = new ArgumentHandler(argv);
50         Log log = new Log(System.err, argHandler);
51         IOPipe pipe = argHandler.createDebugeeIOPipe(log);
52 
53         pipe.println("ready");
54 
55         String instr = pipe.readln();
56 
57         if (instr.equals("quit")) {
58             log.display("DEBUGEE> completed succesfully.");
59             System.exit(Consts.TEST_PASSED + Consts.JCK_STATUS_BASE);
60         }
61 
62         log.complain("DEBUGEE> unexpected signal of debugger.");
63         System.exit(Consts.TEST_FAILED + Consts.JCK_STATUS_BASE);
64     }
65 }
66 
67 class filters001b extends Thread {
68 
69     static Log log;
filters001b(String nameObj)70     filters001b(String nameObj) {
71         setName(nameObj);
72     }
73 
run()74     public void run() {
75         synchronized  (log) { // brkptLineNumber
76             log.display(getName() + "::Breakpoint is reached");
77         }
78     }
79 
80 }
81