jOOQ / jOOR

jOOR - Fluent Reflection in Java jOOR is a very simple fluent API that gives access to your Java Class structures in a more intuitive way. The JDK's reflection APIs are hard and verbose to use. Other languages have much simpler constructs to access type meta information at runtime. Let us make Java reflection better.
http://www.jooq.org/products
Apache License 2.0
2.81k stars 376 forks source link

Cannot set final fields in JDK 9 #50

Closed lukaseder closed 6 years ago

lukaseder commented 6 years ago

In JDK 9 by default (i.e. when not opening the JDK modules to our modules), we cannot set final fields. This is why tests are failing on Travis, e.g. https://travis-ci.org/jOOQ/jOOR/builds/357429643

[ERROR] testFinalFields(org.joor.test.ReflectTest)  Time elapsed: 0.005 s  <<< ERROR!
org.joor.ReflectException: java.lang.reflect.InaccessibleObjectException: Unable to make field private int java.lang.reflect.Field.modifiers accessible: module java.base does not "opens java.lang.reflect" to module org.jooq.joor
    at org.jooq.joor/org.joor.test.ReflectTest.testFinalFields(ReflectTest.java:288)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private int java.lang.reflect.Field.modifiers accessible: module java.base does not "opens java.lang.reflect" to module org.jooq.joor
    at org.jooq.joor/org.joor.test.ReflectTest.testFinalFields(ReflectTest.java:288)

We're going to leave the logic as it is, but ignore test failures on JDK 9 for the time being.