Tidy up some Java code.