| 60 | JavaObjectStore::~JavaObjectStore() = default; |
| 61 | |
| 62 | Valdi::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 | |
| 77 | void JavaObjectStore::setValueForObjectKey(const JavaValue& objectKey, |
| 78 | const Valdi::Ref<Valdi::RefCountable>& value, |
no test coverage detected