40 public final class TryNode extends LexicalContextStatement implements JoinPredecessor {
41 private static final long serialVersionUID = 1L;
42
43 /** Try statements. */
44 private final Block body;
45
46 /** List of catch clauses. */
47 private final List<Block> catchBlocks;
48
49 /** Finally clause. */
50 private final Block finallyBody;
51
52 /**
53 * List of inlined finally blocks. The structure of every inlined finally is:
54 * Block(LabelNode(label, Block(finally-statements, (JumpStatement|ReturnNode)?))).
55 * That is, the block has a single LabelNode statement with the label and a block containing the
56 * statements of the inlined finally block with the jump or return statement appended (if the finally
57 * block was not terminal; the original jump/return is simply ignored if the finally block itself
58 * terminates). The reason for this somewhat strange arrangement is that we didn't want to create a
59 * separate class for the (label, BlockStatement pair) but rather reused the already available LabelNode.
60 * However, if we simply used List<LabelNode> without wrapping the label nodes in an additional Block,
61 * that would've thrown off visitors relying on BlockLexicalContext -- same reason why we never use
62 * Statement as the type of bodies of e.g. IfNode, WhileNode etc. but rather blockify them even when they're
63 * single statements.
64 */
65 private final List<Block> inlinedFinallies;
66
67 /** Exception symbol. */
68 private Symbol exception;
69
70 private final LocalVariableConversion conversion;
71
72 /**
73 * Constructor
74 *
75 * @param lineNumber lineNumber
76 * @param token token
77 * @param finish finish
78 * @param body try node body
79 * @param catchBlocks list of catch blocks in order
80 * @param finallyBody body of finally block or null if none
|
40 public final class TryNode extends LexicalContextStatement implements JoinPredecessor {
41 private static final long serialVersionUID = 1L;
42
43 /** Try statements. */
44 private final Block body;
45
46 /** List of catch clauses. */
47 private final List<Block> catchBlocks;
48
49 /** Finally clause. */
50 private final Block finallyBody;
51
52 /**
53 * List of inlined finally blocks. The structure of every inlined finally is:
54 * Block(LabelNode(label, Block(finally-statements, (JumpStatement|ReturnNode)?))).
55 * That is, the block has a single LabelNode statement with the label and a block containing the
56 * statements of the inlined finally block with the jump or return statement appended (if the finally
57 * block was not terminal; the original jump/return is simply ignored if the finally block itself
58 * terminates). The reason for this somewhat strange arrangement is that we didn't want to create a
59 * separate class for the (label, BlockStatement pair) but rather reused the already available LabelNode.
60 * However, if we simply used List<LabelNode> without wrapping the label nodes in an additional Block,
61 * that would've thrown off visitors relying on BlockLexicalContext -- same reason why we never use
62 * Statement as the type of bodies of e.g. IfNode, WhileNode etc. but rather blockify them even when they're
63 * single statements.
64 */
65 private final List<Block> inlinedFinallies;
66
67 /** Exception symbol. */
68 private Symbol exception;
69
70 private final LocalVariableConversion conversion;
71
72 /**
73 * Constructor
74 *
75 * @param lineNumber lineNumber
76 * @param token token
77 * @param finish finish
78 * @param body try node body
79 * @param catchBlocks list of catch blocks in order
80 * @param finallyBody body of finally block or null if none
|