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:17:21 UTC
svn commit: r1446120 - in /camel/branches/camel-2.10.x: ./
components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
Author: davsclaus
Date: Thu Feb 14 11:17:21 2013
New Revision: 1446120
URL: http://svn.apache.org/r1446120
Log:
CAMEL-6053: Fixed so the code can compile on both java6 and 7 with the Felix stuff
Modified:
camel/branches/camel-2.10.x/ (props changed)
camel/branches/camel-2.10.x/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Merged /camel/trunk:r1446119
Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: camel/branches/camel-2.10.x/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java?rev=1446120&r1=1446119&r2=1446120&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java (original)
+++ camel/branches/camel-2.10.x/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java Thu Feb 14 11:17:21 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);