diff --git a/extensions/cdc-debezium/src/main/java/com/hazelcast/jet/cdc/impl/DebeziumConfig.java b/extensions/cdc-debezium/src/main/java/com/hazelcast/jet/cdc/impl/DebeziumConfig.java index c58abb2b4d50..b5fe86a4b217 100644 --- a/extensions/cdc-debezium/src/main/java/com/hazelcast/jet/cdc/impl/DebeziumConfig.java +++ b/extensions/cdc-debezium/src/main/java/com/hazelcast/jet/cdc/impl/DebeziumConfig.java @@ -28,10 +28,10 @@ public DebeziumConfig(@Nonnull String name, @Nonnull String connectorClass) { Objects.requireNonNull(name, "name"); Objects.requireNonNull(connectorClass, "connectorClass"); - properties.put("name", name); - properties.put(CdcSourceP.CONNECTOR_CLASS_PROPERTY, connectorClass); - properties.put("database.history", CdcSourceP.DatabaseHistoryImpl.class.getName()); - properties.put("tombstones.on.delete", "false"); + properties.setProperty("name", name); + properties.setProperty(CdcSourceP.CONNECTOR_CLASS_PROPERTY, connectorClass); + properties.setProperty("database.history", CdcSourceP.DatabaseHistoryImpl.class.getName()); + properties.setProperty("tombstones.on.delete", "false"); } public void setProperty(String key, Object value) { diff --git a/extensions/cdc-debezium/src/test/java/com/hazelcast/jet/cdc/MySQLTestUtils.java b/extensions/cdc-debezium/src/test/java/com/hazelcast/jet/cdc/MySQLTestUtils.java index 9cbe51b0d6db..81c0d92da7eb 100644 --- a/extensions/cdc-debezium/src/test/java/com/hazelcast/jet/cdc/MySQLTestUtils.java +++ b/extensions/cdc-debezium/src/test/java/com/hazelcast/jet/cdc/MySQLTestUtils.java @@ -42,9 +42,9 @@ public static void runQuery(MySQLContainer container, String query) { public static Connection getMySqlConnection(String url, String user, String password) throws SQLException { Properties properties = new Properties(); - properties.put("user", user); - properties.put("password", password); - properties.put("useSSL", "false"); + properties.setProperty("user", user); + properties.setProperty("password", password); + properties.setProperty("useSSL", "false"); return DriverManager.getConnection(url, properties); } diff --git a/extensions/kafka-connect/src/main/java/com/hazelcast/jet/kafka/connect/KafkaConnectSources.java b/extensions/kafka-connect/src/main/java/com/hazelcast/jet/kafka/connect/KafkaConnectSources.java index bb2c31da9d83..725d4a637161 100644 --- a/extensions/kafka-connect/src/main/java/com/hazelcast/jet/kafka/connect/KafkaConnectSources.java +++ b/extensions/kafka-connect/src/main/java/com/hazelcast/jet/kafka/connect/KafkaConnectSources.java @@ -16,6 +16,7 @@ package com.hazelcast.jet.kafka.connect; +import com.hazelcast.client.impl.protocol.util.PropertiesUtil; import com.hazelcast.function.FunctionEx; import com.hazelcast.jet.kafka.connect.impl.SourceConnectorWrapper; import com.hazelcast.jet.kafka.connect.impl.processorsupplier.TaskMaxProcessorMetaSupplier; @@ -185,8 +186,7 @@ public static StreamSource connect(@Nonnull Properties properties) private static Properties getDefaultProperties(Properties properties) { // Make new copy - Properties defaultProperties = new Properties(); - defaultProperties.putAll(properties); + Properties defaultProperties = PropertiesUtil.clone(properties); // Populate tasks.max property if necessary defaultProperties.putIfAbsent("tasks.max", "1"); diff --git a/extensions/kafka-connect/src/test/java/com/hazelcast/jet/kafka/connect/KafkaConnectNeo4jIT.java b/extensions/kafka-connect/src/test/java/com/hazelcast/jet/kafka/connect/KafkaConnectNeo4jIT.java index 250a1b9176be..f19da95d15cf 100644 --- a/extensions/kafka-connect/src/test/java/com/hazelcast/jet/kafka/connect/KafkaConnectNeo4jIT.java +++ b/extensions/kafka-connect/src/test/java/com/hazelcast/jet/kafka/connect/KafkaConnectNeo4jIT.java @@ -128,7 +128,7 @@ public void testReadFromNeo4jConnector() { @Test public void testDbNotStarted() { Properties connectorProperties = getConnectorProperties(); - connectorProperties.put("neo4j.server.uri", "bolt://localhost:52403"); + connectorProperties.setProperty("neo4j.server.uri", "bolt://localhost:52403"); connectorProperties.setProperty("neo4j.retry.backoff.msecs", "5"); connectorProperties.setProperty("neo4j.retry.max.attemps", "1"); diff --git a/extensions/kafka/src/main/java/com/hazelcast/jet/kafka/KafkaDataConnection.java b/extensions/kafka/src/main/java/com/hazelcast/jet/kafka/KafkaDataConnection.java index 492cde788b42..8362e5af4eab 100644 --- a/extensions/kafka/src/main/java/com/hazelcast/jet/kafka/KafkaDataConnection.java +++ b/extensions/kafka/src/main/java/com/hazelcast/jet/kafka/KafkaDataConnection.java @@ -212,7 +212,7 @@ public KafkaProducer getProducer( Properties props = Util.mergeProps(configProperties, properties); if (transactionalId != null) { - props.put("transactional.id", transactionalId); + props.setProperty("transactional.id", transactionalId); } return new KafkaProducer<>(props); } diff --git a/extensions/kafka/src/test/java/com/hazelcast/jet/kafka/KafkaDataConnectionTest.java b/extensions/kafka/src/test/java/com/hazelcast/jet/kafka/KafkaDataConnectionTest.java index 6c05aa21bb28..2d616716dcc4 100644 --- a/extensions/kafka/src/test/java/com/hazelcast/jet/kafka/KafkaDataConnectionTest.java +++ b/extensions/kafka/src/test/java/com/hazelcast/jet/kafka/KafkaDataConnectionTest.java @@ -207,7 +207,7 @@ public void should_list_resource_types() { public void shared_producer_should_not_be_created_with_additional_props() { kafkaDataConnection = createKafkaDataConnection(kafkaTestSupport); Properties properties = new Properties(); - properties.put("A", "B"); + properties.setProperty("A", "B"); assertThatThrownBy(() -> kafkaDataConnection.getProducer(null, properties)) .isInstanceOf(HazelcastException.class) diff --git a/extensions/kafka/src/test/java/com/hazelcast/jet/kafka/impl/StreamKafkaAvroTest.java b/extensions/kafka/src/test/java/com/hazelcast/jet/kafka/impl/StreamKafkaAvroTest.java index 839df71c879f..03ce5e10c6c4 100644 --- a/extensions/kafka/src/test/java/com/hazelcast/jet/kafka/impl/StreamKafkaAvroTest.java +++ b/extensions/kafka/src/test/java/com/hazelcast/jet/kafka/impl/StreamKafkaAvroTest.java @@ -17,6 +17,7 @@ package com.hazelcast.jet.kafka.impl; import com.hazelcast.collection.IList; +import com.hazelcast.client.impl.protocol.util.PropertiesUtil; import com.hazelcast.jet.SimpleTestInClusterSupport; import com.hazelcast.jet.kafka.HazelcastKafkaAvroDeserializer; import com.hazelcast.jet.kafka.HazelcastKafkaAvroSerializer; @@ -133,14 +134,13 @@ public void writeGenericRecord() { } private Properties createProperties() { - Properties properties = new Properties(); + Properties properties = PropertiesUtil.fromMap(AVRO_SCHEMA_PROPERTIES); properties.setProperty(BOOTSTRAP_SERVERS_CONFIG, kafkaTestSupport.getBrokerConnectionString()); properties.setProperty(KEY_DESERIALIZER_CLASS_CONFIG, HazelcastKafkaAvroDeserializer.class.getCanonicalName()); properties.setProperty(VALUE_DESERIALIZER_CLASS_CONFIG, HazelcastKafkaAvroDeserializer.class.getCanonicalName()); properties.setProperty(KEY_SERIALIZER_CLASS_CONFIG, HazelcastKafkaAvroSerializer.class.getCanonicalName()); properties.setProperty(VALUE_SERIALIZER_CLASS_CONFIG, HazelcastKafkaAvroSerializer.class.getCanonicalName()); properties.setProperty(AUTO_OFFSET_RESET_CONFIG, "earliest"); - properties.putAll(AVRO_SCHEMA_PROPERTIES); return properties; } diff --git a/extensions/kafka/src/test/java/com/hazelcast/jet/kafka/impl/WriteKafkaPTest.java b/extensions/kafka/src/test/java/com/hazelcast/jet/kafka/impl/WriteKafkaPTest.java index ed758c9ba711..2429a34d5c92 100644 --- a/extensions/kafka/src/test/java/com/hazelcast/jet/kafka/impl/WriteKafkaPTest.java +++ b/extensions/kafka/src/test/java/com/hazelcast/jet/kafka/impl/WriteKafkaPTest.java @@ -259,7 +259,7 @@ private void stressTest(boolean graceful, boolean exactlyOnce) { @Test public void test_resumeTransaction() throws Exception { - properties.put("transactional.id", "txn.resumeTransactionTest"); + properties.setProperty("transactional.id", "txn.resumeTransactionTest"); // produce items KafkaProducer producer = new KafkaProducer<>(properties); diff --git a/hazelcast-spring-tests/src/test/java/com/hazelcast/spring/TestFullApplicationContext.java b/hazelcast-spring-tests/src/test/java/com/hazelcast/spring/TestFullApplicationContext.java index b948e207a95e..22e33a18c5ad 100644 --- a/hazelcast-spring-tests/src/test/java/com/hazelcast/spring/TestFullApplicationContext.java +++ b/hazelcast-spring-tests/src/test/java/com/hazelcast/spring/TestFullApplicationContext.java @@ -963,9 +963,9 @@ private void assertDiscoveryConfig(DiscoveryConfig discoveryConfig) { public void testProperties() { Properties properties = config.getProperties(); assertNotNull(properties); - assertEquals("5", properties.get(MERGE_FIRST_RUN_DELAY_SECONDS.getName())); - assertEquals("5", properties.get(MERGE_NEXT_RUN_DELAY_SECONDS.getName())); - assertEquals("277", properties.get(PARTITION_COUNT.getName())); + assertEquals("5", properties.getProperty(MERGE_FIRST_RUN_DELAY_SECONDS.getName())); + assertEquals("5", properties.getProperty(MERGE_NEXT_RUN_DELAY_SECONDS.getName())); + assertEquals("277", properties.getProperty(PARTITION_COUNT.getName())); Config config2 = instance.getConfig(); Properties properties2 = config2.getProperties(); diff --git a/hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/CalciteConfiguration.java b/hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/CalciteConfiguration.java index a98ad4060d96..d991c428fc91 100644 --- a/hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/CalciteConfiguration.java +++ b/hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/CalciteConfiguration.java @@ -61,13 +61,13 @@ public void toParserConfig(SqlParser.ConfigBuilder configBuilder) { public CalciteConnectionConfig toConnectionConfig() { Properties connectionProperties = new Properties(); - connectionProperties.put(CalciteConnectionProperty.CASE_SENSITIVE.camelName(), Boolean.toString(caseSensitive)); - connectionProperties.put(CalciteConnectionProperty.UNQUOTED_CASING.camelName(), unquotedCasing.toString()); - connectionProperties.put(CalciteConnectionProperty.QUOTED_CASING.camelName(), quotedCasing.toString()); - connectionProperties.put(CalciteConnectionProperty.QUOTING.camelName(), quoting.toString()); + connectionProperties.setProperty(CalciteConnectionProperty.CASE_SENSITIVE.camelName(), Boolean.toString(caseSensitive)); + connectionProperties.setProperty(CalciteConnectionProperty.UNQUOTED_CASING.camelName(), unquotedCasing.toString()); + connectionProperties.setProperty(CalciteConnectionProperty.QUOTED_CASING.camelName(), quotedCasing.toString()); + connectionProperties.setProperty(CalciteConnectionProperty.QUOTING.camelName(), quoting.toString()); // Disable materializations to avoid NPE described in https://github.com/hazelcast/hazelcast/issues/17554 - connectionProperties.put(CalciteConnectionProperty.MATERIALIZATIONS_ENABLED.camelName(), Boolean.toString(false)); + connectionProperties.setProperty(CalciteConnectionProperty.MATERIALIZATIONS_ENABLED.camelName(), Boolean.toString(false)); return new CalciteConnectionConfigImpl(connectionProperties); } diff --git a/hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/connector/kafka/PropertiesResolver.java b/hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/connector/kafka/PropertiesResolver.java index 1acaec7a1be2..7e1a2ad4a3c6 100644 --- a/hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/connector/kafka/PropertiesResolver.java +++ b/hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/connector/kafka/PropertiesResolver.java @@ -112,7 +112,7 @@ private static Properties from(Map options) { String value = entry.getValue(); if (!NON_KAFKA_OPTIONS.contains(key)) { - properties.put(key, value); + properties.setProperty(key, value); } } return properties; diff --git a/hazelcast-sql/src/test/java/com/hazelcast/jet/sql/impl/connector/kafka/KafkaSqlTestSupport.java b/hazelcast-sql/src/test/java/com/hazelcast/jet/sql/impl/connector/kafka/KafkaSqlTestSupport.java index 4c6b6341a700..780cf8fc92f1 100644 --- a/hazelcast-sql/src/test/java/com/hazelcast/jet/sql/impl/connector/kafka/KafkaSqlTestSupport.java +++ b/hazelcast-sql/src/test/java/com/hazelcast/jet/sql/impl/connector/kafka/KafkaSqlTestSupport.java @@ -67,12 +67,12 @@ private static void createKafkaCluster() throws Exception { protected static void createSchemaRegistry() throws Exception { Properties properties = new Properties(); - properties.put("listeners", "http://0.0.0.0:0"); - properties.put(SchemaRegistryConfig.KAFKASTORE_BOOTSTRAP_SERVERS_CONFIG, + properties.setProperty("listeners", "http://0.0.0.0:0"); + properties.setProperty(SchemaRegistryConfig.KAFKASTORE_BOOTSTRAP_SERVERS_CONFIG, kafkaTestSupport.getBrokerConnectionString()); // We increase the timeout (default is 500 ms) because when Kafka is under load, // the schema registry may give "RestClientException: Register operation timed out". - properties.put(SchemaRegistryConfig.KAFKASTORE_TIMEOUT_CONFIG, "5000"); + properties.setProperty(SchemaRegistryConfig.KAFKASTORE_TIMEOUT_CONFIG, "5000"); SchemaRegistryConfig config = new SchemaRegistryConfig(properties); kafkaTestSupport.createSchemaRegistry(config); } diff --git a/hazelcast/src/main/java/com/hazelcast/client/config/ClientConfig.java b/hazelcast/src/main/java/com/hazelcast/client/config/ClientConfig.java index 58cecde80efa..e27f175eab85 100644 --- a/hazelcast/src/main/java/com/hazelcast/client/config/ClientConfig.java +++ b/hazelcast/src/main/java/com/hazelcast/client/config/ClientConfig.java @@ -20,6 +20,7 @@ import com.hazelcast.client.LoadBalancer; import com.hazelcast.client.config.impl.XmlClientConfigLocator; import com.hazelcast.client.config.impl.YamlClientConfigLocator; +import com.hazelcast.client.impl.protocol.util.PropertiesUtil; import com.hazelcast.config.Config; import com.hazelcast.config.ConfigPatternMatcher; import com.hazelcast.config.InstanceTrackingConfig; @@ -133,8 +134,7 @@ public ClientConfig() { @SuppressWarnings({"checkstyle:npathcomplexity", "checkstyle:executablestatementcount"}) public ClientConfig(ClientConfig config) { - properties = new Properties(); - properties.putAll(config.properties); + properties = PropertiesUtil.clone(config.properties); clusterName = config.clusterName; securityConfig = new ClientSecurityConfig(config.securityConfig); networkConfig = new ClientNetworkConfig(config.networkConfig); @@ -274,7 +274,7 @@ public String getProperty(String name) { * @return configured {@link com.hazelcast.client.config.ClientConfig} for chaining */ public ClientConfig setProperty(String name, String value) { - properties.put(name, value); + properties.setProperty(name, value); return this; } diff --git a/hazelcast/src/main/java/com/hazelcast/client/config/impl/YamlClientDomConfigProcessor.java b/hazelcast/src/main/java/com/hazelcast/client/config/impl/YamlClientDomConfigProcessor.java index c7cb2f453d9d..bdeae6b1fa55 100644 --- a/hazelcast/src/main/java/com/hazelcast/client/config/impl/YamlClientDomConfigProcessor.java +++ b/hazelcast/src/main/java/com/hazelcast/client/config/impl/YamlClientDomConfigProcessor.java @@ -298,7 +298,7 @@ protected void fillProperties(Node node, Properties properties) { NodeList childNodes = node.getChildNodes(); for (int i = 0; i < childNodes.getLength(); i++) { Node childNode = childNodes.item(i); - properties.put(childNode.getNodeName(), childNode.getNodeValue()); + properties.setProperty(childNode.getNodeName(), childNode.getNodeValue()); } } diff --git a/hazelcast/src/main/java/com/hazelcast/client/impl/protocol/util/PropertiesUtil.java b/hazelcast/src/main/java/com/hazelcast/client/impl/protocol/util/PropertiesUtil.java index bed46c184056..2eacc2404415 100644 --- a/hazelcast/src/main/java/com/hazelcast/client/impl/protocol/util/PropertiesUtil.java +++ b/hazelcast/src/main/java/com/hazelcast/client/impl/protocol/util/PropertiesUtil.java @@ -17,6 +17,8 @@ package com.hazelcast.client.impl.protocol.util; +import javax.annotation.Nonnull; + import java.util.Map; import java.util.Properties; import java.util.stream.Collectors; @@ -40,4 +42,8 @@ public static Map toMap(Properties properties) { ) ); } + + public static Properties clone(@Nonnull Properties properties) { + return (Properties) properties.clone(); + } } diff --git a/hazelcast/src/main/java/com/hazelcast/config/AbstractBaseFactoryWithPropertiesConfig.java b/hazelcast/src/main/java/com/hazelcast/config/AbstractBaseFactoryWithPropertiesConfig.java index e188214e45e6..f08c39fd2d6d 100644 --- a/hazelcast/src/main/java/com/hazelcast/config/AbstractBaseFactoryWithPropertiesConfig.java +++ b/hazelcast/src/main/java/com/hazelcast/config/AbstractBaseFactoryWithPropertiesConfig.java @@ -57,7 +57,7 @@ public T setFactoryClassName(@Nonnull String factoryClassName) { * @throws NullPointerException if name or value is {@code null} */ public T setProperty(String name, String value) { - properties.put(name, value); + properties.setProperty(name, value); return self(); } diff --git a/hazelcast/src/main/java/com/hazelcast/config/AbstractYamlConfigBuilder.java b/hazelcast/src/main/java/com/hazelcast/config/AbstractYamlConfigBuilder.java index cca44d1ec998..bcc9cb8688a6 100644 --- a/hazelcast/src/main/java/com/hazelcast/config/AbstractYamlConfigBuilder.java +++ b/hazelcast/src/main/java/com/hazelcast/config/AbstractYamlConfigBuilder.java @@ -247,7 +247,7 @@ private void fillReplacerProperties(Node node, Properties properties) { String childName = childNodePair.nodeName(); YamlNode child = childNodePair.childNode(); Object nodeValue = asScalar(child).nodeValue(); - properties.put(childName, nodeValue != null ? nodeValue.toString() : ""); + properties.setProperty(childName, nodeValue != null ? nodeValue.toString() : ""); } } } diff --git a/hazelcast/src/main/java/com/hazelcast/config/AliasedDiscoveryConfig.java b/hazelcast/src/main/java/com/hazelcast/config/AliasedDiscoveryConfig.java index 0c3df001b5df..f87bf490b7a9 100644 --- a/hazelcast/src/main/java/com/hazelcast/config/AliasedDiscoveryConfig.java +++ b/hazelcast/src/main/java/com/hazelcast/config/AliasedDiscoveryConfig.java @@ -56,8 +56,7 @@ public AliasedDiscoveryConfig(String tag, boolean enabled, boolean usePublicIp, this.tag = tag; this.enabled = enabled; this.usePublicIp = usePublicIp; - this.properties = new HashMap<>(); - this.properties.putAll(properties); + this.properties = new HashMap<>(properties); } /** diff --git a/hazelcast/src/main/java/com/hazelcast/config/Config.java b/hazelcast/src/main/java/com/hazelcast/config/Config.java index 2c5d24c6df67..7acd543996cd 100644 --- a/hazelcast/src/main/java/com/hazelcast/config/Config.java +++ b/hazelcast/src/main/java/com/hazelcast/config/Config.java @@ -599,7 +599,7 @@ public Config setProperty(@Nonnull String name, @Nonnull String value) { throw new IllegalArgumentException("argument 'name' can't be null or empty"); } isNotNull(value, "value"); - properties.put(name, value); + properties.setProperty(name, value); return this; } @@ -3208,9 +3208,9 @@ public Config setDataConnectionConfigs(Map dataCon *
{@code
      *      Config config = new Config();
      *      Properties properties = new Properties();
-     *      properties.put("jdbcUrl", jdbcUrl);
-     *      properties.put("username", username);
-     *      properties.put("password", password);
+     *      properties.setProperty("jdbcUrl", jdbcUrl);
+     *      properties.setProperty("username", username);
+     *      properties.setProperty("password", password);
      *      DataConnectionConfig dataConnectionConfig = new DataConnectionConfig()
      *              .setName("my-jdbc-data-connection")
      *              .setType("Jdbc")
diff --git a/hazelcast/src/main/java/com/hazelcast/config/CredentialsFactoryConfig.java b/hazelcast/src/main/java/com/hazelcast/config/CredentialsFactoryConfig.java
index ee100efb8743..92c8cbf4d932 100644
--- a/hazelcast/src/main/java/com/hazelcast/config/CredentialsFactoryConfig.java
+++ b/hazelcast/src/main/java/com/hazelcast/config/CredentialsFactoryConfig.java
@@ -19,6 +19,7 @@
 import java.util.Objects;
 import java.util.Properties;
 
+import com.hazelcast.client.impl.protocol.util.PropertiesUtil;
 import com.hazelcast.config.security.IdentityConfig;
 import com.hazelcast.internal.nio.ClassLoaderUtil;
 import com.hazelcast.security.ICredentialsFactory;
@@ -44,8 +45,7 @@ public CredentialsFactoryConfig(String className) {
     private CredentialsFactoryConfig(CredentialsFactoryConfig credentialsFactoryConfig) {
         className = credentialsFactoryConfig.className;
         implementation = credentialsFactoryConfig.implementation;
-        properties = new Properties();
-        properties.putAll(credentialsFactoryConfig.properties);
+        properties = PropertiesUtil.clone(credentialsFactoryConfig.properties);
     }
 
     public String getClassName() {
diff --git a/hazelcast/src/main/java/com/hazelcast/config/DataConnectionConfig.java b/hazelcast/src/main/java/com/hazelcast/config/DataConnectionConfig.java
index 8564a2a320ac..1f699119cb37 100644
--- a/hazelcast/src/main/java/com/hazelcast/config/DataConnectionConfig.java
+++ b/hazelcast/src/main/java/com/hazelcast/config/DataConnectionConfig.java
@@ -16,6 +16,7 @@
 
 package com.hazelcast.config;
 
+import com.hazelcast.client.impl.protocol.util.PropertiesUtil;
 import com.hazelcast.dataconnection.DataConnection;
 import com.hazelcast.internal.config.ConfigDataSerializerHook;
 import com.hazelcast.jet.pipeline.Pipeline;
@@ -51,19 +52,21 @@ public class DataConnectionConfig implements IdentifiedDataSerializable, NamedCo
     private String name;
     private String type;
     private boolean shared = true;
-    private Properties properties = new Properties();
+    private Properties properties;
 
     public DataConnectionConfig() {
+        properties = new Properties();
     }
 
     public DataConnectionConfig(DataConnectionConfig config) {
         name = config.name;
         type = config.type;
         shared = config.shared;
-        properties.putAll(config.getProperties());
+        properties = PropertiesUtil.clone(config.getProperties());
     }
 
     public DataConnectionConfig(String name) {
+        this();
         this.name = checkNotNull(name, "Name must not be null");
     }
 
diff --git a/hazelcast/src/main/java/com/hazelcast/config/MapStoreConfig.java b/hazelcast/src/main/java/com/hazelcast/config/MapStoreConfig.java
index e1c1b6d2b0b7..856d16f51cf3 100644
--- a/hazelcast/src/main/java/com/hazelcast/config/MapStoreConfig.java
+++ b/hazelcast/src/main/java/com/hazelcast/config/MapStoreConfig.java
@@ -16,6 +16,7 @@
 
 package com.hazelcast.config;
 
+import com.hazelcast.client.impl.protocol.util.PropertiesUtil;
 import com.hazelcast.internal.config.ConfigDataSerializerHook;
 import com.hazelcast.map.MapStore;
 import com.hazelcast.nio.ObjectDataInput;
@@ -64,7 +65,7 @@ public class MapStoreConfig implements IdentifiedDataSerializable, Versioned {
     private String factoryClassName;
     private Object implementation;
     private Object factoryImplementation;
-    private Properties properties = new Properties();
+    private Properties properties;
     private InitialLoadMode initialLoadMode = InitialLoadMode.LAZY;
 
     /**
@@ -82,6 +83,7 @@ public enum InitialLoadMode {
     }
 
     public MapStoreConfig() {
+        properties = new Properties();
     }
 
     public MapStoreConfig(MapStoreConfig config) {
@@ -95,7 +97,7 @@ public MapStoreConfig(MapStoreConfig config) {
         initialLoadMode = config.getInitialLoadMode();
         writeCoalescing = config.isWriteCoalescing();
         offload = config.isOffload();
-        properties.putAll(config.getProperties());
+        properties = PropertiesUtil.clone(config.getProperties());
     }
 
     /**
@@ -282,7 +284,7 @@ public Object getFactoryImplementation() {
     }
 
     public MapStoreConfig setProperty(String name, String value) {
-        properties.put(name, value);
+        properties.setProperty(name, value);
         return this;
     }
 
diff --git a/hazelcast/src/main/java/com/hazelcast/config/QueueStoreConfig.java b/hazelcast/src/main/java/com/hazelcast/config/QueueStoreConfig.java
index b57990e7b42b..bbf97972abd0 100644
--- a/hazelcast/src/main/java/com/hazelcast/config/QueueStoreConfig.java
+++ b/hazelcast/src/main/java/com/hazelcast/config/QueueStoreConfig.java
@@ -16,6 +16,7 @@
 
 package com.hazelcast.config;
 
+import com.hazelcast.client.impl.protocol.util.PropertiesUtil;
 import com.hazelcast.collection.QueueStore;
 import com.hazelcast.collection.QueueStoreFactory;
 import com.hazelcast.internal.config.ConfigDataSerializerHook;
@@ -77,11 +78,12 @@ public class QueueStoreConfig implements IdentifiedDataSerializable {
     private boolean enabled = true;
     private String className;
     private String factoryClassName;
-    private Properties properties = new Properties();
+    private Properties properties;
     private QueueStore storeImplementation;
     private QueueStoreFactory factoryImplementation;
 
     public QueueStoreConfig() {
+        properties = new Properties();
     }
 
     public QueueStoreConfig(QueueStoreConfig config) {
@@ -90,7 +92,7 @@ public QueueStoreConfig(QueueStoreConfig config) {
         storeImplementation = config.getStoreImplementation();
         factoryClassName = config.getFactoryClassName();
         factoryImplementation = config.getFactoryImplementation();
-        properties.putAll(config.getProperties());
+        properties = PropertiesUtil.clone(config.getProperties());
     }
 
     /**
@@ -207,7 +209,7 @@ public String getProperty(String name) {
      * @return this configuration
      */
     public QueueStoreConfig setProperty(String name, String value) {
-        properties.put(name, value);
+        properties.setProperty(name, value);
         return this;
     }
 
diff --git a/hazelcast/src/main/java/com/hazelcast/config/RingbufferStoreConfig.java b/hazelcast/src/main/java/com/hazelcast/config/RingbufferStoreConfig.java
index 1f6adf160f20..bb2cb94bd63a 100644
--- a/hazelcast/src/main/java/com/hazelcast/config/RingbufferStoreConfig.java
+++ b/hazelcast/src/main/java/com/hazelcast/config/RingbufferStoreConfig.java
@@ -16,6 +16,7 @@
 
 package com.hazelcast.config;
 
+import com.hazelcast.client.impl.protocol.util.PropertiesUtil;
 import com.hazelcast.internal.config.ConfigDataSerializerHook;
 import com.hazelcast.nio.ObjectDataInput;
 import com.hazelcast.nio.ObjectDataOutput;
@@ -39,11 +40,12 @@ public class RingbufferStoreConfig implements IdentifiedDataSerializable {
     private boolean enabled = true;
     private String className;
     private String factoryClassName;
-    private Properties properties = new Properties();
+    private Properties properties;
     private RingbufferStore storeImplementation;
     private RingbufferStoreFactory factoryImplementation;
 
     public RingbufferStoreConfig() {
+        properties = new Properties();
     }
 
     public RingbufferStoreConfig(RingbufferStoreConfig config) {
@@ -52,7 +54,7 @@ public RingbufferStoreConfig(RingbufferStoreConfig config) {
         storeImplementation = config.getStoreImplementation();
         factoryClassName = config.getFactoryClassName();
         factoryImplementation = config.getFactoryImplementation();
-        properties.putAll(config.getProperties());
+        properties = PropertiesUtil.clone(config.getProperties());
     }
 
     public RingbufferStore getStoreImplementation() {
@@ -98,7 +100,7 @@ public String getProperty(String name) {
     }
 
     public RingbufferStoreConfig setProperty(String name, String value) {
-        properties.put(name, value);
+        properties.setProperty(name, value);
         return this;
     }
 
diff --git a/hazelcast/src/main/java/com/hazelcast/config/SSLConfig.java b/hazelcast/src/main/java/com/hazelcast/config/SSLConfig.java
index b43f760f8f2f..25d1ced90168 100644
--- a/hazelcast/src/main/java/com/hazelcast/config/SSLConfig.java
+++ b/hazelcast/src/main/java/com/hazelcast/config/SSLConfig.java
@@ -16,9 +16,10 @@
 
 package com.hazelcast.config;
 
+import com.hazelcast.client.impl.protocol.util.PropertiesUtil;
+
 import javax.annotation.Nonnull;
 import java.util.Objects;
-import java.util.Properties;
 
 import static com.hazelcast.internal.util.Preconditions.checkNotNull;
 
@@ -36,9 +37,7 @@ public SSLConfig(SSLConfig sslConfig) {
         factoryImplementation = sslConfig.factoryImplementation;
         setEnabled(sslConfig.isEnabled());
         factoryClassName = sslConfig.getFactoryClassName();
-        Properties properties = new Properties();
-        properties.putAll(sslConfig.getProperties());
-        setProperties(properties);
+        setProperties(PropertiesUtil.clone(sslConfig.getProperties()));
     }
 
     /**
diff --git a/hazelcast/src/main/java/com/hazelcast/config/SocketInterceptorConfig.java b/hazelcast/src/main/java/com/hazelcast/config/SocketInterceptorConfig.java
index a51927d89da4..853eacd0e838 100644
--- a/hazelcast/src/main/java/com/hazelcast/config/SocketInterceptorConfig.java
+++ b/hazelcast/src/main/java/com/hazelcast/config/SocketInterceptorConfig.java
@@ -16,6 +16,7 @@
 
 package com.hazelcast.config;
 
+import com.hazelcast.client.impl.protocol.util.PropertiesUtil;
 import com.hazelcast.nio.SocketInterceptor;
 
 import javax.annotation.Nonnull;
@@ -32,17 +33,17 @@ public class SocketInterceptorConfig {
     private boolean enabled;
     private String className;
     private Object implementation;
-    private Properties properties = new Properties();
+    private Properties properties;
 
     public SocketInterceptorConfig() {
+        properties = new Properties();
     }
 
     public SocketInterceptorConfig(SocketInterceptorConfig socketInterceptorConfig) {
         enabled = socketInterceptorConfig.enabled;
         className = socketInterceptorConfig.className;
         implementation = socketInterceptorConfig.implementation;
-        properties = new Properties();
-        properties.putAll(socketInterceptorConfig.properties);
+        properties = PropertiesUtil.clone(socketInterceptorConfig.properties);
     }
 
     /**
@@ -115,7 +116,7 @@ public SocketInterceptorConfig setEnabled(boolean enabled) {
      * @throws NullPointerException if name or value is {@code null}
      */
     public SocketInterceptorConfig setProperty(String name, String value) {
-        properties.put(name, value);
+        properties.setProperty(name, value);
         return this;
     }
 
diff --git a/hazelcast/src/main/java/com/hazelcast/dataconnection/impl/DataConnectionServiceImpl.java b/hazelcast/src/main/java/com/hazelcast/dataconnection/impl/DataConnectionServiceImpl.java
index 79846aae6155..8ba5c9218621 100644
--- a/hazelcast/src/main/java/com/hazelcast/dataconnection/impl/DataConnectionServiceImpl.java
+++ b/hazelcast/src/main/java/com/hazelcast/dataconnection/impl/DataConnectionServiceImpl.java
@@ -16,6 +16,7 @@
 
 package com.hazelcast.dataconnection.impl;
 
+import com.hazelcast.client.impl.protocol.util.PropertiesUtil;
 import com.hazelcast.config.DataConnectionConfig;
 import com.hazelcast.config.DataConnectionConfigValidator;
 import com.hazelcast.core.HazelcastException;
@@ -154,8 +155,7 @@ public boolean existsSqlDataConnection(String name) {
 
     // package-private for testing purposes
     DataConnectionConfig toConfig(String name, String type, boolean shared, Map options) {
-        Properties properties = new Properties();
-        properties.putAll(options);
+        Properties properties = PropertiesUtil.fromMap(options);
         return new DataConnectionConfig(name)
                 .setType(type)
                 .setShared(shared)
diff --git a/hazelcast/src/main/java/com/hazelcast/dataconnection/impl/jdbcproperties/DriverManagerTranslator.java b/hazelcast/src/main/java/com/hazelcast/dataconnection/impl/jdbcproperties/DriverManagerTranslator.java
index cd44938de532..33de68479051 100644
--- a/hazelcast/src/main/java/com/hazelcast/dataconnection/impl/jdbcproperties/DriverManagerTranslator.java
+++ b/hazelcast/src/main/java/com/hazelcast/dataconnection/impl/jdbcproperties/DriverManagerTranslator.java
@@ -16,6 +16,8 @@
 
 package com.hazelcast.dataconnection.impl.jdbcproperties;
 
+import com.hazelcast.client.impl.protocol.util.PropertiesUtil;
+
 import java.util.Properties;
 
 public final class DriverManagerTranslator {
@@ -24,8 +26,7 @@ private DriverManagerTranslator() {
     }
 
     public static Properties translate(Properties source) {
-        Properties driverManagerProperties = new Properties();
-        driverManagerProperties.putAll(source);
+        Properties driverManagerProperties = PropertiesUtil.clone(source);
         driverManagerProperties.remove("jdbcUrl");
         return driverManagerProperties;
     }
diff --git a/hazelcast/src/main/java/com/hazelcast/jet/pipeline/JdbcSinkBuilder.java b/hazelcast/src/main/java/com/hazelcast/jet/pipeline/JdbcSinkBuilder.java
index 515d93829af5..e282d282f452 100644
--- a/hazelcast/src/main/java/com/hazelcast/jet/pipeline/JdbcSinkBuilder.java
+++ b/hazelcast/src/main/java/com/hazelcast/jet/pipeline/JdbcSinkBuilder.java
@@ -194,9 +194,9 @@ public JdbcSinkBuilder batchLimit(int batchLimit) {
      * 
{@code
      *      Config config = smallInstanceConfig();
      *      Properties properties = new Properties();
-     *      properties.put("jdbcUrl", jdbcUrl);
-     *      properties.put("username", username);
-     *      properties.put("password", password);
+     *      properties.setProperty("jdbcUrl", jdbcUrl);
+     *      properties.setProperty("username", username);
+     *      properties.setProperty("password", password);
      *      DataConnectionConfig dataConnectionConfig = new DataConnectionConfig()
      *              .setName("my-jdbc-data-connection")
      *              .setClassName(JdbcDataConnection.class.getName())
diff --git a/hazelcast/src/main/java/com/hazelcast/jet/pipeline/Sources.java b/hazelcast/src/main/java/com/hazelcast/jet/pipeline/Sources.java
index 71e06b9c5daa..eac0c82faf13 100644
--- a/hazelcast/src/main/java/com/hazelcast/jet/pipeline/Sources.java
+++ b/hazelcast/src/main/java/com/hazelcast/jet/pipeline/Sources.java
@@ -1460,9 +1460,9 @@ public static  BatchSource jdbc(
      * 
{@code
      *      Config config = smallInstanceConfig();
      *      Properties properties = new Properties();
-     *      properties.put("jdbcUrl", jdbcUrl);
-     *      properties.put("username", username);
-     *      properties.put("password", password);
+     *      properties.setProperty("jdbcUrl", jdbcUrl);
+     *      properties.setProperty("username", username);
+     *      properties.setProperty("password", password);
      *      DataConnectionConfig dataConnectionConfig = new DataConnectionConfig()
      *              .setName("my-jdbc-data-connection")
      *              .setType("Jdbc")
@@ -1541,8 +1541,8 @@ public static  BatchSource jdbc(
      * the backend will have closed the cursor before anything can be fetched from it.
      * 
{@code
      *        Properties properties = new Properties();
-     *        properties.put(JdbcPropertyKeys.FETCH_SIZE, "5");
-     *        properties.put(JdbcPropertyKeys.AUTO_COMMIT, "false");
+     *        properties.setProperty(JdbcPropertyKeys.FETCH_SIZE, "5");
+     *        properties.setProperty(JdbcPropertyKeys.AUTO_COMMIT, "false");
      *        p.readFrom(Sources.jdbc(
      *            "jdbc:postgresql://localhost:5432/mydatabase",
      *            "select ID, NAME from PERSON",
@@ -1555,7 +1555,7 @@ public static  BatchSource jdbc(
      * rather than fetching all the rows in the result set at once
      * 
{@code
      *        Properties properties = new Properties();
-     *        properties.put(JdbcPropertyKeys.FETCH_SIZE, "5");
+     *        properties.setProperty(JdbcPropertyKeys.FETCH_SIZE, "5");
      *        p.readFrom(Sources.jdbc(
      *            "jdbc:mysql://localhost:3306/mydatabase?useCursorFetch=true,"
      *            "select ID, NAME from PERSON",
diff --git a/hazelcast/src/test/java/com/hazelcast/client/config/XmlClientConfigImportVariableReplacementTest.java b/hazelcast/src/test/java/com/hazelcast/client/config/XmlClientConfigImportVariableReplacementTest.java
index ca1e81d5fca3..1b5ba5dc59f6 100644
--- a/hazelcast/src/test/java/com/hazelcast/client/config/XmlClientConfigImportVariableReplacementTest.java
+++ b/hazelcast/src/test/java/com/hazelcast/client/config/XmlClientConfigImportVariableReplacementTest.java
@@ -96,7 +96,7 @@ public void testImportResourceWithConfigReplacers() throws IOException {
             + HAZELCAST_CLIENT_END_TAG;
 
         Properties properties = new Properties(System.getProperties());
-        properties.put("config.location", configLocation);
+        properties.setProperty("config.location", configLocation);
         ClientConfig groupConfig = buildConfig(xml, properties);
         assertEquals(System.getProperty("java.version") + " dev", groupConfig.getClusterName());
     }
@@ -123,7 +123,7 @@ public void testImportResourceWithNestedImports() throws IOException {
             + HAZELCAST_CLIENT_END_TAG;
 
         Properties properties = new Properties(System.getProperties());
-        properties.put("config.location", clusterNameLocation);
+        properties.setProperty("config.location", clusterNameLocation);
         ClientConfig groupConfig = buildConfig(xml, properties);
         assertEquals(System.getProperty("java.version") + " dev", groupConfig.getClusterName());
     }
@@ -156,8 +156,8 @@ public void testImportResourceWithNestedImportsAndProperties() throws IOExceptio
             + HAZELCAST_CLIENT_END_TAG;
 
         Properties properties = new Properties(System.getProperties());
-        properties.put("config.location", clusterNameLocation);
-        properties.put("p1", "a property");
+        properties.setProperty("config.location", clusterNameLocation);
+        properties.setProperty("p1", "a property");
         ClientConfig config = buildConfig(xml, properties);
         assertEquals("a property  another property  $T{p5}", config.getClusterName());
     }
diff --git a/hazelcast/src/test/java/com/hazelcast/client/config/YamlClientConfigImportVariableReplacementTest.java b/hazelcast/src/test/java/com/hazelcast/client/config/YamlClientConfigImportVariableReplacementTest.java
index 4d561532ee71..b8ce317d587e 100644
--- a/hazelcast/src/test/java/com/hazelcast/client/config/YamlClientConfigImportVariableReplacementTest.java
+++ b/hazelcast/src/test/java/com/hazelcast/client/config/YamlClientConfigImportVariableReplacementTest.java
@@ -102,7 +102,7 @@ public void testImportResourceWithConfigReplacers() throws IOException {
             + "  cluster-name: ${java.version} $ID{dev}\n";
 
         Properties properties = new Properties(System.getProperties());
-        properties.put("config.location", configLocation);
+        properties.setProperty("config.location", configLocation);
         ClientConfig groupConfig = buildConfig(clusterName, properties);
         assertEquals(System.getProperty("java.version") + " dev", groupConfig.getClusterName());
     }
@@ -131,7 +131,7 @@ public void testImportResourceWithNestedImports() throws IOException {
             + "    - " + "${config.location}\n";
 
         Properties properties = new Properties(System.getProperties());
-        properties.put("config.location", clusterNameLocation);
+        properties.setProperty("config.location", clusterNameLocation);
         ClientConfig groupConfig = buildConfig(yaml, properties);
         assertEquals(System.getProperty("java.version") + " dev", groupConfig.getClusterName());
     }
@@ -167,8 +167,8 @@ public void testImportResourceWithNestedImportsAndProperties() throws IOExceptio
             + "    - " + "${config.location}\n";
 
         Properties properties = new Properties(System.getProperties());
-        properties.put("config.location", clusterNameLocation);
-        properties.put("p1", "a property");
+        properties.setProperty("config.location", clusterNameLocation);
+        properties.setProperty("p1", "a property");
         ClientConfig config = buildConfig(yaml, properties);
         assertEquals("a property  another property  $T{p5}", config.getClusterName());
     }
@@ -399,7 +399,7 @@ public void testReplaceVariablesUseSystemProperties() {
     @Test
     public void testReplaceVariablesWithClasspathConfig() {
         Properties properties = new Properties();
-        properties.put("variable", "foobar");
+        properties.setProperty("variable", "foobar");
         ClientConfig config = new ClientClasspathYamlConfig("test-hazelcast-client-variable.yaml", properties);
 
         assertEquals("foobar", config.getProperty("prop"));
diff --git a/hazelcast/src/test/java/com/hazelcast/config/ConfigXmlGeneratorTest.java b/hazelcast/src/test/java/com/hazelcast/config/ConfigXmlGeneratorTest.java
index 9510cd917e55..959d899408f1 100644
--- a/hazelcast/src/test/java/com/hazelcast/config/ConfigXmlGeneratorTest.java
+++ b/hazelcast/src/test/java/com/hazelcast/config/ConfigXmlGeneratorTest.java
@@ -1526,7 +1526,7 @@ public void testDataConnectionConfig() {
         Config expectedConfig = new Config();
 
         Properties properties = new Properties();
-        properties.put("jdbcUrl", "jdbc:h2:mem:" + DataConnectionServiceImplTest.class.getSimpleName());
+        properties.setProperty("jdbcUrl", "jdbc:h2:mem:" + DataConnectionServiceImplTest.class.getSimpleName());
         DataConnectionConfig dataConnectionConfig = new DataConnectionConfig()
                 .setName("test-data-connection")
                 .setType("jdbc")
diff --git a/hazelcast/src/test/java/com/hazelcast/config/MapStoreConfigTest.java b/hazelcast/src/test/java/com/hazelcast/config/MapStoreConfigTest.java
index 817a4d0781a9..7bfe97db2664 100644
--- a/hazelcast/src/test/java/com/hazelcast/config/MapStoreConfigTest.java
+++ b/hazelcast/src/test/java/com/hazelcast/config/MapStoreConfigTest.java
@@ -178,12 +178,12 @@ public void getProperties() {
     @Test
     public void setProperties() {
         Properties properties = new Properties();
-        properties.put("a", "b");
+        properties.setProperty("a", "b");
         MapStoreConfig cfg = new MapStoreConfig().setProperties(properties);
         assertEquals(properties, cfg.getProperties());
         assertEquals("b", cfg.getProperty("a"));
         Properties otherProperties = new Properties();
-        otherProperties.put("a", "b");
+        otherProperties.setProperty("a", "b");
         assertEquals(new MapStoreConfig().setProperties(otherProperties), cfg);
     }
 
diff --git a/hazelcast/src/test/java/com/hazelcast/config/RingbufferStoreConfigTest.java b/hazelcast/src/test/java/com/hazelcast/config/RingbufferStoreConfigTest.java
index f66ee80582b6..9d68090ca762 100644
--- a/hazelcast/src/test/java/com/hazelcast/config/RingbufferStoreConfigTest.java
+++ b/hazelcast/src/test/java/com/hazelcast/config/RingbufferStoreConfigTest.java
@@ -77,7 +77,7 @@ public void setStoreImplementation() {
     @Test
     public void setProperties() {
         Properties properties = new Properties();
-        properties.put("key", "value");
+        properties.setProperty("key", "value");
 
         config.setProperties(properties);
 
diff --git a/hazelcast/src/test/java/com/hazelcast/config/XmlConfigImportVariableReplacementTest.java b/hazelcast/src/test/java/com/hazelcast/config/XmlConfigImportVariableReplacementTest.java
index f576be687d48..c4ecd0115746 100644
--- a/hazelcast/src/test/java/com/hazelcast/config/XmlConfigImportVariableReplacementTest.java
+++ b/hazelcast/src/test/java/com/hazelcast/config/XmlConfigImportVariableReplacementTest.java
@@ -119,7 +119,7 @@ public void testImportResourceWithConfigReplacers() throws IOException {
                 + HAZELCAST_END_TAG;
 
         Properties properties = new Properties(System.getProperties());
-        properties.put("config.location", configLocation);
+        properties.setProperty("config.location", configLocation);
         Config groupConfig = buildConfig(xml, properties);
         assertEquals(System.getProperty("java.version") + " dev", groupConfig.getClusterName());
     }
@@ -146,7 +146,7 @@ public void testImportResourceWithNestedImports() throws IOException {
             + HAZELCAST_END_TAG;
 
         Properties properties = new Properties(System.getProperties());
-        properties.put("config.location", clusterNameLocation);
+        properties.setProperty("config.location", clusterNameLocation);
         Config groupConfig = buildConfig(xml, properties);
         assertEquals(System.getProperty("java.version") + " dev", groupConfig.getClusterName());
     }
@@ -179,8 +179,8 @@ public void testImportResourceWithNestedImportsAndProperties() throws IOExceptio
             + HAZELCAST_END_TAG;
 
         Properties properties = new Properties(System.getProperties());
-        properties.put("config.location", clusterNameLocation);
-        properties.put("p1", "a property");
+        properties.setProperty("config.location", clusterNameLocation);
+        properties.setProperty("p1", "a property");
         Config config = buildConfig(xml, properties);
         assertEquals("a property  another property  $T{p5}", config.getClusterName());
     }
@@ -592,7 +592,7 @@ public void testReplaceVariablesWithFileSystemConfig() throws Exception {
         String pathToFile = helper.givenConfigFileInWorkDir("config-properties.xml", configXml).getAbsolutePath();
 
         Properties properties = new Properties();
-        properties.put("variable", "foobar");
+        properties.setProperty("variable", "foobar");
         Config config = new FileSystemXmlConfig(new File(pathToFile), properties);
 
         assertEquals("foobar", config.getProperty("prop"));
@@ -608,7 +608,7 @@ public void testReplaceVariablesWithInMemoryConfig() {
                 + HAZELCAST_END_TAG;
 
         Properties properties = new Properties();
-        properties.put("variable", "foobar");
+        properties.setProperty("variable", "foobar");
         Config config = new InMemoryXmlConfig(configXml, properties);
 
         assertEquals("foobar", config.getProperty("prop"));
@@ -618,7 +618,7 @@ public void testReplaceVariablesWithInMemoryConfig() {
     @Test
     public void testReplaceVariablesWithClasspathConfig() {
         Properties properties = new Properties();
-        properties.put("variable", "foobar");
+        properties.setProperty("variable", "foobar");
         Config config = new ClasspathXmlConfig("test-hazelcast-variable.xml", properties);
 
         assertEquals("foobar", config.getProperty("prop"));
@@ -635,7 +635,7 @@ public void testReplaceVariablesWithUrlConfig() throws Exception {
         Path path = helper.givenConfigFileInWorkDir("config-properties.xml", configXml).toPath().toAbsolutePath();
 
         Properties properties = new Properties();
-        properties.put("variable", "foobar");
+        properties.setProperty("variable", "foobar");
         Config config = new UrlXmlConfig(path.toUri().toString(), properties);
 
         assertEquals("foobar", config.getProperty("prop"));
diff --git a/hazelcast/src/test/java/com/hazelcast/dataconnection/impl/DataConnectionTestUtil.java b/hazelcast/src/test/java/com/hazelcast/dataconnection/impl/DataConnectionTestUtil.java
index 3426003df172..c2ea2465693d 100644
--- a/hazelcast/src/test/java/com/hazelcast/dataconnection/impl/DataConnectionTestUtil.java
+++ b/hazelcast/src/test/java/com/hazelcast/dataconnection/impl/DataConnectionTestUtil.java
@@ -37,7 +37,7 @@ private DataConnectionTestUtil() {
 
     public static void configureJdbcDataConnection(String name, String jdbcUrl, Config config) {
         Properties properties = new Properties();
-        properties.put("jdbcUrl", jdbcUrl);
+        properties.setProperty("jdbcUrl", jdbcUrl);
         DataConnectionConfig dataConnectionConfig = new DataConnectionConfig()
                 .setName(name)
                 .setType("jdbc")
@@ -47,9 +47,9 @@ public static void configureJdbcDataConnection(String name, String jdbcUrl, Conf
 
     public static void configureJdbcDataConnection(String name, String jdbcUrl, String username, String password, Config config) {
         Properties properties = new Properties();
-        properties.put("jdbcUrl", jdbcUrl);
-        properties.put("user", username);
-        properties.put("password", password);
+        properties.setProperty("jdbcUrl", jdbcUrl);
+        properties.setProperty("user", username);
+        properties.setProperty("password", password);
         DataConnectionConfig dataConnectionConfig = new DataConnectionConfig()
                 .setName(name)
                 .setType("jdbc")
@@ -59,7 +59,7 @@ public static void configureJdbcDataConnection(String name, String jdbcUrl, Stri
 
     public static void configureMongoDataConnection(String name, String connectionString, Config config) {
         Properties properties = new Properties();
-        properties.put("connectionString", connectionString);
+        properties.setProperty("connectionString", connectionString);
         DataConnectionConfig dataConnectionConfig = new DataConnectionConfig()
                 .setName(name)
                 .setType("mongo")
diff --git a/hazelcast/src/test/java/com/hazelcast/dataconnection/impl/jdbcproperties/DriverManagerTranslatorTest.java b/hazelcast/src/test/java/com/hazelcast/dataconnection/impl/jdbcproperties/DriverManagerTranslatorTest.java
index 95f4ca7754c9..e8b0bb181d0e 100644
--- a/hazelcast/src/test/java/com/hazelcast/dataconnection/impl/jdbcproperties/DriverManagerTranslatorTest.java
+++ b/hazelcast/src/test/java/com/hazelcast/dataconnection/impl/jdbcproperties/DriverManagerTranslatorTest.java
@@ -37,10 +37,10 @@ public void testTranslatableProperties() {
         String myProperty = "5000";
 
 
-        hzProperties.put(JDBC_URL, jdbcUrl);
-        hzProperties.put(USER, user);
-        hzProperties.put(PASSWORD, password);
-        hzProperties.put("myProperty", myProperty);
+        hzProperties.setProperty(JDBC_URL, jdbcUrl);
+        hzProperties.setProperty(USER, user);
+        hzProperties.setProperty(PASSWORD, password);
+        hzProperties.setProperty("myProperty", myProperty);
 
 
         Properties driverManagerProperties = translate(hzProperties);
diff --git a/hazelcast/src/test/java/com/hazelcast/dataconnection/impl/jdbcproperties/HikariTranslatorTest.java b/hazelcast/src/test/java/com/hazelcast/dataconnection/impl/jdbcproperties/HikariTranslatorTest.java
index 2311f492c5b7..68872d73097f 100644
--- a/hazelcast/src/test/java/com/hazelcast/dataconnection/impl/jdbcproperties/HikariTranslatorTest.java
+++ b/hazelcast/src/test/java/com/hazelcast/dataconnection/impl/jdbcproperties/HikariTranslatorTest.java
@@ -45,13 +45,13 @@ public void testTranslatableProperties() {
         String minimumIdle = "8500";
         String maximumPoolSize = "10";
 
-        hzProperties.put(DataConnectionProperties.JDBC_URL, jdbcUrl);
-        hzProperties.put(DataConnectionProperties.CONNECTION_TIMEOUT, connectionTimeout);
-        hzProperties.put(DataConnectionProperties.IDLE_TIMEOUT, idleTimeout);
-        hzProperties.put(DataConnectionProperties.KEEP_ALIVE_TIME, keepAliveTime);
-        hzProperties.put(DataConnectionProperties.MAX_LIFETIME, maxLifetime);
-        hzProperties.put(DataConnectionProperties.MINIMUM_IDLE, minimumIdle);
-        hzProperties.put(DataConnectionProperties.MAXIMUM_POOL_SIZE, maximumPoolSize);
+        hzProperties.setProperty(DataConnectionProperties.JDBC_URL, jdbcUrl);
+        hzProperties.setProperty(DataConnectionProperties.CONNECTION_TIMEOUT, connectionTimeout);
+        hzProperties.setProperty(DataConnectionProperties.IDLE_TIMEOUT, idleTimeout);
+        hzProperties.setProperty(DataConnectionProperties.KEEP_ALIVE_TIME, keepAliveTime);
+        hzProperties.setProperty(DataConnectionProperties.MAX_LIFETIME, maxLifetime);
+        hzProperties.setProperty(DataConnectionProperties.MINIMUM_IDLE, minimumIdle);
+        hzProperties.setProperty(DataConnectionProperties.MAXIMUM_POOL_SIZE, maximumPoolSize);
 
         Properties hikariProperties = hikariTranslator.translate(hzProperties);
         HikariConfig hikariConfig = new HikariConfig(hikariProperties);
diff --git a/hazelcast/src/test/java/com/hazelcast/instance/impl/KubernetesTopologyIntentTrackerTest.java b/hazelcast/src/test/java/com/hazelcast/instance/impl/KubernetesTopologyIntentTrackerTest.java
index 552705546171..b174a3b0e21a 100644
--- a/hazelcast/src/test/java/com/hazelcast/instance/impl/KubernetesTopologyIntentTrackerTest.java
+++ b/hazelcast/src/test/java/com/hazelcast/instance/impl/KubernetesTopologyIntentTrackerTest.java
@@ -53,7 +53,7 @@ public class KubernetesTopologyIntentTrackerTest {
 
     private Node setupMockNode() {
         Node node = mock(Node.class);
-        properties.put(ClusterProperty.CLUSTER_SHUTDOWN_TIMEOUT_SECONDS.getName(), "2");
+        properties.setProperty(ClusterProperty.CLUSTER_SHUTDOWN_TIMEOUT_SECONDS.getName(), "2");
         HazelcastProperties hazelcastProperties = new HazelcastProperties(properties);
         when(node.getProperties()).thenReturn(hazelcastProperties);
         when(node.getLogger(ArgumentMatchers.any(Class.class)))
@@ -64,14 +64,14 @@ private Node setupMockNode() {
 
     @Test
     public void testConstructor_whenClusterAutoStateStrategyActive() {
-        properties.put(ClusterProperty.PERSISTENCE_AUTO_CLUSTER_STATE_STRATEGY.getName(), "ACTIVE");
+        properties.setProperty(ClusterProperty.PERSISTENCE_AUTO_CLUSTER_STATE_STRATEGY.getName(), "ACTIVE");
         assertThrows(InvalidConfigurationException.class,
                 () -> new KubernetesTopologyIntentTracker(setupMockNode()));
     }
 
     @Test
     public void testConstructor_whenInvalidClusterAutoStateStrategy() {
-        properties.put(ClusterProperty.PERSISTENCE_AUTO_CLUSTER_STATE_STRATEGY.getName(), "NOT_A_CLUSTER_STATE");
+        properties.setProperty(ClusterProperty.PERSISTENCE_AUTO_CLUSTER_STATE_STRATEGY.getName(), "NOT_A_CLUSTER_STATE");
         assertThrows(IllegalArgumentException.class,
                 () -> new KubernetesTopologyIntentTracker(setupMockNode()));
     }
diff --git a/hazelcast/src/test/java/com/hazelcast/internal/config/override/ExternalMemberConfigurationOverrideEnvTest.java b/hazelcast/src/test/java/com/hazelcast/internal/config/override/ExternalMemberConfigurationOverrideEnvTest.java
index 757c8f2242d2..a75d1a50d017 100644
--- a/hazelcast/src/test/java/com/hazelcast/internal/config/override/ExternalMemberConfigurationOverrideEnvTest.java
+++ b/hazelcast/src/test/java/com/hazelcast/internal/config/override/ExternalMemberConfigurationOverrideEnvTest.java
@@ -750,7 +750,7 @@ public void shouldDisallowConflictingEntries() throws Exception {
         Map envVariables = new HashMap<>();
         envVariables.put("HZ_CLUSTERNAME", "test");
         Properties systemProperties = new Properties();
-        systemProperties.put("hz.cluster-name", "test2");
+        systemProperties.setProperty("hz.cluster-name", "test2");
         Config config = new Config();
         assertThatExceptionOfType(InvalidConfigurationException.class)
                 .isThrownBy(() ->
diff --git a/hazelcast/src/test/java/com/hazelcast/internal/config/override/ExternalMemberConfigurationOverrideSystemPropertiesTest.java b/hazelcast/src/test/java/com/hazelcast/internal/config/override/ExternalMemberConfigurationOverrideSystemPropertiesTest.java
index 7a3725ff5545..ee7ceb11b109 100644
--- a/hazelcast/src/test/java/com/hazelcast/internal/config/override/ExternalMemberConfigurationOverrideSystemPropertiesTest.java
+++ b/hazelcast/src/test/java/com/hazelcast/internal/config/override/ExternalMemberConfigurationOverrideSystemPropertiesTest.java
@@ -46,9 +46,9 @@ public class ExternalMemberConfigurationOverrideSystemPropertiesTest extends Haz
     public void shouldExtractConfigFromSysProperties() {
         Config config = new Config();
         Properties systemProperties = new Properties();
-        systemProperties.put("hz.cluster-name", "test");
-        systemProperties.put("hz.network.join.autodetection.enabled", "false");
-        systemProperties.put("hz.executor-service.custom.pool-size", "42");
+        systemProperties.setProperty("hz.cluster-name", "test");
+        systemProperties.setProperty("hz.network.join.autodetection.enabled", "false");
+        systemProperties.setProperty("hz.executor-service.custom.pool-size", "42");
         new ExternalConfigurationOverride(EMPTY_ENV_VARIABLES, () -> systemProperties).overwriteMemberConfig(config);
 
         assertEquals("test", config.getClusterName());
@@ -60,9 +60,9 @@ public void shouldExtractConfigFromSysProperties() {
     public void shouldHandleRestApiConfigFromSysProperties() {
         Config config = new Config();
         Properties systemProperties = new Properties();
-        systemProperties.put("hz.network.rest-api.enabled", "true");
-        systemProperties.put("hz.network.rest-api.endpoint-groups.DATA.enabled", "true");
-        systemProperties.put("hz.network.rest-api.endpoint-groups.hot_restart.enabled", "true");
+        systemProperties.setProperty("hz.network.rest-api.enabled", "true");
+        systemProperties.setProperty("hz.network.rest-api.endpoint-groups.DATA.enabled", "true");
+        systemProperties.setProperty("hz.network.rest-api.endpoint-groups.hot_restart.enabled", "true");
 
         new ExternalConfigurationOverride(EMPTY_ENV_VARIABLES, () -> systemProperties).overwriteMemberConfig(config);
 
@@ -75,9 +75,9 @@ public void shouldHandleRestApiConfigFromSysProperties() {
     public void shouldHandleRestApiConfigFromSysProperties_whenPersistenceEnabled() {
         Config config = new Config();
         Properties systemProperties = new Properties();
-        systemProperties.put("hz.network.rest-api.enabled", "true");
-        systemProperties.put("hz.network.rest-api.endpoint-groups.DATA.enabled", "true");
-        systemProperties.put("hz.network.rest-api.endpoint-groups.persistence.enabled", "true");
+        systemProperties.setProperty("hz.network.rest-api.enabled", "true");
+        systemProperties.setProperty("hz.network.rest-api.endpoint-groups.DATA.enabled", "true");
+        systemProperties.setProperty("hz.network.rest-api.endpoint-groups.persistence.enabled", "true");
 
         new ExternalConfigurationOverride(EMPTY_ENV_VARIABLES, () -> systemProperties).overwriteMemberConfig(config);
 
@@ -90,10 +90,10 @@ public void shouldHandleRestApiConfigFromSysProperties_whenPersistenceEnabled()
     public void shouldHandleRestApiConfigFromSysProperties_when_bothPersistenceAndHotRestartAreEnabled() {
         Config config = new Config();
         Properties systemProperties = new Properties();
-        systemProperties.put("hz.network.rest-api.enabled", "true");
-        systemProperties.put("hz.network.rest-api.endpoint-groups.DATA.enabled", "true");
-        systemProperties.put("hz.network.rest-api.endpoint-groups.hot_restart.enabled", "true");
-        systemProperties.put("hz.network.rest-api.endpoint-groups.persistence.enabled", "true");
+        systemProperties.setProperty("hz.network.rest-api.enabled", "true");
+        systemProperties.setProperty("hz.network.rest-api.endpoint-groups.DATA.enabled", "true");
+        systemProperties.setProperty("hz.network.rest-api.endpoint-groups.hot_restart.enabled", "true");
+        systemProperties.setProperty("hz.network.rest-api.endpoint-groups.persistence.enabled", "true");
 
         new ExternalConfigurationOverride(EMPTY_ENV_VARIABLES, () -> systemProperties).overwriteMemberConfig(config);
 
@@ -106,9 +106,9 @@ public void shouldHandleRestApiConfigFromSysProperties_when_bothPersistenceAndHo
     public void shouldHandleRestApiConfigFromSysPropertiesInvalidEntry() {
         Config config = new Config();
         Properties systemProperties = new Properties();
-        systemProperties.put("hz.network.rest-api.enabled", "true");
-        systemProperties.put("hz.network.rest-api.endpoint-groups.fooo.enabled", "true");
-        systemProperties.put("hz.network.rest-api.endpoint-groups.HOT_RESTART.enabled", "true");
+        systemProperties.setProperty("hz.network.rest-api.enabled", "true");
+        systemProperties.setProperty("hz.network.rest-api.endpoint-groups.fooo.enabled", "true");
+        systemProperties.setProperty("hz.network.rest-api.endpoint-groups.HOT_RESTART.enabled", "true");
 
         new ExternalConfigurationOverride(EMPTY_ENV_VARIABLES, () -> systemProperties).overwriteMemberConfig(config);
     }
diff --git a/hazelcast/src/test/java/com/hazelcast/internal/config/override/SystemPropertiesConfigProviderTest.java b/hazelcast/src/test/java/com/hazelcast/internal/config/override/SystemPropertiesConfigProviderTest.java
index eb5f8c1df4b2..5a74458655b1 100644
--- a/hazelcast/src/test/java/com/hazelcast/internal/config/override/SystemPropertiesConfigProviderTest.java
+++ b/hazelcast/src/test/java/com/hazelcast/internal/config/override/SystemPropertiesConfigProviderTest.java
@@ -43,7 +43,7 @@ public void setUp() {
 
     @Test
     public void shouldParseClusternameConfigFromSystemProperties() {
-        systemProperties.put("hz.cluster-name", "testcluster");
+        systemProperties.setProperty("hz.cluster-name", "testcluster");
         assertThat(provider.properties()).containsEntry("hazelcast.cluster-name", "testcluster");
     }
 
diff --git a/hazelcast/src/test/java/com/hazelcast/internal/dynamicconfig/DynamicConfigYamlGeneratorTest.java b/hazelcast/src/test/java/com/hazelcast/internal/dynamicconfig/DynamicConfigYamlGeneratorTest.java
index 24df252e4f92..456b99ab12f6 100644
--- a/hazelcast/src/test/java/com/hazelcast/internal/dynamicconfig/DynamicConfigYamlGeneratorTest.java
+++ b/hazelcast/src/test/java/com/hazelcast/internal/dynamicconfig/DynamicConfigYamlGeneratorTest.java
@@ -533,7 +533,7 @@ public void testDataConnectionConfig() {
         Config expectedConfig = new Config();
 
         Properties properties = new Properties();
-        properties.put("jdbcUrl", "jdbc:h2:mem:" + DynamicConfigYamlGeneratorTest.class.getSimpleName());
+        properties.setProperty("jdbcUrl", "jdbc:h2:mem:" + DynamicConfigYamlGeneratorTest.class.getSimpleName());
         DataConnectionConfig dataConnectionConfig = new DataConnectionConfig()
                 .setName("test-data-connection")
                 .setType("jdbc")
diff --git a/hazelcast/src/test/java/com/hazelcast/jet/impl/connector/MySQLReadJdbcPPropertiesTest.java b/hazelcast/src/test/java/com/hazelcast/jet/impl/connector/MySQLReadJdbcPPropertiesTest.java
index 0b0460816579..65eeb494e3c7 100644
--- a/hazelcast/src/test/java/com/hazelcast/jet/impl/connector/MySQLReadJdbcPPropertiesTest.java
+++ b/hazelcast/src/test/java/com/hazelcast/jet/impl/connector/MySQLReadJdbcPPropertiesTest.java
@@ -38,14 +38,14 @@ public static void beforeClass() throws SQLException {
     public void testFetchSize() {
         int fetchSize = 2;
         Properties properties = new Properties();
-        properties.put(JdbcPropertyKeys.FETCH_SIZE, String.valueOf(fetchSize));
+        properties.setProperty(JdbcPropertyKeys.FETCH_SIZE, String.valueOf(fetchSize));
         runTestFetchSize(properties, fetchSize);
     }
 
     @Test
     public void testInvalidFetchSize() {
         Properties properties = new Properties();
-        properties.put(JdbcPropertyKeys.FETCH_SIZE, "aa");
+        properties.setProperty(JdbcPropertyKeys.FETCH_SIZE, "aa");
         assertThatThrownBy(() -> runTest(properties))
                 .hasRootCauseInstanceOf(NumberFormatException.class);
     }
diff --git a/hazelcast/src/test/java/com/hazelcast/jet/impl/connector/PostgreReadJdbcPPropertiesTest.java b/hazelcast/src/test/java/com/hazelcast/jet/impl/connector/PostgreReadJdbcPPropertiesTest.java
index 23bc4b76fa5e..dd2993184839 100644
--- a/hazelcast/src/test/java/com/hazelcast/jet/impl/connector/PostgreReadJdbcPPropertiesTest.java
+++ b/hazelcast/src/test/java/com/hazelcast/jet/impl/connector/PostgreReadJdbcPPropertiesTest.java
@@ -37,8 +37,8 @@ public static void beforeClass() throws SQLException {
     public void testFetchSize() {
         int fetchSize = 2;
         Properties properties = new Properties();
-        properties.put(JdbcPropertyKeys.FETCH_SIZE, String.valueOf(fetchSize));
-        properties.put(JdbcPropertyKeys.AUTO_COMMIT, "false");
+        properties.setProperty(JdbcPropertyKeys.FETCH_SIZE, String.valueOf(fetchSize));
+        properties.setProperty(JdbcPropertyKeys.AUTO_COMMIT, "false");
         runTestFetchSize(properties, fetchSize);
     }
 
@@ -46,7 +46,7 @@ public void testFetchSize() {
     public void testInvalidFetchSize() {
         Properties properties = new Properties();
         // FETCH_SIZE should be a number in string format
-        properties.put(JdbcPropertyKeys.FETCH_SIZE, "aa");
+        properties.setProperty(JdbcPropertyKeys.FETCH_SIZE, "aa");
         assertThatThrownBy(() -> runTest(properties))
                 .hasRootCauseInstanceOf(NumberFormatException.class);
     }
@@ -55,7 +55,7 @@ public void testInvalidFetchSize() {
     public void testInvalidAutoCommit() {
         Properties properties = new Properties();
         // AUTO_COMMIT should be a boolean in string format
-        properties.put(JdbcPropertyKeys.AUTO_COMMIT, "1");
+        properties.setProperty(JdbcPropertyKeys.AUTO_COMMIT, "1");
         assertThatThrownBy(() -> runTest(properties))
                 .hasRootCauseInstanceOf(IllegalArgumentException.class);
     }