Fix to support oracle java
Added a Java7 try-with-resources supported Lock