Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkuppe2008-10-25 12:58:37 -0400
committermkuppe2008-10-25 12:58:37 -0400
commitd747b6f0a365b2ad513e304270c4281b18bfc9cf (patch)
tree747a353078cb385e94f19c5126d1ae826db6fc88
parentb1517092c3cc70d2db45ca051bed877f73790460 (diff)
downloadorg.eclipse.ecf-d747b6f0a365b2ad513e304270c4281b18bfc9cf.tar.gz
org.eclipse.ecf-d747b6f0a365b2ad513e304270c4281b18bfc9cf.tar.xz
org.eclipse.ecf-d747b6f0a365b2ad513e304270c4281b18bfc9cf.zip
NEW - bug 252093: [Discovery][Composite] Composite doesn't throw Exception on second connect
https://bugs.eclipse.org/bugs/show_bug.cgi?id=252093
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeNamespace.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeNamespace.java b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeNamespace.java
index f89619e19..4867cafb3 100644
--- a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeNamespace.java
+++ b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeNamespace.java
@@ -11,6 +11,7 @@
package org.eclipse.ecf.internal.provider.discovery;
import org.eclipse.ecf.core.identity.*;
+import org.eclipse.ecf.discovery.identity.IServiceTypeID;
import org.eclipse.ecf.discovery.identity.ServiceTypeID;
public class CompositeNamespace extends Namespace {
@@ -22,7 +23,15 @@ public class CompositeNamespace extends Namespace {
* @see org.eclipse.ecf.core.identity.Namespace#createInstance(java.lang.Object[])
*/
public ID createInstance(Object[] parameters) throws IDCreateException {
- return new CompositeServiceID(this, new ServiceTypeID(this, (String) parameters[0]), (String) parameters[1]);
+ if (parameters == null || parameters.length < 1 || parameters.length > 2) {
+ throw new IDCreateException(Messages.CompositeNamespace_WrongParameterCount);
+ } else if (parameters[0] instanceof String) {
+ return new CompositeServiceID(this, new ServiceTypeID(this, (String) parameters[0]), (String) parameters[1]);
+ } else if (parameters[0] instanceof IServiceTypeID) {
+ return new CompositeServiceID(this, (IServiceTypeID) parameters[0], (String) parameters[1]);
+ } else {
+ throw new IDCreateException(Messages.CompositeNamespace_WrongParameters);
+ }
}
/* (non-Javadoc)

Back to the top