[Java] move "do" into controls