You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/10/24 07:57:46 UTC

[GitHub] [calcite] danny0405 commented on a change in pull request #1528: [CALCITE-3436] CalciteConnectionConfigImpl.set obliterates previous property values

danny0405 commented on a change in pull request #1528: [CALCITE-3436] CalciteConnectionConfigImpl.set obliterates previous property values
URL: https://github.com/apache/calcite/pull/1528#discussion_r338430333
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/config/CalciteConnectionConfigImpl.java
 ##########
 @@ -40,8 +40,10 @@ public CalciteConnectionConfigImpl(Properties properties) {
   /** Returns a copy of this configuration with one property changed. */
   public CalciteConnectionConfigImpl set(CalciteConnectionProperty property,
       String value) {
-    final Properties properties1 = new Properties(properties);
-    properties1.setProperty(property.camelName(), value);
+    final Properties properties1 = (Properties) this.properties.clone();
+    if (properties1.getProperty(property.camelName()) == null) {
+      properties1.setProperty(property.camelName(), value);
+    }
 
 Review comment:
   Why we set the property when the original value is null ?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services