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

Method visitMapKeyValues

valdi/src/valdi/android/JavaValueDelegate.cpp:195–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193 auto& cache = JavaEnv::getCache();
194 return JavaValue::makeObject(cache.getHashMapClass().newObject(cache.getHashMapConstructorMethod()));
195}
196
197void JavaValueDelegate::setMapEntry(const JavaValue& map,
198 const JavaValue& key,
199 const JavaValue& value,
200 Valdi::ExceptionTracker& exceptionTracker) {
201 JavaEnv::getCache().getHashMapPutMethod().call(
202 javaValueToObject(map), javaValueToObject(key), javaValueToObject(value));
203}
204
205size_t JavaValueDelegate::getMapEstimatedLength(const JavaValue& map, Valdi::ExceptionTracker& exceptionTracker) {
206 auto size = JavaEnv::getCache().getMapSizeMethod().call(javaValueToObject(map));
207 return static_cast<size_t>(size);
208}
209
210void JavaValueDelegate::visitMapKeyValues(const JavaValue& map,
211 Valdi::PlatformMapValueVisitor<JavaValue>& visitor,
212 Valdi::ExceptionTracker& exceptionTracker) {
213 auto entrySet = JavaCache::get().getMapEntrySetMethod().call(map.getObject());
214 auto iterator = JavaIterator::fromIterable(entrySet.getUnsafeObject());
215
216 for (;;) {
217 auto next = iterator.next();
218 if (!next) {
219 break;

Callers 2

marshallMethod · 0.45
marshallMethod · 0.45

Calls 8

fromIterableFunction · 0.85
getUnsafeObjectMethod · 0.80
callMethod · 0.65
getObjectMethod · 0.65
nextMethod · 0.65
valueMethod · 0.65
getFunction · 0.50
visitMethod · 0.45

Tested by

no test coverage detected