Fixed Sonar issues and Language level issues after switching to target 1.7 and source 1.7