fixed incompatibility with java6 (I was using a ReflectiveOperationException introduced in JDK 7)