Program: 10943
Project: 10943
Buggy source:
public synchronized CaldecottTunnelDescriptor startCaldecottTunnel(final String serviceName,final IProgressMonitor monitor) throws CoreException {
  final List<CaldecottTunnelDescriptor> tunnel=new ArrayList<CaldecottTunnelDescriptor>(1);
  cloudServer.getBehaviour().new Request<CaldecottTunnelDescriptor>(){
    @Override protected CaldecottTunnelDescriptor doRun(    final CloudFoundryClient client,    SubMonitor progress) throws CoreException {
      progress=SubMonitor.convert(progress);
      CloudApplication caldecottApp=getOrDeployCaldecottApp(progress);
      if (caldecottApp == null) {
        return null;
      }
      progress.setTaskName("String_Node_Str" + serviceName + "String_Node_Str");
      bindServiceToCaldecottApp(serviceName,progress);
      startCaldecottApp(progress,client);
      int unusedPort=CloudFoundryPlugin.getCaldecottTunnelCache().getUnusedPort();
      CaldecottTunnelDescriptor oldDescriptor=CloudFoundryPlugin.getCaldecottTunnelCache().getDescriptor(cloudServer,serviceName);
      if (oldDescriptor != null) {
        try {
          stopCaldecottTunnel(serviceName);
        }
 catch (        CoreException e) {
          CloudFoundryPlugin.logError(NLS.bind("String_Node_Str",new Object[]{serviceName,oldDescriptor.tunnelPort(),unusedPort}));
        }
      }
      InetSocketAddress local=new InetSocketAddress(LOCAL_HOST,unusedPort);
      String url=getTunnelUri(client,progress);
      Map<String,String> info=getTunnelInfo(client,serviceName,progress);
      if (info == null) {
        CloudFoundryPlugin.logError(NLS.bind("String_Node_Str",new Object[]{serviceName,unusedPort}));
        return null;
      }
      String host=info.get("String_Node_Str");
      int port=Integer.valueOf(info.get("String_Node_Str"));
      String auth=TunnelHelper.getTunnelAuth(client);
      String serviceUserName=info.get("String_Node_Str");
      String servicePassword=info.get("String_Node_Str");
      String dataBase=getServiceVendor(serviceName,progress);
      String name=info.get("String_Node_Str");
      if (name == null) {
        name=info.get("String_Node_Str") != null ? info.get("String_Node_Str") : info.get("String_Node_Str");
      }
      TunnelServer tunnelServer=new TunnelServer(local,new HttpTunnelFactory(url,host,port,auth),getTunnelServerThreadExecutor());
      progress.setTaskName("String_Node_Str" + serviceName);
      tunnelServer.start();
      if (oldDescriptor != null) {
        CloudFoundryPlugin.getCaldecottTunnelCache().removeDescriptor(cloudServer,serviceName);
      }
      CaldecottTunnelDescriptor descriptor=new CaldecottTunnelDescriptor(serviceUserName,servicePassword,name,serviceName,dataBase,tunnelServer,unusedPort);
      CloudFoundryPlugin.getCaldecottTunnelCache().addDescriptor(cloudServer,descriptor);
      tunnel.add(descriptor);
      CloudFoundryCallback callBack=CloudFoundryPlugin.getCallback();
      List<CaldecottTunnelDescriptor> descriptors=new ArrayList<CaldecottTunnelDescriptor>();
      descriptors.add(descriptor);
      callBack.displayCaldecottTunnelConnections(cloudServer,descriptors);
      return descriptor;
    }
  }
.run(monitor);
  return tunnel.size() > 0 ? tunnel.get(0) : null;
}

Fixed version (ground truth):
public synchronized CaldecottTunnelDescriptor startCaldecottTunnel(final String serviceName,final IProgressMonitor monitor) throws CoreException {
  final List<CaldecottTunnelDescriptor> tunnel=new ArrayList<CaldecottTunnelDescriptor>(1);
  cloudServer.getBehaviour().new Request<CaldecottTunnelDescriptor>(){
    @Override protected CaldecottTunnelDescriptor doRun(    final CloudFoundryClient client,    SubMonitor progress) throws CoreException {
      progress=SubMonitor.convert(progress);
      CloudApplication caldecottApp=getOrDeployCaldecottApp(progress);
      if (caldecottApp == null) {
        return null;
      }
      progress.setTaskName("String_Node_Str" + serviceName + "String_Node_Str");
      bindServiceToCaldecottApp(serviceName,progress);
      startCaldecottApp(progress,client);
      CaldecottTunnelDescriptor oldDescriptor=CloudFoundryPlugin.getCaldecottTunnelCache().getDescriptor(cloudServer,serviceName);
      if (oldDescriptor != null) {
        try {
          stopAndDeleteCaldecottTunnel(serviceName,monitor);
        }
 catch (        CoreException e) {
          CloudFoundryPlugin.logError(NLS.bind("String_Node_Str",new Object[]{serviceName}));
          return null;
        }
      }
      String url=getTunnelUri(client,progress);
      Map<String,String> info=getTunnelInfo(client,serviceName,progress);
      if (info == null) {
        CloudFoundryPlugin.logError(NLS.bind("String_Node_Str",new Object[]{serviceName}));
        return null;
      }
      String host=info.get("String_Node_Str");
      int port=Integer.valueOf(info.get("String_Node_Str"));
      String auth=TunnelHelper.getTunnelAuth(client);
      String serviceUserName=info.get("String_Node_Str");
      String servicePassword=info.get("String_Node_Str");
      String dataBase=getServiceVendor(serviceName,progress);
      String name=info.get("String_Node_Str");
      if (name == null) {
        name=info.get("String_Node_Str") != null ? info.get("String_Node_Str") : info.get("String_Node_Str");
      }
      TunnelFactory tunnelFactory=new HttpTunnelFactory(url,host,port,auth);
      List<TunnelServer> tunnelServers=new ArrayList<TunnelServer>(1);
      int localPort=getTunnelServer(tunnelFactory,tunnelServers);
      if (tunnelServers.isEmpty() || localPort == -1) {
        CloudFoundryPlugin.logError(NLS.bind("String_Node_Str",new Object[]{serviceName,new Integer(BASE_PORT),new Integer(MAX_PORT)}));
        return null;
      }
      TunnelServer tunnelServer=tunnelServers.get(0);
      progress.setTaskName("String_Node_Str" + serviceName);
      tunnelServer.start();
      CaldecottTunnelDescriptor descriptor=new CaldecottTunnelDescriptor(serviceUserName,servicePassword,name,serviceName,dataBase,tunnelServer,localPort);
      CloudFoundryPlugin.getCaldecottTunnelCache().addDescriptor(cloudServer,descriptor);
      tunnel.add(descriptor);
      CloudFoundryCallback callBack=CloudFoundryPlugin.getCallback();
      List<CaldecottTunnelDescriptor> descriptors=new ArrayList<CaldecottTunnelDescriptor>();
      descriptors.add(descriptor);
      callBack.displayCaldecottTunnelConnections(cloudServer,descriptors);
      return descriptor;
    }
  }
.run(monitor);
  return tunnel.size() > 0 ? tunnel.get(0) : null;
}