Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/jdk/com/sun/jdi/CatchCaughtTest.java
41149 views
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
/*
25
* @test
26
* @bug 4788864
27
* @summary TTY: 'catch caught' with no class pattern throws NullPointerException
28
* @comment converted from test/jdk/com/sun/jdi/CatchCaughtTest.sh
29
*
30
* @library /test/lib
31
* @build CatchCaughtTest
32
* @run main/othervm CatchCaughtTest
33
*/
34
35
import jdk.test.lib.process.OutputAnalyzer;
36
import lib.jdb.JdbCommand;
37
import lib.jdb.JdbTest;
38
39
class CatchCaughtTestTarg {
40
public void bar() {
41
System.out.println("bar"); // @1 breakpoint
42
}
43
44
public static void main(String[] args) {
45
CatchCaughtTestTarg my = new CatchCaughtTestTarg();
46
my.bar();
47
}
48
}
49
50
public class CatchCaughtTest extends JdbTest {
51
public static void main(String argv[]) {
52
new CatchCaughtTest().run();
53
}
54
55
private CatchCaughtTest() {
56
super(DEBUGGEE_CLASS);
57
}
58
59
private static final String DEBUGGEE_CLASS = CatchCaughtTestTarg.class.getName();
60
61
@Override
62
protected void runCases() {
63
setBreakpointsFromTestSource("CatchCaughtTest.java", 1);
64
// Run to breakpoint #1
65
jdb.command(JdbCommand.run());
66
67
jdb.command(JdbCommand.catch_(JdbCommand.ExType.caught, ""));
68
69
jdb.contToExit(1);
70
71
new OutputAnalyzer(getJdbOutput())
72
.shouldNotContain("Internal exception")
73
.shouldContain("Usage: catch");
74
}
75
76
}
77
78