Deprecated reflective access

Before Jenkins 2.272 Stapler would access all fields ignoring visibility restrictions.

Stapler now tries to access a field first and only if it gets access denied then will it force access via setAccessible(true).

This behavior is not recommended anymore, and will trigger IllegalReflectiveAccess warnings when running Jenkins on Java 11 or newer.

If you see a warning message about this then you should report an issue to the respective plugin.

Dec 15, 2020 9:22:33 PM org.kohsuke.stapler.lang.FieldRef$1 get
WARNING: java.lang.IllegalAccessException: Processing this request relies on deprecated behavior that will be disallowed in future releases of Java. See https://jenkins.io/redirect/stapler-reflective-access/ for more information. Details: class org.kohsuke.stapler.lang.FieldRef$1 cannot access a member of class org.kohsuke.stapler.AncestorImplTest$Foo with modifiers "public"