{
// if (result != null) {
// return super.debug_getChild(childN);
// }
JavaField resultField = new JavaField.Instance(null, "result", JavaTypeNames.RTVALUE);
JavaExpression conditionExpr =
new OperatorExpression.Binary(
JavaOperator.NOT_EQUALS_OBJECT,
resultField,
LiteralWrapper.NULL)
;
JavaStatement thenStatement =
new ReturnStatement(
new MethodInvocation.Instance(
null,
"debug_getChild",
JavaTypeNames.RTFULLAPP,
new JavaExpression[]{childNVar},
new JavaTypeName[] {JavaTypeName.INT},
JavaTypeName.CAL_VALUE,
MethodInvocation.InvocationType.SPECIAL));
JavaStatement.IfThenElseStatement ifThenStatement =
new JavaStatement.IfThenElseStatement (conditionExpr, thenStatement);
method.addStatement(ifThenStatement);
}
SwitchStatement switchStatement =
new SwitchStatement(childNVar);
for (int i = 0, nFields = memberFields.length; i < nFields; ++i) {
JavaField javaField = memberFields[i];
String javaFieldName = javaField.getFieldName();
JavaTypeName javaFieldType = javaField.getFieldType();
JavaExpression javaFieldExpr = new JavaExpression.JavaField.Instance(null, javaFieldName, javaFieldType);
if (!javaFieldType.equals(JavaTypeNames.RTVALUE)) {
javaFieldExpr = SCJavaDefn.boxExpression(javaFieldType, javaFieldExpr);
}
switchStatement.addCase(