protected void executeThenPart(XSwitchExpression expr, String switchResultName, XExpression then, ITreeAppendable b, boolean isReferenced) { final boolean canBeReferenced = isReferenced && !isPrimitiveVoid(then); internalToJavaStatement(then, b, canBeReferenced); if (canBeReferenced) { b.newLine().append(switchResultName).append(" = "); internalToConvertedExpression(then, b, getLightweightType(expr)); b.append(";"); } }
protected void _toJavaStatement(XTryCatchFinallyExpression expr, ITreeAppendable outerAppendable, boolean isReferenced) { ITreeAppendable b = outerAppendable.trace(expr, false); if (isReferenced && !isPrimitiveVoid(expr)) { declareSyntheticVariable(expr, b); } b.newLine().append("try {").increaseIndentation(); final boolean canBeReferenced = isReferenced && !isPrimitiveVoid(expr.getExpression()); internalToJavaStatement(expr.getExpression(), b, canBeReferenced); if (canBeReferenced) { b.newLine().append(getVarName(expr, b)).append(" = "); internalToConvertedExpression(expr.getExpression(), b, getLightweightType(expr)); b.append(";"); } b.decreaseIndentation().newLine().append("}"); appendCatchAndFinally(expr, b, isReferenced); }
withDebugging.append(")").append(parentVariable).append(";"); final boolean canBeReferenced = parentIsReferenced && ! isPrimitiveVoid(catchClause.getExpression()); internalToJavaStatement(catchClause.getExpression(), withDebugging, canBeReferenced); if (canBeReferenced) {
internalToJavaExpression(expr.getIf(), b); b.append(") {").increaseIndentation(); final boolean canBeReferenced = isReferenced && !isPrimitiveVoid(expr.getThen()); internalToJavaStatement(expr.getThen(), b, canBeReferenced); if (canBeReferenced) { if (expr.getElse() != null) { b.append(" else {").increaseIndentation(); final boolean canElseBeReferenced = isReferenced && !isPrimitiveVoid(expr.getElse()); internalToJavaStatement(expr.getElse(), b, canElseBeReferenced); if (canElseBeReferenced) {