Program: 35608
Project: 35608
Buggy source:
private void pullChatMessages(int lookIntoFuture){
  Map<String,Integer> fieldMap=new HashMap<>();
  fieldMap.put("String_Node_Str",lookIntoFuture);
  fieldMap.put("String_Node_Str",25);
  int lastKnown;
  if (lookIntoFuture == 1) {
    lastKnown=globalLastKnownFutureMessageId;
  }
 else {
    lastKnown=globalLastKnownPastMessageId;
  }
  fieldMap.put("String_Node_Str",lastKnown);
  if (lookIntoFuture == 1) {
    ncApi.pullChatMessages(ApiUtils.getCredentials(currentUser.getUserId(),currentUser.getToken()),ApiUtils.getUrlForChat(currentUser.getBaseUrl(),roomToken),fieldMap).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).takeWhile(observable -> inChat).retry(3,observable -> inChat).subscribe(new Observer<Response>(){
      @Override public void onSubscribe(      Disposable d){
      }
      @Override public void onNext(      Response response){
        processMessages(response,true);
        pullChatMessages(1);
      }
      @Override public void onError(      Throwable e){
      }
      @Override public void onComplete(){
      }
    }
);
  }
 else {
    ncApi.pullChatMessages(ApiUtils.getCredentials(currentUser.getUserId(),currentUser.getToken()),ApiUtils.getUrlForChat(currentUser.getBaseUrl(),roomToken),fieldMap).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).retry(3,observable -> inChat).subscribe(new Observer<Response>(){
      @Override public void onSubscribe(      Disposable d){
      }
      @Override public void onNext(      Response response){
        processMessages(response,false);
      }
      @Override public void onError(      Throwable e){
      }
      @Override public void onComplete(){
      }
    }
);
  }
}

Fixed version (ground truth):
private void pullChatMessages(int lookIntoFuture){
  Map<String,Integer> fieldMap=new HashMap<>();
  fieldMap.put("String_Node_Str",lookIntoFuture);
  fieldMap.put("String_Node_Str",25);
  int lastKnown;
  if (lookIntoFuture == 1) {
    lastKnown=globalLastKnownFutureMessageId;
  }
 else {
    lastKnown=globalLastKnownPastMessageId;
  }
  if (lastKnown != -1) {
    fieldMap.put("String_Node_Str",lastKnown);
  }
  if (lookIntoFuture == 1) {
    ncApi.pullChatMessages(ApiUtils.getCredentials(currentUser.getUserId(),currentUser.getToken()),ApiUtils.getUrlForChat(currentUser.getBaseUrl(),roomToken),fieldMap).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).takeWhile(observable -> inChat).retry(3,observable -> inChat).subscribe(new Observer<Response>(){
      @Override public void onSubscribe(      Disposable d){
        disposableList.add(d);
      }
      @Override public void onNext(      Response response){
        processMessages(response,true);
      }
      @Override public void onError(      Throwable e){
      }
      @Override public void onComplete(){
        pullChatMessages(1);
      }
    }
);
  }
 else {
    ncApi.pullChatMessages(ApiUtils.getCredentials(currentUser.getUserId(),currentUser.getToken()),ApiUtils.getUrlForChat(currentUser.getBaseUrl(),roomToken),fieldMap).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).retry(3,observable -> inChat).subscribe(new Observer<Response>(){
      @Override public void onSubscribe(      Disposable d){
        disposableList.add(d);
      }
      @Override public void onNext(      Response response){
        processMessages(response,false);
      }
      @Override public void onError(      Throwable e){
      }
      @Override public void onComplete(){
      }
    }
);
  }
}