AMashenkov commented on a change in pull request #398:
URL: https://github.com/apache/ignite-3/pull/398#discussion_r732581487
##########
File path:
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/QueryTemplate.java
##########
@@ -52,11 +51,11 @@
public QueryTemplate(MappingService mappingService, List<Fragment>
fragments) {
this.mappingService = mappingService;
- ImmutableList.Builder<Fragment> b = ImmutableList.builder();
+ List<Fragment> frgs = new ArrayList<>();
for (Fragment fragment : fragments)
- b.add(fragment.detach());
+ frgs.add(fragment.detach());
- this.fragments = b.build();
+ this.fragments = List.copyOf(frgs);
Review comment:
Collections.unmodifiableList creates just a wrapper, but List.copyOf
creates a new copy.
Thing goes worse with Set, your collection copied to -> HashSet - > array ->
ImmutableSet
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]