Fully implement string interning.
Also, more const.
Change-Id: I09cae88d677e8e6e42d0fa9b5d1093c79d225e66
diff --git a/src/jni_internal.cc b/src/jni_internal.cc
index b222b94..685ac2e 100644
--- a/src/jni_internal.cc
+++ b/src/jni_internal.cc
@@ -63,7 +63,10 @@
* passed in), or NULL on failure.
*/
template<typename T>
-T AddLocalReference(JNIEnv* public_env, Object* obj) {
+T AddLocalReference(JNIEnv* public_env, const Object* const_obj) {
+ // The jobject type hierarchy has no notion of const, so it's not worth carrying through.
+ Object* obj = const_cast<Object*>(const_obj);
+
if (obj == NULL) {
return NULL;
}