Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkchan2005-06-22 15:23:56 +0000
committerkchan2005-06-22 15:23:56 +0000
commit91a0cda27ef3376ea6a912fd994e7d72f691efc6 (patch)
tree42f3b92abe6fd99cce84e4def6da2c280d2ae84d /bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse
parent7de7895d1c52ad966ca365de2b53a59f956e3f99 (diff)
downloadwebtools.webservices-91a0cda27ef3376ea6a912fd994e7d72f691efc6.tar.gz
webtools.webservices-91a0cda27ef3376ea6a912fd994e7d72f691efc6.tar.xz
webtools.webservices-91a0cda27ef3376ea6a912fd994e7d72f691efc6.zip
[101019] Check for null service types and client types
Diffstat (limited to 'bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse')
-rw-r--r--bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsrt/WebServiceRuntimeExtensionRegistry.java78
-rw-r--r--bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsrt/WebServiceRuntimeExtensionUtils.java89
2 files changed, 94 insertions, 73 deletions
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsrt/WebServiceRuntimeExtensionRegistry.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsrt/WebServiceRuntimeExtensionRegistry.java
index 2a6aa7bb4..3bbef1630 100644
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsrt/WebServiceRuntimeExtensionRegistry.java
+++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsrt/WebServiceRuntimeExtensionRegistry.java
@@ -171,58 +171,64 @@ public class WebServiceRuntimeExtensionRegistry
private void updateWebServiceTypeList(WebServiceRuntimeInfo wsrtInfo)
{
ServiceType[] sts = wsrtInfo.getServiceTypes();
- for (int j=0; j<sts.length; j++)
+ if (sts != null)
{
- String implId = sts[j].getWebServiceImpl().getId();
- String[] bus = sts[j].getBottomUpModuleTypesInclude();
- String[] tds = sts[j].getTopDownModuleTypesInclude();
- if (bus != null)
+ for (int j = 0; j < sts.length; j++)
{
- StringBuffer entrybuff = new StringBuffer();
- entrybuff.append(String.valueOf(WebServiceScenario.BOTTOMUP));
- entrybuff.append("/");
- entrybuff.append(implId);
- String entry = entrybuff.toString();
- if (!webServiceTypesList_.contains(entry))
+ String implId = sts[j].getWebServiceImpl().getId();
+ String[] bus = sts[j].getBottomUpModuleTypesInclude();
+ String[] tds = sts[j].getTopDownModuleTypesInclude();
+ if (bus != null)
{
- webServiceTypesList_.add(entry);
+ StringBuffer entrybuff = new StringBuffer();
+ entrybuff.append(String.valueOf(WebServiceScenario.BOTTOMUP));
+ entrybuff.append("/");
+ entrybuff.append(implId);
+ String entry = entrybuff.toString();
+ if (!webServiceTypesList_.contains(entry))
+ {
+ webServiceTypesList_.add(entry);
+ }
}
- }
- if (tds != null)
- {
- StringBuffer entrybuff = new StringBuffer();
- entrybuff.append(String.valueOf(WebServiceScenario.TOPDOWN));
- entrybuff.append("/");
- entrybuff.append(implId);
- String entry = entrybuff.toString();
- if (!webServiceTypesList_.contains(entry))
+ if (tds != null)
{
- webServiceTypesList_.add(entry);
+ StringBuffer entrybuff = new StringBuffer();
+ entrybuff.append(String.valueOf(WebServiceScenario.TOPDOWN));
+ entrybuff.append("/");
+ entrybuff.append(implId);
+ String entry = entrybuff.toString();
+ if (!webServiceTypesList_.contains(entry))
+ {
+ webServiceTypesList_.add(entry);
+ }
}
- }
- }
+ }
+ }
}
private void updateWebServiceClientTypeList(WebServiceRuntimeInfo wsrtInfo)
{
ClientType[] cts = wsrtInfo.getClientTypes();
- for (int j=0; j<cts.length; j++)
+ if (cts != null)
{
- String implId = cts[j].getWebServiceClientImpl().getId();
- String[] mods = cts[j].getModuleTypesInclude();
- if (mods != null)
+ for (int j = 0; j < cts.length; j++)
{
- StringBuffer entrybuff = new StringBuffer();
- entrybuff.append(String.valueOf(WebServiceScenario.CLIENT));
- entrybuff.append("/");
- entrybuff.append(implId);
- String entry = entrybuff.toString();
- if (!webServiceClientTypesList_.contains(entry))
+ String implId = cts[j].getWebServiceClientImpl().getId();
+ String[] mods = cts[j].getModuleTypesInclude();
+ if (mods != null)
{
- webServiceClientTypesList_.add(entry);
+ StringBuffer entrybuff = new StringBuffer();
+ entrybuff.append(String.valueOf(WebServiceScenario.CLIENT));
+ entrybuff.append("/");
+ entrybuff.append(implId);
+ String entry = entrybuff.toString();
+ if (!webServiceClientTypesList_.contains(entry))
+ {
+ webServiceClientTypesList_.add(entry);
+ }
}
}
- }
+ }
}
}
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsrt/WebServiceRuntimeExtensionUtils.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsrt/WebServiceRuntimeExtensionUtils.java
index e98b215f5..5443ca9ea 100644
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsrt/WebServiceRuntimeExtensionUtils.java
+++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/wsrt/WebServiceRuntimeExtensionUtils.java
@@ -91,18 +91,21 @@ public class WebServiceRuntimeExtensionUtils
String implId = getImplIdFromTypeId(typeId);
//Return the first service type that supports the impl and scenario
ServiceType[] sts = wsrt.getServiceTypes();
- for (int i=0; i<sts.length; i++)
+ if (sts != null)
{
- String thisImplId = sts[i].getWebServiceImpl().getId();
- if (implId.equals(thisImplId))
+ for (int i = 0; i < sts.length; i++)
{
- //Check if scenario is supported
- if (sts[i].supportsScenario(scenario))
+ String thisImplId = sts[i].getWebServiceImpl().getId();
+ if (implId.equals(thisImplId))
{
- return sts[i];
- }
+ // Check if scenario is supported
+ if (sts[i].supportsScenario(scenario))
+ {
+ return sts[i];
+ }
+ }
}
- }
+ }
}
return null;
@@ -148,18 +151,21 @@ public class WebServiceRuntimeExtensionUtils
{
WebServiceRuntimeInfo wsr = (WebServiceRuntimeInfo)iter.next();
ServiceType[] sts = wsr.getServiceTypes();
- for (int i=0; i<sts.length; i++)
+ if (sts != null)
{
- String thisImplId = sts[i].getWebServiceImpl().getId();
- if (implId.equals(thisImplId))
+ for (int i = 0; i < sts.length; i++)
{
- //Check if scenario is supported
- if (sts[i].supportsScenario(scenario))
+ String thisImplId = sts[i].getWebServiceImpl().getId();
+ if (implId.equals(thisImplId))
{
- ids.add(wsr.getId());
- break;
- }
- }
+ // Check if scenario is supported
+ if (sts[i].supportsScenario(scenario))
+ {
+ ids.add(wsr.getId());
+ break;
+ }
+ }
+ }
}
}
@@ -626,14 +632,17 @@ public class WebServiceRuntimeExtensionUtils
{
WebServiceRuntimeInfo wsr = (WebServiceRuntimeInfo)iter.next();
ClientType[] cts = wsr.getClientTypes();
- for (int i=0; i<cts.length; i++)
+ if (cts != null)
{
- String wsClientImplId = cts[i].getWebServiceClientImpl().getId();
- if (wsClientImplId.equals(clientImplId))
+ for (int i = 0; i < cts.length; i++)
{
- ids.add(wsr.getId());
- break;
- }
+ String wsClientImplId = cts[i].getWebServiceClientImpl().getId();
+ if (wsClientImplId.equals(clientImplId))
+ {
+ ids.add(wsr.getId());
+ break;
+ }
+ }
}
}
@@ -749,15 +758,18 @@ public class WebServiceRuntimeExtensionUtils
if (runtimeId.equals(rIds[i]))
{
ClientType[] cts = getWebServiceRuntimeById(rIds[i]).getClientTypes();
- for (int j=0; j<cts.length; j++)
+ if (cts != null)
{
- String thisClientImplId = cts[j].getWebServiceClientImpl().getId();
- if (clientImplId.equals(thisClientImplId))
+ for (int j = 0; j < cts.length; j++)
{
- //Found the one!
- String[] projectTypes = cts[j].getModuleTypesInclude();
- return projectTypes;
- }
+ String thisClientImplId = cts[j].getWebServiceClientImpl().getId();
+ if (clientImplId.equals(thisClientImplId))
+ {
+ // Found the one!
+ String[] projectTypes = cts[j].getModuleTypesInclude();
+ return projectTypes;
+ }
+ }
}
}
}
@@ -804,15 +816,18 @@ public class WebServiceRuntimeExtensionUtils
{
WebServiceRuntimeInfo wsrt = getWebServiceRuntimeById(rIds[i]);
ClientType[] cts = wsrt.getClientTypes();
- for (int j = 0; j < cts.length; j++)
+ if (cts != null)
{
- ClientType ct = cts[j];
- //String id = ct.getWebServiceClientTypeId();
- String id = ct.getWebServiceClientImpl().getId();
- if (!ids.contains(id))
+ for (int j = 0; j < cts.length; j++)
{
- ids.add(id);
- labels.add(ct.getWebServiceClientImpl().getLabel());
+ ClientType ct = cts[j];
+ // String id = ct.getWebServiceClientTypeId();
+ String id = ct.getWebServiceClientImpl().getId();
+ if (!ids.contains(id))
+ {
+ ids.add(id);
+ labels.add(ct.getWebServiceClientImpl().getLabel());
+ }
}
}

Back to the top