Program: 94972
Project: 94972
Buggy source:
public void connect(ID remote,IConnectContext joinContext) throws ContainerConnectException {
  try {
    if (isClosing)     throw new IllegalStateException(Messages.ClientSOContainer_Container_Closing);
    debug("String_Node_Str" + remote + "String_Node_Str"+ joinContext+ "String_Node_Str");
    Object response=null;
synchronized (getConnectLock()) {
      if (isConnected())       throw new IllegalStateException(Messages.ClientSOContainer_Already_Connected + getConnectedID());
      if (isConnecting())       throw new IllegalStateException(Messages.ClientSOContainer_Currently_Connecting);
      fireContainerEvent(new ContainerConnectingEvent(this.getID(),remote,joinContext));
      ISynchAsynchConnection aConnection=createConnection(remote,joinContext);
      setStateConnecting(aConnection);
synchronized (aConnection) {
        Object connectData=getConnectData(remote,joinContext);
        int connectTimeout=getConnectTimeout();
        try {
          response=aConnection.connect(remote,connectData,connectTimeout);
        }
 catch (        IOException e) {
          if (getConnection() != aConnection)           killConnection(aConnection);
 else           setStateDisconnected(aConnection);
          throw e;
        }
        if (getConnection() != aConnection) {
          killConnection(aConnection);
          throw new IllegalStateException(Messages.ClientSOContainer_Connect_Failed_Incorrect_State);
        }
        ID serverID=null;
        try {
          serverID=handleConnectResponse(remote,response);
        }
 catch (        Exception e) {
          setStateDisconnected(aConnection);
          throw e;
        }
        aConnection.start();
        setStateConnected(serverID,aConnection);
      }
    }
  }
 catch (  Exception e) {
    traceStack("String_Node_Str",e);
    ContainerConnectException except=new ContainerConnectException(Messages.ClientSOContainer_Exception_Connecting + remote.getName(),e);
    throw except;
  }
}

Fixed version (ground truth):
public void connect(ID remote,IConnectContext joinContext) throws ContainerConnectException {
  try {
    if (isClosing)     throw new IllegalStateException(Messages.ClientSOContainer_Container_Closing);
    debug("String_Node_Str" + remote + "String_Node_Str"+ joinContext+ "String_Node_Str");
    Object response=null;
synchronized (getConnectLock()) {
      if (isConnected())       throw new IllegalStateException(Messages.ClientSOContainer_Already_Connected + getConnectedID());
      if (isConnecting())       throw new IllegalStateException(Messages.ClientSOContainer_Currently_Connecting);
      fireContainerEvent(new ContainerConnectingEvent(this.getID(),remote,joinContext));
      ISynchAsynchConnection aConnection=createConnection(remote,joinContext);
      setStateConnecting(aConnection);
synchronized (aConnection) {
        Object connectData=getConnectData(remote,joinContext);
        int connectTimeout=getConnectTimeout();
        try {
          response=aConnection.connect(remote,connectData,connectTimeout);
        }
 catch (        IOException e) {
          if (getConnection() != aConnection)           killConnection(aConnection);
 else           setStateDisconnected(aConnection);
          throw e;
        }
        if (getConnection() != aConnection) {
          killConnection(aConnection);
          throw new IllegalStateException(Messages.ClientSOContainer_Connect_Failed_Incorrect_State);
        }
        ID serverID=null;
        try {
          serverID=handleConnectResponse(remote,response);
        }
 catch (        Exception e) {
          setStateDisconnected(aConnection);
          throw e;
        }
        setStateConnected(serverID,aConnection);
        fireContainerEvent(new ContainerConnectedEvent(this.getID(),remoteServerID));
        aConnection.start();
      }
    }
  }
 catch (  Exception e) {
    traceStack("String_Node_Str",e);
    ContainerConnectException except=new ContainerConnectException(Messages.ClientSOContainer_Exception_Connecting + remote.getName(),e);
    throw except;
  }
}