JExpression expression = dispProcessExpression(x.constantExpression);
if (expression != null && x.constantExpression.resolvedType.isEnum()) {
// TODO: propagate enum information?
assert (expression instanceof JFieldRef);
JFieldRef fieldRef = (JFieldRef) expression;
JEnumField field = (JEnumField) fieldRef.getField();
return new JCaseStatement(program, info,
program.getLiteralInt(field.ordinal()));
} else {
return new JCaseStatement(program, info, (JLiteral) expression);
}
}