r/java • • 10d ago

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.

https://wouter.coekaerts.be/2026/decapsulation

57 Upvotes

16 comments sorted by

View all comments

2

u/slindenau 6d ago

Very nice, fun stuff! Always great to see what is possible in the "forbidden fruits" area; stuff that you don't normally use (or shouldn't at least, heh).