From c5ef693b3fec328c6f4a566d572c36f6587a6ab1 Mon Sep 17 00:00:00 2001 From: Piotr Jastrzebski Date: Thu, 16 Oct 2014 11:04:27 +0100 Subject: [PATCH] Stop using |instance_| in Runtime::InitNativeMethods. Runtime::InitNativeMethods is a member function so we don't need to use |instance_| to call Runtime methods there. I believe that this call uses |instance_| instead of |this| because it was originally in a static Runtime::Create method. It was originally called 'instance_->InitLibraries();' and was moved to Runtime::Start which is a member function here: http://ag/#/c/133053/6/src/runtime.cc and since then it was further moved and renamed but it kept using |instance_| even though use of |this| seems more appropriate. Change-Id: I79b9d23873272ba2f124e285602f1b2683c2f27f --- runtime/runtime.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 3bd825b64..62aef2932 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -914,7 +914,7 @@ void Runtime::InitNativeMethods() { { std::string mapped_name(StringPrintf(OS_SHARED_LIB_FORMAT_STR, "javacore")); std::string reason; - if (!instance_->java_vm_->LoadNativeLibrary(env, mapped_name, nullptr, &reason)) { + if (!java_vm_->LoadNativeLibrary(env, mapped_name, nullptr, &reason)) { LOG(FATAL) << "LoadNativeLibrary failed for \"" << mapped_name << "\": " << reason; } } -- 2.11.0