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