Slaw has written a very detailed description of why this doesn't work anymore and how to workaround this in java 12 - 17: Get declared fields of java.lang.reflect.Fields in jdk12