MCPcopy Create free account
hub / github.com/Snapchat/Valdi / getValueForObjectKey

Method getValueForObjectKey

valdi/src/valdi/android/JavaValueDelegate.cpp:62–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60JavaObjectStore::~JavaObjectStore() = default;
61
62Valdi::Ref<Valdi::RefCountable> JavaObjectStore::getValueForObjectKey(const JavaValue& objectKey,
63 Valdi::ExceptionTracker& exceptionTracker) {
64 auto& cache = JavaCache::get();
65 auto result =
66 cache.getWeakHashMapGetMethod().call(JavaObject(JavaEnv(), _weakMap.get()), javaValueToObject(objectKey));
67
68 if (result.isNull()) {
69 return nullptr;
70 }
71
72 auto nativeHandle = cache.getNativeRefGetNativeHandleMethod().call(result);
73
74 return Valdi::unsafeBridge<Valdi::RefCountable>(reinterpret_cast<void*>(nativeHandle));
75}
76
77void JavaObjectStore::setValueForObjectKey(const JavaValue& objectKey,
78 const Valdi::Ref<Valdi::RefCountable>& value,

Callers 2

unmarshallInterfaceMethod · 0.45
marshallInterfaceMethod · 0.45

Calls 7

javaValueToObjectFunction · 0.85
callMethod · 0.65
getMethod · 0.65
getFunction · 0.50
JavaObjectClass · 0.50
JavaEnvClass · 0.50
isNullMethod · 0.45

Tested by

no test coverage detected