Fix compatibility issue with JDK7