[jbosstools-commits] JBoss Tools SVN: r39248 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Fri Mar 2 06:00:12 EST 2012


Author: adietish
Date: 2012-03-02 06:00:11 -0500 (Fri, 02 Mar 2012)
New Revision: 39248

Modified:
   trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java
Log:
[JBIDE-11138] removed "reusing existing server adapter" since the current approach is bogus in several ways.

Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java	2012-03-02 09:03:22 UTC (rev 39247)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java	2012-03-02 11:00:11 UTC (rev 39248)
@@ -30,7 +30,6 @@
 import org.eclipse.wst.server.core.IServer;
 import org.eclipse.wst.server.core.IServerType;
 import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ServerCore;
 import org.eclipse.wst.server.core.ServerUtil;
 import org.eclipse.wst.server.core.internal.Server;
 import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
@@ -75,31 +74,13 @@
 		createServerAdapter(Collections.singletonList(project), serverType, runtime, 
 				mode, application, user, project.getName(), remoteName, monitor);
 	}
-
-	private IServer findServer(String applicationName, String host) {
-		IServer[] all = ServerCore.getServers();
-		for( int i = 0; i < all.length; i++ ) {
-			String host1 = all[i].getHost();
-			String app1 = ExpressServerUtils.getExpressApplicationName(all[i]);
-			if( (host.endsWith("/" + host1 + "/") || (host.endsWith("/" + host1)))
-					&& applicationName.equals(app1))
-					return all[i];
-		}
-		return null;
-	}
-
 	
 	protected void createServerAdapter(List<IProject> importedProjects, IServerType serverType,
 			IRuntime runtime, String mode, IApplication application, IUser user, 
 			String deployProject, String remoteName, IProgressMonitor monitor) {
 		try {
 			renameWebContextRoot(importedProjects);
-			String name = application.getName();
-			String host = application.getApplicationUrl();
-			IServer server = findServer(name, host);
-			if( server == null ) {
-				server = doCreateServerAdapter(serverType, runtime, mode, application, user, deployProject, remoteName);
-			} 
+			IServer server = doCreateServerAdapter(serverType, runtime, mode, application, user, deployProject, remoteName);
 			addModules(getModules(importedProjects), server, monitor);
 		} catch (CoreException ce) {
 			OpenShiftUIActivator.getDefault().getLog().log(ce.getStatus());



More information about the jbosstools-commits mailing list