mercredi 14 novembre 2018

Illegal reflective access on Streams using reflection

I'm using reflection to invoke methods on java.util.stream.Stream but because the actual implementations (ReferencePipeline etc.) have the actual code which runs, I get illegal reflective access warnings when calling method.setAccessible(true), and without that call, it doesn't work. I was wondering whether there is a way to automatically delegate this to a super method where access isn't illegal? That is, I want to call filter where it's legal on java.util.stream.Stream and not ReferencePipeline or whatever the implementation is.





Aucun commentaire:

Enregistrer un commentaire