Source:
<code>public CompletableFuture<Void> visitGetAllCommand(InvocationContext ctx, GetAllCommand command) throws Throwable { Collection<?> keys = command.getKeys(); TypeConverter<Object, Object, Object, Object> converter = determineTypeConverter(command.getFlags()); if (ctx.isOriginLocal()) { Set<Object> boxedKeys = new LinkedHashSet<>(keys.size()); for (Object key : keys) { boxedKeys.add(converter.boxKey(key)); } command.setKeys(boxedKeys); } ctx.onReturn((ctx1, command1, rv, throwable) -> { if (throwable != null) throw throwable; <START> if (rv == null) { <END> return null; } if (!needsUnboxing(ctx)) return null; if (command.isReturnEntries()) { Map<Object, CacheEntry> map = (Map<Object, CacheEntry>) rv; Map<Object, Object> unboxed = command.createMap(); for (Entry<Object, CacheEntry> entry : map.entrySet()) { CacheEntry cacheEntry = entry.getValue(); if (cacheEntry == null) { unboxed.put(entry.getKey(), null); } else { if (command.getRemotelyFetched() == null || !command.getRemotelyFetched().containsKey(entry.getKey())) { unboxed.put(converter.unboxKey(entry.getKey()), entryFactory .create(entry.getKey(), converter.unboxValue(cacheEntry.getValue()), cacheEntry.getMetadata(), cacheEntry.getLifespan(), cacheEntry.getMaxIdle())); } else { unboxed.put(converter.unboxKey(entry.getKey()), cacheEntry); } } } return CompletableFuture.completedFuture(unboxed); } else { Map<Object, Object> map = (Map<Object, Object>) rv; Map<Object, Object> unboxed = command.createMap(); for (Entry<Object, Object> entry : map.entrySet()) { Object value = entry == null ? null : entry.getValue(); unboxed.put(converter.unboxKey(entry.getKey()), entry == null ? null : converter.unboxValue(value)); } return CompletableFuture.completedFuture(unboxed); } }); return ctx.continueInvocation(); }</code><technical_language>ifs merged ctx1 check if unbox is needed</technical_language>

Target:
public CompletableFuture<Void> visitGetAllCommand(InvocationContext ctx, GetAllCommand command) throws Throwable { Collection<?> keys = command.getKeys(); TypeConverter<Object, Object, Object, Object> converter = determineTypeConverter(command.getFlags()); if (ctx.isOriginLocal()) { Set<Object> boxedKeys = new LinkedHashSet<>(keys.size()); for (Object key : keys) { boxedKeys.add(converter.boxKey(key)); } command.setKeys(boxedKeys); } return ctx.onReturn((rCtx, rCommand, rv, throwable) -> { if (throwable != null) throw throwable; if (rv == null || !needsUnboxing(rCtx)) { return null; } if (command.isReturnEntries()) { Map<Object, CacheEntry> map = (Map<Object, CacheEntry>) rv; Map<Object, Object> unboxed = command.createMap(); for (Entry<Object, CacheEntry> entry : map.entrySet()) { CacheEntry cacheEntry = entry.getValue(); if (cacheEntry == null) { unboxed.put(entry.getKey(), null); } else { if (command.getRemotelyFetched() == null || !command.getRemotelyFetched().containsKey(entry.getKey())) { unboxed.put(converter.unboxKey(entry.getKey()), entryFactory .create(entry.getKey(), converter.unboxValue(cacheEntry.getValue()), cacheEntry.getMetadata(), cacheEntry.getLifespan(), cacheEntry.getMaxIdle())); } else { unboxed.put(converter.unboxKey(entry.getKey()), cacheEntry); } } } return CompletableFuture.completedFuture(unboxed); } else { Map<Object, Object> map = (Map<Object, Object>) rv; Map<Object, Object> unboxed = command.createMap(); for (Entry<Object, Object> entry : map.entrySet()) { Object value = entry == null ? null : entry.getValue(); unboxed.put(converter.unboxKey(entry.getKey()), entry == null ? null : converter.unboxValue(value)); } return CompletableFuture.completedFuture(unboxed); } }); }