TryStatement tryStmt = new TryStatement();
int finallyMode = finallyMode(); switch(finallyMode) { case FINALLY_DOES_NOT_COMPLETE : exitDeclaredExceptionHandlers(codeStream); return false; exitAnyExceptionHandler(); exitDeclaredExceptionHandlers(codeStream); this.finallyBlock.generateCode(currentScope, codeStream); if (isStackMapFrameCodeStream) { exitAnyExceptionHandler(); exitDeclaredExceptionHandlers(codeStream);
private int finallyMode() { if (this.subRoutineStartLabel == null) { return NO_FINALLY; } else if (isSubRoutineEscaping()) { return FINALLY_DOES_NOT_COMPLETE; } else if (this.scope.compilerOptions().inlineJsrBytecode) { return FINALLY_INLINE; } else { return FINALLY_SUBROUTINE; } } /**
BranchLabel exitLabel = new BranchLabel(codeStream); int invokeCloseStartPc = codeStream.position; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=343785 generateCodeSnippet(this.resources[i - 1], codeStream, exitLabel, false); codeStream.recordPositionsFrom(invokeCloseStartPc, this.tryBlock.sourceEnd); exitLabel.place(); int finallyMode = finallyMode(); switch(finallyMode) { case FINALLY_DOES_NOT_COMPLETE : exitDeclaredExceptionHandlers(codeStream); return false; exitAnyExceptionHandler(); exitDeclaredExceptionHandlers(codeStream); this.finallyBlock.generateCode(currentScope, codeStream); if (isStackMapFrameCodeStream) { exitAnyExceptionHandler(); exitDeclaredExceptionHandlers(codeStream);
int finallyMode = finallyMode(); enterAnyExceptionHandler(codeStream); exitAnyExceptionHandler(); if (this.catchArguments != null) { postCatchesFinallyLabel = new BranchLabel(codeStream); enterAnyExceptionHandler(codeStream); exitAnyExceptionHandler(); if (!this.catchExits[i]) { switch(finallyMode) { codeStream.addDefinitelyAssignedVariables(currentScope, this.preTryInitStateIndex); placeAllAnyExceptionHandler(); if (naturalExitExceptionHandler != null) naturalExitExceptionHandler.place();
public StringBuffer printStatement(int indent, StringBuffer output) { printIndent(indent, output).append("try \n"); //$NON-NLS-1$ this.tryBlock.printStatement(indent + 1, output); //catches if (this.catchBlocks != null) for (int i = 0; i < this.catchBlocks.length; i++) { output.append('\n'); printIndent(indent, output).append("catch ("); //$NON-NLS-1$ this.catchArguments[i].print(0, output).append(") "); //$NON-NLS-1$ this.catchBlocks[i].printStatement(indent + 1, output); } //finally if (this.finallyBlock != null) { output.append('\n'); printIndent(indent, output).append("finally\n"); //$NON-NLS-1$ this.finallyBlock.printStatement(indent + 1, output); } return output; }
private FlowInfo prepareCatchInfo(FlowInfo flowInfo, ExceptionHandlingFlowContext handlingContext, FlowInfo tryInfo, int i) { FlowInfo catchInfo; if (isUncheckedCatchBlock(i)) { catchInfo = flowInfo.unconditionalCopy().
verifyDuplicationAndOrder(length, argumentTypes, containsUnionTypes); } else { this.caughtExceptionTypes = new ReferenceBinding[0];
int finallyMode = finallyMode(); enterAnyExceptionHandler(codeStream); exitAnyExceptionHandler(); if (this.catchArguments != null) { postCatchesFinallyLabel = new BranchLabel(codeStream); enterAnyExceptionHandler(codeStream); exitAnyExceptionHandler(); if (!this.catchExits[i]) { switch(finallyMode) { codeStream.addDefinitelyAssignedVariables(currentScope, this.preTryInitStateIndex); placeAllAnyExceptionHandler(); if (naturalExitExceptionHandler != null) naturalExitExceptionHandler.place();
BranchLabel exitLabel = new BranchLabel(codeStream); int invokeCloseStartPc = codeStream.position; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=343785 generateCodeSnippet(this.resources[i - 1], codeStream, exitLabel, false); codeStream.recordPositionsFrom(invokeCloseStartPc, this.tryBlock.sourceEnd); exitLabel.place(); int finallyMode = finallyMode(); switch(finallyMode) { case FINALLY_DOES_NOT_COMPLETE : exitDeclaredExceptionHandlers(codeStream); return false; exitAnyExceptionHandler(); exitDeclaredExceptionHandlers(codeStream); this.finallyBlock.generateCode(currentScope, codeStream); if (isStackMapFrameCodeStream) { exitAnyExceptionHandler(); exitDeclaredExceptionHandlers(codeStream);
public StringBuffer printStatement(int indent, StringBuffer output) { printIndent(indent, output).append("try \n"); //$NON-NLS-1$ this.tryBlock.printStatement(indent + 1, output); //catches if (this.catchBlocks != null) for (int i = 0; i < this.catchBlocks.length; i++) { output.append('\n'); printIndent(indent, output).append("catch ("); //$NON-NLS-1$ this.catchArguments[i].print(0, output).append(") "); //$NON-NLS-1$ this.catchBlocks[i].printStatement(indent + 1, output); } //finally if (this.finallyBlock != null) { output.append('\n'); printIndent(indent, output).append("finally\n"); //$NON-NLS-1$ this.finallyBlock.printStatement(indent + 1, output); } return output; }
private FlowInfo prepareCatchInfo(FlowInfo flowInfo, ExceptionHandlingFlowContext handlingContext, FlowInfo tryInfo, int i) { FlowInfo catchInfo; if (isUncheckedCatchBlock(i)) { catchInfo = flowInfo.unconditionalCopy().
verifyDuplicationAndOrder(length, argumentTypes, containsUnionTypes); } else { this.caughtExceptionTypes = new ReferenceBinding[0];
int finallyMode = finallyMode(); enterAnyExceptionHandler(codeStream); codeStream.addDefinitelyAssignedVariables(currentScope, this.postTryInitStateIndex); generateCodeSnippet(stmt, codeStream, exitLabel, false /* record */); codeStream.recordPositionsFrom(invokeCloseStartPc, this.tryBlock.sourceEnd); generateCodeSnippet(stmt, codeStream, postCloseLabel, true /* record */, i, codeStream.position); postCloseLabel.place(); exitAnyExceptionHandler(); if (this.catchArguments != null) { postCatchesFinallyLabel = new BranchLabel(codeStream); enterAnyExceptionHandler(codeStream); exitAnyExceptionHandler(); if (!this.catchExits[i]) { switch(finallyMode) { codeStream.addDefinitelyAssignedVariables(currentScope, this.preTryInitStateIndex); placeAllAnyExceptionHandler(); if (naturalExitExceptionHandler != null) naturalExitExceptionHandler.place();
int finallyMode = finallyMode(); switch(finallyMode) { case FINALLY_DOES_NOT_COMPLETE : exitDeclaredExceptionHandlers(codeStream); return false; exitAnyExceptionHandler(); exitDeclaredExceptionHandlers(codeStream); this.finallyBlock.generateCode(currentScope, codeStream); if (isStackMapFrameCodeStream) { exitAnyExceptionHandler(); exitDeclaredExceptionHandlers(codeStream);
TryStatement tryStmt = new TryStatement();
private int finallyMode() { if (this.subRoutineStartLabel == null) { return NO_FINALLY; } else if (isSubRoutineEscaping()) { return FINALLY_DOES_NOT_COMPLETE; } else if (this.scope.compilerOptions().inlineJsrBytecode) { return FINALLY_INLINE; } else { return FINALLY_SUBROUTINE; } } /**
public StringBuffer printStatement(int indent, StringBuffer output) { int length = this.resources.length; printIndent(indent, output).append("try" + (length == 0 ? "\n" : " (")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ for (int i = 0; i < length; i++) { this.resources[i].printAsExpression(0, output); if (i != length - 1) { output.append(";\n"); //$NON-NLS-1$ printIndent(indent + 2, output); for (int i = 0; i < this.catchBlocks.length; i++) { output.append('\n'); printIndent(indent, output).append("catch ("); //$NON-NLS-1$ this.catchArguments[i].print(0, output).append(")\n"); //$NON-NLS-1$ this.catchBlocks[i].printStatement(indent + 1, output); printIndent(indent, output).append("finally\n"); //$NON-NLS-1$ this.finallyBlock.printStatement(indent + 1, output);
private FlowInfo prepareCatchInfo(FlowInfo flowInfo, ExceptionHandlingFlowContext handlingContext, FlowInfo tryInfo, int i) { FlowInfo catchInfo; if (isUncheckedCatchBlock(i)) { catchInfo = flowInfo.unconditionalCopy().
verifyDuplicationAndOrder(length, argumentTypes, containsUnionTypes); } else { this.caughtExceptionTypes = new ReferenceBinding[0];