AMashenkov commented on code in PR #1831:
URL: https://github.com/apache/ignite-3/pull/1831#discussion_r1147427162


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/SessionImpl.java:
##########
@@ -149,7 +151,13 @@ public int defaultPageSize() {
     /** {@inheritDoc} */
     @Override
     public SessionBuilder toBuilder() {
-        return new SessionBuilderImpl(qryProc, new HashMap<>(props.toMap()))
+        Map<String, Object> propertyMap = new HashMap<>();
+
+        for (Map.Entry<Property<?>, Object> entry : props) {
+            propertyMap.put(entry.getKey().name, entry.getValue());
+        }
+
+        return new SessionBuilderImpl(qryProc, propertyMap)

Review Comment:
   If we clam PropertiesHolder is immutable, and can be changed only via 
copying using builder,
   then maybe defensive-copying can be replaced with 
Collections.unmodifiableMap() or Map.ofEntries().



-- 
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]

Reply via email to