Simplify Class and Object JNI wrappers
In this PR: #1101
The Class and Object helpers in JavaWrappers were updated to restrict external access to the m_class and m_object internal members. The goal is to ensure when setting the member variables to a new jobject it using a global JNI ref (through calling env->NewGlobalRef). Doing so protects external classes and child classes from instantiating local JNI references that may become stale before the lifetime of the wrapper object. It does not however protect the Class and Object wrappers from misusing the jobject references.
Instead of making Class and Object aware of the need to create a global JNI reference a new templated class should be created to store the jobject reference and ensure we're creating global references. The Class and Object wrappers could then use that new container for their jclass and jobject member variables and remove the duplicated responsibility of maintaining global references.
Alternatively it might warrant looking into using the fbjni wrapper library instead of the custom JavaWrappers implementation.