Avoid ReflectiveOperationException for Java 6