You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2019/11/16 05:14:28 UTC

[karaf] branch karaf-4.2.x updated: [KARAF-6519] Use backward compatiable operation signatures in ConfigMBean

This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch karaf-4.2.x
in repository https://gitbox.apache.org/repos/asf/karaf.git


The following commit(s) were added to refs/heads/karaf-4.2.x by this push:
     new 507e474  [KARAF-6519] Use backward compatiable operation signatures in ConfigMBean
507e474 is described below

commit 507e4748449d64a338df3c999fcb5de4dadb72ab
Author: Jean-Baptiste Onofré <jb...@apache.org>
AuthorDate: Sat Nov 16 06:13:44 2019 +0100

    [KARAF-6519] Use backward compatiable operation signatures in ConfigMBean
---
 .../src/main/java/org/apache/karaf/config/core/ConfigMBean.java   | 4 ++--
 .../java/org/apache/karaf/config/core/impl/ConfigMBeanImpl.java   | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/config/src/main/java/org/apache/karaf/config/core/ConfigMBean.java b/config/src/main/java/org/apache/karaf/config/core/ConfigMBean.java
index 0730116..213c1a1 100644
--- a/config/src/main/java/org/apache/karaf/config/core/ConfigMBean.java
+++ b/config/src/main/java/org/apache/karaf/config/core/ConfigMBean.java
@@ -119,7 +119,7 @@ public interface ConfigMBean {
      * @param properties the new properties to set in the configuration.
      * @throws MBeanException in case of MBean failure.
      */
-    void update(String pid, Map<String, Object> properties) throws MBeanException;
+    void update(String pid, Map<String, String> properties) throws MBeanException;
 
     /**
      * Add new properties or update existing ones (without removing others) in a given configuration.
@@ -128,7 +128,7 @@ public interface ConfigMBean {
      * @param properties the properties to add/update.
      * @throws MBeanException in case of MBean failure.
      */
-    void append(String pid, Map<String, Object> properties) throws MBeanException;
+    void append(String pid, Map<String, String> properties) throws MBeanException;
 
     /**
      * Delete properties from a configuration.
diff --git a/config/src/main/java/org/apache/karaf/config/core/impl/ConfigMBeanImpl.java b/config/src/main/java/org/apache/karaf/config/core/impl/ConfigMBeanImpl.java
index 29355c1..81e1fed 100644
--- a/config/src/main/java/org/apache/karaf/config/core/impl/ConfigMBeanImpl.java
+++ b/config/src/main/java/org/apache/karaf/config/core/impl/ConfigMBeanImpl.java
@@ -213,10 +213,10 @@ public class ConfigMBeanImpl extends StandardMBean implements ConfigMBean {
     }
 
     @Override
-    public void update(String pid, Map<String, Object> properties) throws MBeanException {
+    public void update(String pid, Map<String, String> properties) throws MBeanException {
         try {
-            TypedProperties props = configRepo.getConfig(pid);
-            props.update(properties);
+            TypedProperties props = new TypedProperties();
+            props.putAll(properties);
             configRepo.update(pid, props);
         } catch (Exception e) {
             throw new MBeanException(null, e.toString());
@@ -224,7 +224,7 @@ public class ConfigMBeanImpl extends StandardMBean implements ConfigMBean {
     }
 
     @Override
-    public void append(String pid, Map<String, Object> properties) throws MBeanException {
+    public void append(String pid, Map<String, String> properties) throws MBeanException {
         try {
             TypedProperties props = configRepo.getConfig(pid);
             props.putAll(properties);