Rename NullHandle to ScopedNullHandle
This makes it clearer that is invalid to do things like:
Handle<T> h = ScopedNullHandle<T>();
Bug: 26233305
Change-Id: I6d8f54eae01ec2e901cb7043afa853ea77db79fe
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index b9228f5..d998d99 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -1439,8 +1439,12 @@
if (klass != nullptr) {
*result = EnsureResolved(self, descriptor, klass);
} else {
- *result = DefineClass(self, descriptor, hash, NullHandle<mirror::ClassLoader>(),
- *pair.first, *pair.second);
+ *result = DefineClass(self,
+ descriptor,
+ hash,
+ ScopedNullHandle<mirror::ClassLoader>(),
+ *pair.first,
+ *pair.second);
}
if (*result == nullptr) {
CHECK(self->IsExceptionPending()) << descriptor;
@@ -1565,7 +1569,11 @@
// 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<mirror::ClassLoader>(), *pair.first,
+ return DefineClass(self,
+ descriptor,
+ hash,
+ ScopedNullHandle<mirror::ClassLoader>(),
+ *pair.first,
*pair.second);
} else {
// The boot class loader is searched ahead of the application class loader, failures are
@@ -5459,7 +5467,8 @@
auto method_array(hs2.NewHandle(iftable->GetMethodArray(i)));
ArraySlice<ArtMethod> input_virtual_methods;
- Handle<mirror::PointerArray> input_vtable_array = NullHandle<mirror::PointerArray>();
+ ScopedNullHandle<mirror::PointerArray> null_handle;
+ Handle<mirror::PointerArray> 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