Use the right class loader for ResolvedMethodAccessTest.

The method_id is relative to the current class and its dex cache.

Test: test.py
Bug: 199246839
(cherry picked from commit 1c494e36f246a982070e125dec3c1139f9289c6e)

Merged-In: Ic9b29bda22d2dc1781e3e2daac57f55ba69c7e2d
Change-Id: Idb61bf77b47da2f288b66fb2118b52f79d72ea9e
diff --git a/runtime/mirror/class-inl.h b/runtime/mirror/class-inl.h
index 7d17d5d..f7c612a 100644
--- a/runtime/mirror/class-inl.h
+++ b/runtime/mirror/class-inl.h
@@ -504,7 +504,7 @@
     ObjPtr<Class> dex_access_to = Runtime::Current()->GetClassLinker()->LookupResolvedType(
         class_idx,
         dex_cache,
-        access_to->GetClassLoader());
+        GetClassLoader());
     DCHECK(dex_access_to != nullptr)
         << " Could not resolve " << dex_cache->GetDexFile()->StringByTypeIdx(class_idx)
         << " when checking access to " << method->PrettyMethod() << " from " << PrettyDescriptor();