[Java] Remove return from inside loop on buffer cleaning.