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:
authorkchan2007-01-23 02:24:32 +0000
committerkchan2007-01-23 02:24:32 +0000
commit91732f311482706c115cbaac1d226e9f771e90cf (patch)
treebabac0d3aaffde87d7e747429e3036e12aa53a42 /bundles/org.eclipse.jst.ws
parent94dd5d8b129a55c5ee00d73116ac0749c182a12d (diff)
downloadwebtools.webservices-91732f311482706c115cbaac1d226e9f771e90cf.tar.gz
webtools.webservices-91732f311482706c115cbaac1d226e9f771e90cf.tar.xz
webtools.webservices-91732f311482706c115cbaac1d226e9f771e90cf.zip
[159458] Check for null server runtime and runtime type.
Diffstat (limited to 'bundles/org.eclipse.jst.ws')
-rw-r--r--bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/ServerUtils.java65
1 files changed, 43 insertions, 22 deletions
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/ServerUtils.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/ServerUtils.java
index 4c1b8dc52..e079b36b9 100644
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/ServerUtils.java
+++ b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/ServerUtils.java
@@ -12,6 +12,7 @@
* 20060204 124408 rsinha@ca.ibm.com - Rupam Kuehner
* 20060330 124667 kathy@ca.ibm.com - Kathy Chan
* 20061004 159356 kathy@ca.ibm.com - Kathy Chan, Get correct module root URL based on server chosen
+ * 20070119 159458 mahutch@ca.ibm.com - Mark Hutchinson
*******************************************************************************/
package org.eclipse.jst.ws.internal.common;
@@ -433,11 +434,15 @@ public final class ServerUtils {
String serverRuntimeTypeId = serverType.getRuntimeType().getId();
for (int i = 0; i < runtimes.length; i++) {
IRuntime runtime = runtimes[i];
- String thisRuntimeTypeId = runtime.getRuntimeType().getId();
- if (thisRuntimeTypeId.equals(serverRuntimeTypeId) && !runtime.isStub()) {
- //Found an appropriate IRuntime that is not a stub
- nonStubRuntime = runtime;
- break;
+ IRuntimeType runtimeType = runtime.getRuntimeType();
+ if (runtimeType != null)
+ {
+ String thisRuntimeTypeId = runtimeType.getId();
+ if (thisRuntimeTypeId.equals(serverRuntimeTypeId) && !runtime.isStub()) {
+ //Found an appropriate IRuntime that is not a stub
+ nonStubRuntime = runtime;
+ break;
+ }
}
}
@@ -617,9 +622,13 @@ public final class ServerUtils {
List runtimes = Arrays.asList(ServerUtil.getRuntimes(moduleType, stJ2EEVersion));
for (int i = 0; i < runtimes.size(); i++) {
IRuntime runtime = (IRuntime) runtimes.get(i);
- String thisRuntimeTypeId = runtime.getRuntimeType().getId();
- if (thisRuntimeTypeId.equals(serverRuntimeTypeId) && !runtime.isStub()) {
- return runtime.getId();
+ IRuntimeType runtimeType = runtime.getRuntimeType();
+ if (runtimeType != null)
+ {
+ String thisRuntimeTypeId = runtimeType.getId();
+ if (thisRuntimeTypeId.equals(serverRuntimeTypeId) && !runtime.isStub()) {
+ return runtime.getId();
+ }
}
}
@@ -682,9 +691,13 @@ public final class ServerUtils {
List runtimes = Arrays.asList(ServerUtil.getRuntimes(earModuleType, stJ2EEVersion));
for (int i = 0; i < runtimes.size(); i++) {
IRuntime runtime = (IRuntime) runtimes.get(i);
- String thisId = runtime.getRuntimeType().getId();
- if (thisId.equals(runtimeTargetId))
- return true;
+ IRuntimeType runtimeType = runtime.getRuntimeType();
+ if (runtimeType != null)
+ {
+ String thisId = runtimeType.getId();
+ if (thisId.equals(runtimeTargetId))
+ return true;
+ }
}
return false;
@@ -707,9 +720,13 @@ public final class ServerUtils {
List runtimes = Arrays.asList(ServerUtil.getRuntimes(projectType, stJ2EEVersion));
for (int i = 0; i < runtimes.size(); i++) {
IRuntime runtime = (IRuntime) runtimes.get(i);
- String thisId = runtime.getRuntimeType().getId();
- if (thisId.equals(runtimeTargetId))
- return true;
+ IRuntimeType runtimeType = runtime.getRuntimeType();
+ if (runtimeType != null)
+ {
+ String thisId = runtimeType.getId();
+ if (thisId.equals(runtimeTargetId))
+ return true;
+ }
}
return false;
@@ -772,14 +789,18 @@ public final class ServerUtils {
for (int i = 0; i < runtimes.length; i++)
{
IRuntime runtime = runtimes[i];
- String thisRuntimeTypeId = runtime.getRuntimeType().getId();
- if (thisRuntimeTypeId.equals(serverRuntimeTypeId) && !runtime.isStub())
- {
- // Found an appropriate IRuntime that is not a stub
- //foundNonStubRuntime = true;
- nonStubRuntime = runtime;
- break;
- }
+ IRuntimeType runtimeType = runtime.getRuntimeType();
+ if (runtimeType != null)
+ {
+ String thisRuntimeTypeId = runtimeType.getId();
+ if (thisRuntimeTypeId.equals(serverRuntimeTypeId) && !runtime.isStub())
+ {
+ // Found an appropriate IRuntime that is not a stub
+ //foundNonStubRuntime = true;
+ nonStubRuntime = runtime;
+ break;
+ }
+ }
}
}

Back to the top