[351899] action properties passed to RunOnServerAction can be ignored
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerActionDelegate.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerActionDelegate.java
index 6800feb..1d3cfe8 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerActionDelegate.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerActionDelegate.java
@@ -1,5 +1,5 @@
/**********************************************************************
- * Copyright (c) 2003, 2011 IBM Corporation and others.
+ * Copyright (c) 2003, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -282,6 +282,12 @@
client = (IClient)getOverwriteValue(ROS_CLIENT);
launchableAdapter = (ILaunchableAdapter) getOverwriteValue(ROS_LAUNCHABLE);
+ if (Trace.FINEST) {
+ Trace.trace(Trace.STRING_FINEST,
+ "Client and launchableAdapter after setting predefined values: launchableAdapter="
+ + launchableAdapter + " client=" + client);
+ }
+
try {
IProgressMonitor monitor = new NullProgressMonitor();
server2 = getServer(module, moduleArtifact, monitor);
@@ -325,8 +331,18 @@
return;
} else
wizard.performFinish();
- client = wizard.getSelectedClient();
- launchableAdapter = wizard.getLaunchableAdapter();
+
+ // Do not overwrite the client or launchableAdapter value, as it may
+ // have been set by getOverwriteValue, which will add predefined values
+ // if provided. There is no guarantee that getting the values (client and
+ // launchableAadapter) from the wizard will be valid, since the values from
+ // the wizard are used only if the client and launchableAdapter are null
+ if (client == null){
+ client = wizard.getSelectedClient();
+ }
+ if (launchableAdapter == null){
+ launchableAdapter = wizard.getLaunchableAdapter();
+ }
}
// if there is no client, use a dummy
@@ -354,6 +370,11 @@
};
}
+ if (Trace.FINEST) {
+ Trace.trace(Trace.STRING_FINEST,
+ "Prior to creating launch client jobs: launchableAdapter="+ launchableAdapter + " client=" + client);
+ }
+
if (moduleArtifact instanceof ModuleArtifactDelegate) {
boolean canLoad = false;
try {