Fix the anonymous class with the changment from Java 6 to Java 7