Fix bug 10835. Also fix issue with null String check where elcipse 3.6 complier removes code, assuming it's dead.
authortimkelly
Thu, 04 Mar 2010 11:33:34 -0600
changeset 1077 7bde62318913
parent 1071 6776eee973c9
child 1081 eb755d0b6c12
Fix bug 10835. Also fix issue with null String check where elcipse 3.6 complier removes code, assuming it's dead.
core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java
project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/sharedui/BuilderSelectionComposite.java
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java	Wed Mar 03 10:50:19 2010 -0600
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java	Thu Mar 04 11:33:34 2010 -0600
@@ -668,7 +668,7 @@
 			}
 			if (p != null) {
 				BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
-				String overallOutput = null;
+				String overallOutput = "";
 				String stdErrLine = null;
 				try {
 
@@ -684,15 +684,16 @@
 						if (br.ready()) {
 							while ((stdErrLine = br.readLine()) != null) {
 								overallOutput += stdErrLine;
+								numTries = maxTries;
 							}
-							break;
+							
 						}
 						numTries++;
 					}
 				} catch (IOException e) {
 					e.printStackTrace();
 				}
-				if (overallOutput != null) {
+				if (overallOutput.length() > 0) {
 				{
 					String[] tokens = overallOutput.split(" ");
 					if (tokens.length >= 3) {
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/sharedui/BuilderSelectionComposite.java	Wed Mar 03 10:50:19 2010 -0600
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/sharedui/BuilderSelectionComposite.java	Thu Mar 04 11:33:34 2010 -0600
@@ -16,12 +16,11 @@
 */
 package com.nokia.carbide.cpp.internal.project.ui.sharedui;
 
+import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.dialogs.IDialogSettings;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Combo;
@@ -31,7 +30,6 @@
 import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils;
 import com.nokia.carbide.cpp.internal.project.ui.Messages;
 import com.nokia.carbide.cpp.internal.project.ui.ProjectUIPlugin;
-import com.nokia.carbide.cpp.internal.sdk.core.model.SDKManager;
 import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
 import com.nokia.carbide.cpp.sdk.ui.shared.BuildTargetsPage;
 
@@ -77,12 +75,19 @@
 		useSBSv2Builder = true;
 		IStatus status = null;
 		if (builderCombo != null && builderCombo.getSelectionIndex() == 1) {
+
+			IPath sbsBinPath = SBSv2Utils.getSBSBinDirectory();
 			
 			// if SBSv2 is selected, make sure SBS_HOME is defined
 			if (SBSv2Utils.getSBSBinDirectory() == null){
 				status = new Status(Status.ERROR, ProjectUIPlugin.PLUGIN_ID, "SBS_HOME environment variable is not defined. Carbide needs this variable to find the base SBS install.");
 			}
 			
+			// check to see if SBS_HOME directory really exists
+			else if (!sbsBinPath.toFile().exists()){
+				status = new Status(Status.ERROR, ProjectUIPlugin.PLUGIN_ID, "SBS_HOME environment variable path does not exist: " + sbsBinPath.toOSString());
+			}
+			
 			// check the raptor version
 			else if (SDKCorePlugin.getSDKManager().getSBSv2Version(false).getMajor() == 0){
 				// Try to scan again....