[jbosstools-commits] JBoss Tools SVN: r39280 - 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 07:47:00 EST 2012


Author: snjeza
Date: 2012-03-05 07:46:59 -0500 (Mon, 05 Mar 2012)
New Revision: 39280

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 12:29:50 UTC (rev 39279)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java	2012-03-05 12:46:59 UTC (rev 39280)
@@ -49,22 +49,25 @@
 	
 	public static void initializeRuntimes(IProgressMonitor monitor) {
 		if (isJBDS()) {
-			final Set<RuntimePath> runtimePaths = new HashSet<RuntimePath>();
-			parseRuntimeLocationsFile(runtimePaths);
-			RuntimePath eapPath = null;
+			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());
-					runtimePaths.add(runtimePath);
-					eapPath = runtimePath;
+					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);
 			}
-			
-			JBossRuntimeLocator locator = new JBossRuntimeLocator();
+			final Set<RuntimePath> runtimePaths = new HashSet<RuntimePath>();
+			parseRuntimeLocationsFile(runtimePaths);
 			for (RuntimePath runtimePath : runtimePaths) {
 				List<RuntimeDefinition> serverDefinitions = locator
 						.searchForRuntimes(runtimePath.getPath(), monitor);
@@ -73,9 +76,6 @@
 					serverDefinition.setRuntimePath(runtimePath);
 				}
 				runtimePath.getServerDefinitions().addAll(serverDefinitions);
-				if (runtimePath.equals(eapPath)) {
-					initializeRuntimes(serverDefinitions);
-				}
 			}
 			if (runtimePaths.size() > 0) {
 				RuntimeUIActivator.getDefault().getRuntimePaths().addAll(runtimePaths);



More information about the jbosstools-commits mailing list