You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2013/02/14 12:15:54 UTC

svn commit: r1446119 - /camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java

Author: davsclaus
Date: Thu Feb 14 11:15:54 2013
New Revision: 1446119

URL: http://svn.apache.org/r1446119
Log:
CAMEL-6053: Fixed so the code can compile on both java6 and 7 with the Felix stuff

Modified:
    camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java

Modified: camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java?rev=1446119&r1=1446118&r2=1446119&view=diff
==============================================================================
--- camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java (original)
+++ camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java Thu Feb 14 11:15:54 2013
@@ -18,8 +18,10 @@ package org.apache.camel.test.blueprint;
 
 import java.io.File;
 import java.util.Dictionary;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.Properties;
+import java.util.Set;
 
 import org.apache.aries.blueprint.compendium.cm.CmPropertyPlaceholder;
 import org.apache.camel.CamelContext;
@@ -69,8 +71,12 @@ public abstract class CamelBlueprintTest
             File load = new File(fileName);
             log.debug("Loading properties from OSGi config admin file: {}", load);
             org.apache.felix.utils.properties.Properties cfg = new org.apache.felix.utils.properties.Properties(load);
-            for (Map.Entry entry : cfg.entrySet()) {
-                props.put(entry.getKey(), entry.getValue());
+            Iterator<String> it = cfg.keySet().iterator();
+            while (it.hasNext()) {
+                String key = it.next();
+                // must force type cast to have code compile with both java6 and 7 with the (org.apache.felix.utils.properties.Properties)
+                String value = (String) cfg.get(key);
+                props.put(key, value);
             }
 
             ConfigurationAdmin configAdmin = getOsgiService(ConfigurationAdmin.class);