added cast in generated Java code for local variable assignment