Clean up explicit conversions to ObjPtr<>.
Add an ObjPtr<>::DownCast() overload that takes a plain
pointer and remove unnecessary calls to MakeObjPtr(),
usually preceding DownCast(). Move the MakeObjPtr() to
common_art_test.h .
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 31113334
Change-Id: I2a243b6d8f3b2e773396dfc53b659c5f7d9ea44a
diff --git a/runtime/reflection.cc b/runtime/reflection.cc
index dbf40f6..0dbec85 100644
--- a/runtime/reflection.cc
+++ b/runtime/reflection.cc
@@ -767,7 +767,7 @@
ObjPtr<mirror::Object> BoxPrimitive(Primitive::Type src_class, const JValue& value) {
if (src_class == Primitive::kPrimNot) {
- return MakeObjPtr(value.GetL());
+ return value.GetL();
}
if (src_class == Primitive::kPrimVoid) {
// There's no such thing as a void field, and void methods invoked via reflection return null.