Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2008-05-14 01:55:01 -0400
committerslewis2008-05-14 01:55:01 -0400
commitcf2480393309a8e7707a4beb824755d35b314d06 (patch)
tree818f07554adecfcd622674ddbabd8c1acf93c24b
parent3695f8197e14acee7a609a85954758d3ad221d75 (diff)
downloadorg.eclipse.ecf-cf2480393309a8e7707a4beb824755d35b314d06.tar.gz
org.eclipse.ecf-cf2480393309a8e7707a4beb824755d35b314d06.tar.xz
org.eclipse.ecf-cf2480393309a8e7707a4beb824755d35b314d06.zip
Fix for 231969
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.jslp/src/org/eclipse/ecf/provider/jslp/identity/JSLPNamespace.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.jslp/src/org/eclipse/ecf/provider/jslp/identity/JSLPNamespace.java b/providers/bundles/org.eclipse.ecf.provider.jslp/src/org/eclipse/ecf/provider/jslp/identity/JSLPNamespace.java
index 35701388f..65f94b319 100644
--- a/providers/bundles/org.eclipse.ecf.provider.jslp/src/org/eclipse/ecf/provider/jslp/identity/JSLPNamespace.java
+++ b/providers/bundles/org.eclipse.ecf.provider.jslp/src/org/eclipse/ecf/provider/jslp/identity/JSLPNamespace.java
@@ -23,6 +23,21 @@ public class JSLPNamespace extends Namespace {
public static final String NAME = "ecf.namespace.slp"; //$NON-NLS-1$
+ private String getInitFromExternalForm(Object[] args) {
+ if (args == null || args.length < 1 || args[0] == null)
+ return null;
+ if (args[0] instanceof String) {
+ String arg = (String) args[0];
+ if (arg.startsWith(getScheme() + Namespace.SCHEME_SEPARATOR)) {
+ int index = arg.indexOf(Namespace.SCHEME_SEPARATOR);
+ if (index >= arg.length())
+ return null;
+ return arg.substring(index + 1);
+ }
+ }
+ return null;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.ecf.core.identity.Namespace#createInstance(java.lang.Object[])
*/
@@ -44,7 +59,8 @@ public class JSLPNamespace extends Namespace {
IServiceTypeID stid = (IServiceTypeID) parameters[0];
return createInstance(new Object[] {stid.getName(), parameters[1]});
} else if (parameters[0] instanceof String) { // creates from either external or internal string
- String type = (String) parameters[0];
+ String init = getInitFromExternalForm(parameters);
+ String type = (init != null) ? init : (String) parameters[0];
IServiceTypeID stid = null;
if (StringUtils.contains(type, "._")) { //$NON-NLS-1$ // converts external to internal
ServiceTypeID aStid = new ServiceTypeID(this, type);

Back to the top