1 |
| |
2 |
| |
3 |
| package net.sourceforge.pmd.ast; |
4 |
| |
5 |
| |
6 |
| public class ASTTryStatement extends SimpleJavaNode { |
7 |
| |
8 |
2
| public ASTTryStatement(int id) {
|
9 |
2
| super(id);
|
10 |
| } |
11 |
| |
12 |
88
| public ASTTryStatement(JavaParser p, int id) {
|
13 |
88
| super(p, id);
|
14 |
| } |
15 |
| |
16 |
| |
17 |
| |
18 |
| |
19 |
213
| public Object jjtAccept(JavaParserVisitor visitor, Object data) {
|
20 |
213
| return visitor.visit(this, data);
|
21 |
| } |
22 |
| |
23 |
3
| public boolean hasFinally() {
|
24 |
3
| for (int i = 0; i < this.jjtGetNumChildren(); i++) {
|
25 |
6
| if (jjtGetChild(i) instanceof ASTFinallyStatement) {
|
26 |
0
| return true;
|
27 |
| } |
28 |
| } |
29 |
3
| return false;
|
30 |
| } |
31 |
| |
32 |
0
| public ASTFinallyStatement getFinally() {
|
33 |
0
| for (int i = 0; i < this.jjtGetNumChildren(); i++) {
|
34 |
0
| if (jjtGetChild(i) instanceof ASTFinallyStatement) {
|
35 |
0
| return (ASTFinallyStatement) jjtGetChild(i);
|
36 |
| } |
37 |
| } |
38 |
0
| throw new RuntimeException("ASTTryStatement.getFinally called but this try stmt doesn't contain a finally block");
|
39 |
| } |
40 |
| |
41 |
| } |