Migrate code to Java 7
Fix PMD