Program: 10726
Project: 10726
Buggy source:
private <P,R>Response<R> internalSendRequestWebSocket(Request<P> request,Class<R> resultClass) throws IOException {
  if (request.getMethod().equals("String_Node_Str")) {
    log.info("String_Node_Str");
  }
  connectIfNecessary();
  Future<Response<JsonElement>> responseFuture=null;
  if (request.getId() != null) {
    responseFuture=pendingRequests.prepareResponse(request.getId());
  }
  boolean isPing=false;
  String jsonMessage=request.toString();
  if (METHOD_PING.equals(request.getMethod())) {
    isPing=true;
    log.trace("String_Node_Str",label,jsonMessage.trim());
  }
 else {
    log.debug("String_Node_Str",label,jsonMessage.trim());
  }
  if (wsSession == null) {
    throw new IllegalStateException("String_Node_Str" + this.url + "String_Node_Str");
  }
synchronized (wsSession) {
    wsSession.getRemote().sendString(jsonMessage);
  }
  if (responseFuture == null) {
    return null;
  }
  Response<JsonElement> responseJson;
  try {
    responseJson=responseFuture.get(requestTimeout,TimeUnit.MILLISECONDS);
    if (isPing) {
      log.trace("String_Node_Str",label,responseJson.toString());
    }
 else {
      log.debug("String_Node_Str",label,responseJson.toString());
    }
    Response<R> response=MessageUtils.convertResponse(responseJson,resultClass);
    if (response.getSessionId() != null) {
      session.setSessionId(response.getSessionId());
    }
    return response;
  }
 catch (  InterruptedException e) {
    throw new KurentoException(label + "String_Node_Str",e);
  }
catch (  ExecutionException e) {
    throw new KurentoException(label + "String_Node_Str",e);
  }
catch (  TimeoutException e) {
    throw new TransportException(label + "String_Node_Str" + requestTimeout+ "String_Node_Str"+ request.getId(),e);
  }
}

Fixed version (ground truth):
private <P,R>Response<R> internalSendRequestWebSocket(Request<P> request,Class<R> resultClass) throws IOException {
  if (request.getMethod().equals("String_Node_Str")) {
    log.info("String_Node_Str");
  }
  connectIfNecessary();
  Future<Response<JsonElement>> responseFuture=null;
  if (request.getId() != null) {
    responseFuture=pendingRequests.prepareResponse(request.getId());
  }
  boolean isPing=false;
  String jsonMessage=request.toString();
  if (METHOD_PING.equals(request.getMethod())) {
    isPing=true;
    log.trace("String_Node_Str",label,jsonMessage.trim());
  }
 else {
    log.debug("String_Node_Str",label,jsonMessage.trim());
  }
  if (wsSession == null) {
    throw new IllegalStateException("String_Node_Str" + this.url + "String_Node_Str");
  }
synchronized (wsSession) {
    wsSession.getRemote().sendString(jsonMessage);
  }
  if (responseFuture == null) {
    return null;
  }
  Response<JsonElement> responseJson;
  try {
    responseJson=responseFuture.get(requestTimeout,TimeUnit.MILLISECONDS);
    if (isPing) {
      log.trace("String_Node_Str",label,responseJson.toString());
    }
 else {
      log.debug("String_Node_Str",label,responseJson.toString());
    }
    Response<R> response=MessageUtils.convertResponse(responseJson,resultClass);
    if (response.getSessionId() != null) {
      session.setSessionId(response.getSessionId());
    }
    return response;
  }
 catch (  InterruptedException e) {
    throw new KurentoException(label + "String_Node_Str",e);
  }
catch (  ExecutionException e) {
    throw new KurentoException(label + "String_Node_Str",e);
  }
catch (  TimeoutException e) {
    throw new TransportException(label + "String_Node_Str" + requestTimeout+ "String_Node_Str"+ jsonMessage.trim(),e);
  }
}