Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBJ Hargrave2006-04-08 20:41:22 +0000
committerBJ Hargrave2006-04-08 20:41:22 +0000
commit5f44c37ebb9f35984ad385eae1719ff2c9953227 (patch)
treed4d70b460ad8259e3b14fe45dcf1f29e6d800238
parentf9d15fd3fcd624255fb8524e30b37918dbe0b921 (diff)
downloadrt.equinox.bundles-5f44c37ebb9f35984ad385eae1719ff2c9953227.tar.gz
rt.equinox.bundles-5f44c37ebb9f35984ad385eae1719ff2c9953227.tar.xz
rt.equinox.bundles-5f44c37ebb9f35984ad385eae1719ff2c9953227.zip
Bug 131194: allows null to be passed for additional properties to newInstance
-rw-r--r--bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/ds/service/ComponentFactoryImpl.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/ds/service/ComponentFactoryImpl.java b/bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/ds/service/ComponentFactoryImpl.java
index 62f54e080..6580f738b 100644
--- a/bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/ds/service/ComponentFactoryImpl.java
+++ b/bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/ds/service/ComponentFactoryImpl.java
@@ -21,7 +21,7 @@ import org.osgi.service.component.*;
* register a ComponentFactory service to allow new component configurations
* to be created and activated.
*
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class ComponentFactoryImpl implements ComponentFactory {
@@ -57,11 +57,14 @@ public class ComponentFactoryImpl implements ComponentFactory {
public ComponentInstance newInstance(Dictionary newProperties) {
// merge properties
- Hashtable properties = (Hashtable) cdp.getProperties().clone();
- Enumeration propsEnum = newProperties.keys();
- while (propsEnum.hasMoreElements()) {
- Object key = propsEnum.nextElement();
- properties.put(key, newProperties.get(key));
+ Hashtable properties = cdp.getProperties();
+ if (newProperties != null) {
+ properties = (Hashtable) properties.clone();
+ Enumeration propsEnum = newProperties.keys();
+ while (propsEnum.hasMoreElements()) {
+ Object key = propsEnum.nextElement();
+ properties.put(key, newProperties.get(key));
+ }
}
// create a new cdp (adds to resolver enabledCDPs list)

Back to the top