Program: 17313
Project: 17313
Buggy source:
/** 
 * Binds a   {@link ConnectionEventListener} to the specified events and then connects to Pusher. This is equivalent to binding a {@link ConnectionEventListener} using the {@link Connection#bind(ConnectionState,ConnectionEventListener)} method before connecting.<p>Calls are ignored (a connection is not attempted) if the  {@link Pusher.getConnection().getState()} is not {@link com.pusher.client.connection.ConnectionState.DISCONNECTED}.</p>
 * @param eventListener A {@link ConnectionEventListener} that will receive connection events. This can be null if you are not interested in receiving connection events, in which case you should call {@link #connect()} instead of this method.
 * @param connectionStates An optional list of {@link ConnectionState}s to bind your   {@link ConnectionEventListener} to before connecting to Pusher. If you do not specify any {@link ConnectionState}s then your   {@link ConnectionEventListener} will be bound to all connection events. This is equivalent to calling {@link #connect(ConnectionEventListener,ConnectionState)} with {@link ConnectionState#ALL}.
 * @throws IllegalArgumentException If the {@link ConnectionEventListener} is null and at least one connection state has been specified.
 */
public void connect(ConnectionEventListener eventListener,ConnectionState... connectionStates){
  if (eventListener != null) {
    if (connectionStates.length == 0) {
      connectionStates=new ConnectionState[]{ConnectionState.ALL};
    }
    for (    ConnectionState state : connectionStates) {
      connection.bind(state,eventListener);
    }
  }
 else {
    if (connectionStates.length > 0) {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
  connection.connect();
}

Fixed version (ground truth):
/** 
 * Binds a   {@link ConnectionEventListener} to the specified events and then connects to Pusher. This is equivalent to binding a {@link ConnectionEventListener} using the {@link Connection#bind(ConnectionState,ConnectionEventListener)} method before connecting.<p>Calls are ignored (a connection is not attempted) if the  {@link Connection#getState()} is not {@link com.pusher.client.connection.ConnectionState#DISCONNECTED}.</p>
 * @param eventListener A {@link ConnectionEventListener} that will receive connection events. This can be null if you are not interested in receiving connection events, in which case you should call {@link #connect()} instead of this method.
 * @param connectionStates An optional list of {@link ConnectionState}s to bind your   {@link ConnectionEventListener} to before connecting to Pusher. If you do not specify any {@link ConnectionState}s then your   {@link ConnectionEventListener} will be bound to all connection events. This is equivalent to calling {@link #connect(ConnectionEventListener,ConnectionState)} with {@link ConnectionState#ALL}.
 * @throws IllegalArgumentException If the {@link ConnectionEventListener} is null and at least one connection state has been specified.
 */
public void connect(ConnectionEventListener eventListener,ConnectionState... connectionStates){
  if (eventListener != null) {
    if (connectionStates.length == 0) {
      connectionStates=new ConnectionState[]{ConnectionState.ALL};
    }
    for (    ConnectionState state : connectionStates) {
      connection.bind(state,eventListener);
    }
  }
 else {
    if (connectionStates.length > 0) {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
  connection.connect();
}