I second Effective Java. It's an advenced/master level guide to write good java code. Some of the subjects are outdated as it is so engraved in Java that probably a tool does it for you(eg. dependency injection) but really helps to get the big picture if you are an experienced developer but new to java.
To work with legacy code I recommend Working with Legacy Code by Martin Fowler. Lots of good ideas for handling messy codebase are described there.
To work with legacy code I recommend Working with Legacy Code by Martin Fowler. Lots of good ideas for handling messy codebase are described there.