java: handle { after if/while statement condition and insert new block statement if needed