Skip to content

Commit

Permalink
remove stream() APIs as Android is not able to seamlessly support Jav…
Browse files Browse the repository at this point in the history
…a8 Apis on older devices
  • Loading branch information
shubham1g5 authored and github-actions committed Aug 2, 2023
1 parent e989a54 commit 6958a6c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/main/java/org/commcare/suite/model/StackFrameStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -145,10 +145,13 @@ public void initDataInstanceSources(RemoteInstanceFetcher remoteInstanceFetcher)
}

public Map<String, DataInstance> 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<String, DataInstance> instances = new HashMap<>();
for (ExternalDataInstanceSource source : dataInstanceSources.values()) {
ExternalDataInstance instance = (ExternalDataInstance)source.toInstance()
.initialize(iif, source.getInstanceId());
instances.put(instance.getInstanceId(), instance);
}
return instances;
}

/**
Expand Down

0 comments on commit 6958a6c

Please sign in to comment.