Skip to content

Commit

Permalink
- Fix RunEmrJob#isEquivalentTo()
Browse files Browse the repository at this point in the history
- Fix KeyValue#extendMap()

Signed-off-by: Benjamin Rögner <[email protected]>
  • Loading branch information
roegi committed Jan 10, 2025
1 parent 256a40b commit d9f1f51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,13 @@ public boolean isEquivalentTo(StepExecution other) {
//TODO: For now do not compare the actual values of the positional params until the full fledged inputSet comparison was implemented for the GraphFusion
&& Objects.equals(otherEmrStep.positionalScriptParams.size(), positionalScriptParams.size())
//TODO: For now do not compare the actual values of the positional that contain an inputSet reference until the full fledged inputSet comparison was implemented for the GraphFusion
&& Objects.equals(otherEmrStep.namedScriptParams, namedScriptParams)
&& isEquivalentTo(namedScriptParams, otherEmrStep.namedScriptParams)
&& Objects.equals(otherEmrStep.sparkParams, sparkParams);
}

private boolean isEquivalentTo(Map<String, String> namedScriptParams, Map<String, String> otherNamedScriptParams) {
return Objects.equals(namedScriptParams.keySet(), otherNamedScriptParams.keySet()) &&
namedScriptParams.entrySet().stream()
namedScriptParams != null && otherNamedScriptParams != null && namedScriptParams.entrySet().stream()
.allMatch(entry -> isEquivalentTo(namedScriptParams.get(entry.getKey()), otherNamedScriptParams.get(entry.getKey())));
}

Expand Down
2 changes: 1 addition & 1 deletion xyz-models/src/main/java/com/here/xyz/util/KeyValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public KeyValue<K, V> putToMap(Map<K, V> map) {
}

public Map<K, V> extendMap(Map<K, V> map) {
Map<K, V> extended = new HashMap<>();
Map<K, V> extended = new HashMap<>(map);
putToMap(extended);
return extended;
}
Expand Down

0 comments on commit d9f1f51

Please sign in to comment.