Program: 3151
Project: 3151
Buggy source:
/** 
 * Setup an AP2AP connection with members.
 * @param ids The member IDs to start a AP2AP with.
 * @return The connected streams.
 * @throws SkypeException when connection is gone bad.
 */
public Stream[] connect(final String... ids) throws SkypeException {
  Utils.checkNotNull("String_Node_Str",ids);
synchronized (connectMutex) {
    try {
      final Object wait=new Object();
      ConnectorListener connectorListener=new AbstractConnectorListener(){
        public void messageReceived(        ConnectorMessageEvent event){
          String message=event.getMessage();
          if (message.equals("String_Node_Str" + getName() + "String_Node_Str")) {
synchronized (wait) {
              wait.notify();
            }
          }
        }
      }
;
      try {
        Connector.getInstance().addConnectorListener(connectorListener);
synchronized (wait) {
          for (          String skypeId : ids) {
            if (skypeId != null) {
              String result=Connector.getInstance().execute("String_Node_Str" + getName() + "String_Node_Str"+ skypeId);
              Utils.checkError(result);
            }
          }
          try {
            wait.wait();
          }
 catch (          InterruptedException e) {
            throw new SkypeException("String_Node_Str",e);
          }
        }
        return getAllStreams(ids);
      }
 catch (      ConnectorException e) {
        Utils.convertToSkypeException(e);
        return null;
      }
 finally {
        Connector.getInstance().removeConnectorListener(connectorListener);
      }
    }
 catch (    SkypeException e) {
      for (      Stream stream : getAllStreams(ids)) {
        try {
          stream.disconnect();
        }
 catch (        SkypeException e2) {
        }
      }
      throw e;
    }
  }
}

Fixed version (ground truth):
/** 
 * Setup an AP2AP connection with members.
 * @param ids The member IDs to start a AP2AP with.
 * @return The connected streams.
 * @throws SkypeException when connection is gone bad.
 */
public Stream[] connect(final String... ids) throws SkypeException {
  Utils.checkNotNull("String_Node_Str",ids);
synchronized (connectMutex) {
    try {
      final Object wait=new Object();
      ConnectorListener connectorListener=new AbstractConnectorListener(){
        public void messageReceived(        ConnectorMessageEvent event){
          String message=event.getMessage();
          if (message.equals("String_Node_Str" + getName() + "String_Node_Str")) {
synchronized (wait) {
              wait.notify();
            }
          }
 else           if (message.startsWith("String_Node_Str" + getName() + "String_Node_Str")) {
            String streamIds=message.substring(("String_Node_Str" + getName() + "String_Node_Str").length());
            if ("String_Node_Str".equals(streamIds)) {
              return;
            }
            for (            String streamId : streamIds.split("String_Node_Str")) {
              for (              String id : ids) {
                if (streamId.startsWith(id + "String_Node_Str")) {
synchronized (wait) {
                    wait.notify();
                    return;
                  }
                }
              }
            }
          }
        }
      }
;
      try {
        Connector.getInstance().addConnectorListener(connectorListener);
synchronized (wait) {
          for (          String skypeId : ids) {
            if (skypeId != null) {
              String result=Connector.getInstance().execute("String_Node_Str" + getName() + "String_Node_Str"+ skypeId);
              Utils.checkError(result);
            }
          }
          try {
            wait.wait();
          }
 catch (          InterruptedException e) {
            throw new SkypeException("String_Node_Str",e);
          }
        }
        return getAllStreams(ids);
      }
 catch (      ConnectorException e) {
        Utils.convertToSkypeException(e);
        return null;
      }
 finally {
        Connector.getInstance().removeConnectorListener(connectorListener);
      }
    }
 catch (    SkypeException e) {
      for (      Stream stream : getAllStreams(ids)) {
        try {
          stream.disconnect();
        }
 catch (        SkypeException e2) {
        }
      }
      throw e;
    }
  }
}