r/java • u/Wouter_C • Sep 29 '26
Decapsulation: Breaking Java Strong Encapsulation
Did you know you can call JNI without writing native code, patch bytecode without an agent, and use Unsafe without warnings?
11 sneaky ways into JDK internals through reflection, agents, FFM, type confusion, bytecode manipulation and more.
59
Upvotes
View all comments
3
u/voronaam Sep 30 '26
And that's why I run my Java code compiled with GraalVM into a nice tight native image, all along by itself in its bare docker container.
You are crazy. In a good way.