I'm aware that the String Pool in Java is hidden (most likely for good purposes). However, what if you really wanna monitor and see what elements are in the pool? Can this be achieved using indirect methods (such as reflection or JNI), or is it completely impossible?
If this is possible, any ideas on how it would be done? My idea was to check out where the native method String#intern()
is called, and see if I can get some information out of that, but I'm having troubles figuring out where it would be called.
I want to know if this would be possible or not before jumping into it