# HG changeset patch # User fturovic # Date 1265922563 21600 # Node ID 949823a0e5df809f62ebd00dc467d9f989822684 # Parent 47d3ca29d0549ce91d9f86deda83512fde1b512e# Parent c2a0b0241151bb1b30ad9df763f0c6c69234abba daily merge diff -r 47d3ca29d054 -r 949823a0e5df connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/ServiceTester.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/ServiceTester.java Thu Feb 11 15:08:43 2010 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/ServiceTester.java Thu Feb 11 15:09:23 2010 -0600 @@ -94,7 +94,7 @@ public void run() { while (true) { Collection> csSetsByResource = - createConnectedServiceSetsByResource(registry); + createConnectedServiceSetsByResource(new HashSet(registry)); for (Set set : csSetsByResource) { Collection> csSetsByService = createConnectedServiceSetsByService(set); diff -r 47d3ca29d054 -r 949823a0e5df connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/registry/Registry.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/registry/Registry.java Thu Feb 11 15:08:43 2010 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/registry/Registry.java Thu Feb 11 15:09:23 2010 -0600 @@ -517,6 +517,7 @@ public ISelectedConnectionInfo ensureConnection(String id, IService service) throws CoreException { Check.checkArg(service); + final boolean wasCurrentConnection = id.equals(CURRENT_CONNECTION_ID); final IConnection[] connectionHolder = { findConnection(id) }; final String[] storableIdHolder = { id }; if (!isCompatibleConnection(connectionHolder[0], service)) { @@ -526,6 +527,10 @@ Logging.newStatus(RemoteConnectionsActivator.getDefault(), IStatus.ERROR, Messages.getString("Registry.NoCompatibleConnectionMsg"))); //$NON-NLS-1$ } + else if (wasCurrentConnection && !connectionHolder[0].getIdentifier().equals(CURRENT_CONNECTION_ID)) { + setCurrentConnection(connectionHolder[0]); + storableIdHolder[0] = CURRENT_CONNECTION_ID; + } } return new ISelectedConnectionInfo() { public String getStorableId() { diff -r 47d3ca29d054 -r 949823a0e5df core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java Thu Feb 11 15:08:43 2010 -0600 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManager.java Thu Feb 11 15:09:23 2010 -0600 @@ -981,10 +981,26 @@ BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream())); String overallOutput = null; String stdErrLine = null; - try { - while ((stdErrLine = br.readLine()) != null) { - overallOutput += stdErrLine; + try { + + // Only try for 10 seconds then bail in case Raptor hangs + int maxTries = 20; + int numTries = 0; + while (numTries < maxTries) { + try { + Thread.sleep(500); + } catch (InterruptedException e) { + // ignore + } + if (br.ready()) { + while ((stdErrLine = br.readLine()) != null) { + overallOutput += stdErrLine; + } + break; + } + numTries++; } + } catch (IOException e) { e.printStackTrace(); } diff -r 47d3ca29d054 -r 949823a0e5df debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/status/ConnectionStatusReconciler.java --- a/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/status/ConnectionStatusReconciler.java Thu Feb 11 15:08:43 2010 -0600 +++ b/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/status/ConnectionStatusReconciler.java Thu Feb 11 15:09:23 2010 -0600 @@ -20,6 +20,8 @@ import java.util.ArrayList; import java.util.List; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PartInitException; import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator; @@ -128,15 +130,28 @@ } private void showConnectionsView() { - RunRunnableWhenWorkbenchVisibleJob.start(new Runnable() { - public void run() { - // try to show the connections view to start service testers - try { - WorkbenchUtils.getView(CONNECTIONS_VIEW_ID); - } catch (PartInitException e) { + // avoid deadlock if this called as a result of a launch sequence issuing a "select connection" dialog + Shell shell = WorkbenchUtils.getActiveShell(); + if (shell == null || !shell.isVisible()) { + RunRunnableWhenWorkbenchVisibleJob.start(new Runnable() { + public void run() { + // try to show the connections view to start service testers + try { + WorkbenchUtils.getView(CONNECTIONS_VIEW_ID); + } catch (PartInitException e) { + } } - } - }); + }); + } else { + Display.getDefault().asyncExec(new Runnable() { + public void run() { + try { + WorkbenchUtils.getView(CONNECTIONS_VIEW_ID); + } catch (PartInitException e) { + } + } + }); + } } private void reconcileAsCurrent(IConnection connection) {