Skip to content

Commit

Permalink
SUP-17450: Duplicated data crash fix (#1626)
Browse files Browse the repository at this point in the history
* SUP-17450: Duplicated data crash fix

* More cases
  • Loading branch information
plyhun authored Sep 30, 2024
1 parent efe37dd commit 9947ada
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions LTS-CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ include::content/docs/variables.adoc-include[]
The LTS changelog lists releases which are only accessible via a commercial subscription.
All fixes and changes in LTS releases will be released the next minor release. Changes from LTS 1.4.x will be included in release 1.5.0.

[[v1.10.35]]
== 1.10.35 (27.09.2024)

icon:check[] Core: A crash, caused by duplicated nodes in a GraphQL resulting set, has been fixed.

[[v1.10.34]]
== 1.10.34 (11.09.2024)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -108,9 +109,10 @@ public Stream<? extends HibNode> getChildrenStream(HibNode node, InternalActionC
return toGraph(node).getChildrenStream(ac, perm);
}

@SuppressWarnings("unchecked")
@Override
public Map<HibNode, List<HibNode>> getChildren(Collection<HibNode> nodes, String branchUuid) {
return nodes.stream()
return new HashSet<>(nodes).stream()
.map(node -> Pair.of(node, (List<HibNode>) getChildren(node, branchUuid).list()))
.collect(Collectors.toMap(Pair::getKey, Pair::getValue));
}
Expand Down Expand Up @@ -223,7 +225,7 @@ public long globalCount() {

@Override
public Map<HibNode, List<HibNode>> getBreadcrumbNodesMap(Collection<HibNode> nodes, InternalActionContext ac) {
return nodes.stream().map(node -> Pair.of(node,
return new HashSet<>(nodes).stream().map(node -> Pair.of(node,
getBreadcrumbNodes(node, ac)
.stream()
.map(HibNode.class::cast)
Expand Down

0 comments on commit 9947ada

Please sign in to comment.