From 9865bde5d822f56c4732214c2005dfcaa41f94cf Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Mon, 21 Dec 2015 09:58:16 -0800 Subject: Rename NullHandle to ScopedNullHandle This makes it clearer that is invalid to do things like: Handle h = ScopedNullHandle(); Bug: 26233305 Change-Id: I6d8f54eae01ec2e901cb7043afa853ea77db79fe --- runtime/class_linker.cc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'runtime/class_linker.cc') diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index b9228f5945..d998d99539 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -1439,8 +1439,12 @@ bool ClassLinker::FindClassInPathClassLoader(ScopedObjectAccessAlreadyRunnable& if (klass != nullptr) { *result = EnsureResolved(self, descriptor, klass); } else { - *result = DefineClass(self, descriptor, hash, NullHandle(), - *pair.first, *pair.second); + *result = DefineClass(self, + descriptor, + hash, + ScopedNullHandle(), + *pair.first, + *pair.second); } if (*result == nullptr) { CHECK(self->IsExceptionPending()) << descriptor; @@ -1565,7 +1569,11 @@ mirror::Class* ClassLinker::FindClass(Thread* self, // The boot class loader, search the boot class path. ClassPathEntry pair = FindInClassPath(descriptor, hash, boot_class_path_); if (pair.second != nullptr) { - return DefineClass(self, descriptor, hash, NullHandle(), *pair.first, + return DefineClass(self, + descriptor, + hash, + ScopedNullHandle(), + *pair.first, *pair.second); } else { // The boot class loader is searched ahead of the application class loader, failures are @@ -5459,7 +5467,8 @@ bool ClassLinker::LinkInterfaceMethods( auto method_array(hs2.NewHandle(iftable->GetMethodArray(i))); ArraySlice input_virtual_methods; - Handle input_vtable_array = NullHandle(); + ScopedNullHandle null_handle; + Handle input_vtable_array(null_handle); int32_t input_array_length = 0; // TODO Cleanup Needed: In the presence of default methods this optimization is rather dirty -- cgit v1.2.3-59-g8ed1b