Skip to content

Commit

Permalink
Merge pull request #1317 from dimagi/copy_of_replaceStreamWithJava7
Browse files Browse the repository at this point in the history
Duplicate of replaceStreamWithJava7
  • Loading branch information
shubham1g5 authored Sep 25, 2023
2 parents d37dabb + 6958a6c commit 11ac1d1
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 11ac1d1

Please sign in to comment.