Removing dead code, fixing resource leaks, and expanding use of Java7 syntax.