From 6958a6c892c22e6aeda03729f123c7428b7e4a04 Mon Sep 17 00:00:00 2001 From: Shubham Goyal Date: Wed, 2 Aug 2023 12:51:50 -0500 Subject: [PATCH] remove stream() APIs as Android is not able to seamlessly support Java8 Apis on older devices --- .../org/commcare/suite/model/StackFrameStep.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/commcare/suite/model/StackFrameStep.java b/src/main/java/org/commcare/suite/model/StackFrameStep.java index 96573031bb..4f8c43ac67 100644 --- a/src/main/java/org/commcare/suite/model/StackFrameStep.java +++ b/src/main/java/org/commcare/suite/model/StackFrameStep.java @@ -26,11 +26,11 @@ import java.io.DataOutputStream; import java.io.IOException; import java.util.Collection; +import java.util.HashMap; import java.util.Hashtable; import java.util.Map; import java.util.NoSuchElementException; import java.util.Objects; -import java.util.stream.Collectors; /** * @author ctsims @@ -145,10 +145,13 @@ public void initDataInstanceSources(RemoteInstanceFetcher remoteInstanceFetcher) } public Map getInstances(InstanceInitializationFactory iif) { - return dataInstanceSources.values().stream().map((source) -> { - ExternalDataInstance instance = source.toInstance(); - return instance.initialize(iif, source.getInstanceId()); - }).collect(Collectors.toMap(DataInstance::getInstanceId, value -> value)); + HashMap instances = new HashMap<>(); + for (ExternalDataInstanceSource source : dataInstanceSources.values()) { + ExternalDataInstance instance = (ExternalDataInstance)source.toInstance() + .initialize(iif, source.getInstanceId()); + instances.put(instance.getInstanceId(), instance); + } + return instances; } /**