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

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit cdb443824ac81d392b17ee6225bb8ab39f6a80db
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Sun Jun 16 17:26:54 2019 +0200

    CAMEL-13650: Properties component - loadProperties to return properties in 
order
---
 .../spi/BridgePropertyPlaceholderConfigurer.java    |  2 +-
 .../org/apache/camel/util/OrderedProperties.java    | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-spring/src/main/java/org/apache/camel/spring/spi/BridgePropertyPlaceholderConfigurer.java
 
b/components/camel-spring/src/main/java/org/apache/camel/spring/spi/BridgePropertyPlaceholderConfigurer.java
index 0a9d357..84fbedb 100644
--- 
a/components/camel-spring/src/main/java/org/apache/camel/spring/spi/BridgePropertyPlaceholderConfigurer.java
+++ 
b/components/camel-spring/src/main/java/org/apache/camel/spring/spi/BridgePropertyPlaceholderConfigurer.java
@@ -236,7 +236,7 @@ public class BridgePropertyPlaceholderConfigurer extends 
PropertyPlaceholderConf
                 propVal = resolveSystemProperty(placeholderName);
             }
             if (propVal == null) {
-                propVal = (String) properties.get(placeholderName);
+                propVal = properties.getProperty(placeholderName);
             }
             if (propVal == null && systemPropertiesMode == 
SYSTEM_PROPERTIES_MODE_FALLBACK) {
                 propVal = resolveSystemProperty(placeholderName);
diff --git 
a/core/camel-util/src/main/java/org/apache/camel/util/OrderedProperties.java 
b/core/camel-util/src/main/java/org/apache/camel/util/OrderedProperties.java
index a793ec4..861e147 100644
--- a/core/camel-util/src/main/java/org/apache/camel/util/OrderedProperties.java
+++ b/core/camel-util/src/main/java/org/apache/camel/util/OrderedProperties.java
@@ -31,6 +31,7 @@ import java.util.Vector;
  * <p/>
  * Note: This implementation is only intended as implementation detail for the 
Camel properties component, and has only
  * been designed to provide the needed functionality.
+ * The complex logic for loading properties has been kept from the JDK {@link 
Properties} class.
  */
 public final class OrderedProperties extends Properties {
 
@@ -45,6 +46,26 @@ public final class OrderedProperties extends Properties {
     }
 
     @Override
+    public synchronized Object get(Object key) {
+        return map.get(key);
+    }
+
+    @Override
+    public synchronized boolean isEmpty() {
+        return map.isEmpty();
+    }
+
+    @Override
+    public synchronized Object remove(Object key) {
+        return map.remove(key);
+    }
+
+    @Override
+    public synchronized void clear() {
+        map.clear();
+    }
+
+    @Override
     public String getProperty(String key) {
         return map.get(key);
     }

Reply via email to