@Override public void visit(TryCatchStatement statement) { super.visit(statement); if (statement.getExceptionVariable() != null) { if (variables[statement.getExceptionVariable()] < 0) { statement.setExceptionVariable(null); } else { statement.setExceptionVariable(renumber(statement.getExceptionVariable())); } } } }
private void wieldTryCatch(List<Statement> statements) { for (int i = 0; i < statements.size() - 1; ++i) { if (statements.get(i) instanceof TryCatchStatement && statements.get(i + 1) instanceof TryCatchStatement) { TryCatchStatement first = (TryCatchStatement) statements.get(i); TryCatchStatement second = (TryCatchStatement) statements.get(i + 1); if (Objects.equals(first.getExceptionType(), second.getExceptionType()) && Objects.equals(first.getExceptionVariable(), second.getExceptionVariable()) && briefStatementComparison(first.getHandler(), second.getHandler())) { first.getProtectedBody().addAll(second.getProtectedBody()); statements.remove(i + 1); wieldTryCatch(first.getProtectedBody()); --i; } } } }
@Override public void visit(TryCatchStatement statement) { try { output.writeByte(16); writeSequence(statement.getProtectedBody()); output.writeInt(statement.getExceptionType() != null ? symbolTable.lookup(statement.getExceptionType()) : -1); output.writeShort(statement.getExceptionVariable() != null ? statement.getExceptionVariable() : -1); writeSequence(statement.getHandler()); } catch (IOException e) { throw new IOExceptionWrapper(e); } }
if (catchClause.getExceptionVariable() != null) { writer.append(variableName(catchClause.getExceptionVariable())).ws().append("=").ws() .append("$$je;").softNewLine();
@Override public void visit(TryCatchStatement statement) { super.visit(statement); if (statement.getExceptionVariable() != null) { if (variables[statement.getExceptionVariable()] < 0) { statement.setExceptionVariable(null); } else { statement.setExceptionVariable(renumber(statement.getExceptionVariable())); } } } }
private void wieldTryCatch(List<Statement> statements) { for (int i = 0; i < statements.size() - 1; ++i) { if (statements.get(i) instanceof TryCatchStatement && statements.get(i + 1) instanceof TryCatchStatement) { TryCatchStatement first = (TryCatchStatement) statements.get(i); TryCatchStatement second = (TryCatchStatement) statements.get(i + 1); if (Objects.equals(first.getExceptionType(), second.getExceptionType()) && Objects.equals(first.getExceptionVariable(), second.getExceptionVariable()) && briefStatementComparison(first.getHandler(), second.getHandler())) { first.getProtectedBody().addAll(second.getProtectedBody()); statements.remove(i + 1); wieldTryCatch(first.getProtectedBody()); --i; } } } }
@Override public void visit(TryCatchStatement statement) { try { output.writeByte(16); writeSequence(statement.getProtectedBody()); output.writeInt(statement.getExceptionType() != null ? symbolTable.lookup(statement.getExceptionType()) : -1); output.writeShort(statement.getExceptionVariable() != null ? statement.getExceptionVariable() : -1); writeSequence(statement.getHandler()); } catch (IOException e) { throw new IOExceptionWrapper(e); } }
if (catchClause.getExceptionVariable() != null) { writer.append(variableName(catchClause.getExceptionVariable())).ws().append("=").ws() .append("$$je;").softNewLine();