removed a JDK1.6 dependency and fixed a few sonar issues