Adapt to JDK 1.7