[jbosstools-commits] JBoss Tools SVN: r39285 - trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Mon Mar 5 09:12:24 EST 2012


Author: snjeza
Date: 2012-03-05 09:12:23 -0500 (Mon, 05 Mar 2012)
New Revision: 39285

Modified:
   trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java
Log:
JBDS-2048 Runtime detection: Location not added to the paths list

Modified: trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java	2012-03-05 14:08:18 UTC (rev 39284)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java	2012-03-05 14:12:23 UTC (rev 39285)
@@ -34,10 +34,8 @@
 import org.jboss.tools.runtime.core.JBossRuntimeLocator;
 import org.jboss.tools.runtime.core.RuntimeCoreActivator;
 import org.jboss.tools.runtime.core.model.IRuntimeDetector;
-import org.jboss.tools.runtime.core.model.RuntimePath;
 import org.jboss.tools.runtime.core.model.RuntimeDefinition;
-import org.jboss.tools.runtime.ui.RuntimeUIActivator;
-import org.osgi.framework.Bundle;
+import org.jboss.tools.runtime.core.model.RuntimePath;
 
 public class JBossRuntimeStartup {
 	
@@ -48,40 +46,40 @@
 	private static final String LOCATIONS_FILE_CONFIGURATION = "../../studio/" + LOCATIONS_FILE_NAME; //$NON-NLS-1$
 	
 	public static void initializeRuntimes(IProgressMonitor monitor) {
-		if (isJBDS()) {
-			JBossRuntimeLocator locator = new JBossRuntimeLocator();
-			try {
-				String configuration = getConfiguration();
-				File directory = new File(configuration, JBOSS_EAP_HOME);
-				if (directory.isDirectory()) {
-					RuntimePath runtimePath = new RuntimePath(directory.getAbsolutePath());
-					List<RuntimeDefinition> serverDefinitions = locator
-							.searchForRuntimes(runtimePath.getPath(), monitor);
-					runtimePath.getServerDefinitions().clear();
-					for (RuntimeDefinition serverDefinition : serverDefinitions) {
-						serverDefinition.setRuntimePath(runtimePath);
-					}
-					initializeRuntimes(serverDefinitions);
-				}
-			} catch (IOException e) {
-				RuntimeUIActivator.log(e);
-			}
-			final Set<RuntimePath> runtimePaths = new HashSet<RuntimePath>();
-			parseRuntimeLocationsFile(runtimePaths);
-			for (RuntimePath runtimePath : runtimePaths) {
+		JBossRuntimeLocator locator = new JBossRuntimeLocator();
+		try {
+			String configuration = getConfiguration();
+			File directory = new File(configuration, JBOSS_EAP_HOME);
+			if (directory.isDirectory()) {
+				RuntimePath runtimePath = new RuntimePath(
+						directory.getAbsolutePath());
 				List<RuntimeDefinition> serverDefinitions = locator
 						.searchForRuntimes(runtimePath.getPath(), monitor);
 				runtimePath.getServerDefinitions().clear();
 				for (RuntimeDefinition serverDefinition : serverDefinitions) {
 					serverDefinition.setRuntimePath(runtimePath);
 				}
-				runtimePath.getServerDefinitions().addAll(serverDefinitions);
+				initializeRuntimes(serverDefinitions);
 			}
-			if (runtimePaths.size() > 0) {
-				RuntimeUIActivator.getDefault().getRuntimePaths().addAll(runtimePaths);
-				RuntimeUIActivator.getDefault().saveRuntimePaths();
-			}				
+		} catch (IOException e) {
+			RuntimeUIActivator.log(e);
 		}
+		final Set<RuntimePath> runtimePaths = new HashSet<RuntimePath>();
+		parseRuntimeLocationsFile(runtimePaths);
+		for (RuntimePath runtimePath : runtimePaths) {
+			List<RuntimeDefinition> serverDefinitions = locator
+					.searchForRuntimes(runtimePath.getPath(), monitor);
+			runtimePath.getServerDefinitions().clear();
+			for (RuntimeDefinition serverDefinition : serverDefinitions) {
+				serverDefinition.setRuntimePath(runtimePath);
+			}
+			runtimePath.getServerDefinitions().addAll(serverDefinitions);
+		}
+		if (runtimePaths.size() > 0) {
+			RuntimeUIActivator.getDefault().getRuntimePaths()
+					.addAll(runtimePaths);
+			RuntimeUIActivator.getDefault().saveRuntimePaths();
+		}
 	}
 
 	public static void initializeRuntimes(List<RuntimeDefinition> serverDefinitions) {
@@ -93,13 +91,6 @@
 		}
 		refreshCommonNavigator();
 	}
-	
-	
-	private static boolean isJBDS() {
-		Bundle jbdsProduct = Platform.getBundle("com.jboss.jbds.product");
-		//return jbdsProduct != null;
-		return true;
-	}
 
 	private static void refreshCommonNavigator() {
 		// https://jira.jboss.org/jira/browse/JBDS-1091



More information about the jbosstools-commits mailing list