Program: 35625
Project: 35625
Buggy source:
private void fetchData(boolean fromBottomSheet){
  dispose(null);
  callItems=new ArrayList<>();
  roomsQueryDisposable=ncApi.getRooms(ApiUtils.getCredentials(userEntity.getUsername(),userEntity.getToken()),ApiUtils.getUrlForGetRooms(userEntity.getBaseUrl())).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).subscribe(roomsOverall -> {
    if (roomsOverall != null) {
      for (int i=0; i < roomsOverall.getOcs().getData().size(); i++) {
        callItems.add(new CallItem(roomsOverall.getOcs().getData().get(i),userEntity));
      }
      adapter.updateDataSet(callItems,true);
      Collections.sort(callItems,(callItem,t1) -> Long.compare(t1.getModel().getLastPing(),callItem.getModel().getLastPing()));
      if (searchItem != null) {
        searchItem.setVisible(callItems.size() > 0);
      }
    }
    swipeRefreshLayout.setRefreshing(false);
  }
,throwable -> {
    if (searchItem != null) {
      searchItem.setVisible(false);
    }
    if (throwable instanceof HttpException) {
      HttpException exception=(HttpException)throwable;
switch (exception.code()) {
case 401:
        if (getParentController() != null && getParentController().getRouter() != null) {
          getParentController().getRouter().pushController((RouterTransaction.with(new WebViewLoginController(userEntity.getBaseUrl(),true)).pushChangeHandler(new VerticalChangeHandler()).popChangeHandler(new VerticalChangeHandler())));
        }
      break;
default :
    break;
}
}
swipeRefreshLayout.setRefreshing(false);
dispose(roomsQueryDisposable);
}
,() -> {
dispose(roomsQueryDisposable);
if (swipeRefreshLayout != null) {
swipeRefreshLayout.setRefreshing(false);
}
if (fromBottomSheet) {
new Handler().postDelayed(() -> {
  bottomSheet.setCancelable(true);
  if (bottomSheet.isShowing()) {
    bottomSheet.cancel();
  }
}
,2500);
}
}
);
}

Fixed version (ground truth):
private void fetchData(boolean fromBottomSheet){
  dispose(null);
  callItems=new ArrayList<>();
  roomsQueryDisposable=ncApi.getRooms(ApiUtils.getCredentials(userEntity.getUsername(),userEntity.getToken()),ApiUtils.getUrlForGetRooms(userEntity.getBaseUrl())).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).subscribe(roomsOverall -> {
    if (roomsOverall != null) {
      for (int i=0; i < roomsOverall.getOcs().getData().size(); i++) {
        callItems.add(new CallItem(roomsOverall.getOcs().getData().get(i),userEntity));
      }
      adapter.updateDataSet(callItems,true);
      Collections.sort(callItems,(callItem,t1) -> Long.compare(t1.getModel().getLastPing(),callItem.getModel().getLastPing()));
      if (searchItem != null) {
        searchItem.setVisible(callItems.size() > 0);
      }
    }
    if (swipeRefreshLayout != null) {
      swipeRefreshLayout.setRefreshing(false);
    }
  }
,throwable -> {
    if (searchItem != null) {
      searchItem.setVisible(false);
    }
    if (throwable instanceof HttpException) {
      HttpException exception=(HttpException)throwable;
switch (exception.code()) {
case 401:
        if (getParentController() != null && getParentController().getRouter() != null) {
          getParentController().getRouter().pushController((RouterTransaction.with(new WebViewLoginController(userEntity.getBaseUrl(),true)).pushChangeHandler(new VerticalChangeHandler()).popChangeHandler(new VerticalChangeHandler())));
        }
      break;
default :
    break;
}
}
if (swipeRefreshLayout != null) {
swipeRefreshLayout.setRefreshing(false);
}
dispose(roomsQueryDisposable);
}
,() -> {
dispose(roomsQueryDisposable);
if (swipeRefreshLayout != null) {
swipeRefreshLayout.setRefreshing(false);
}
if (fromBottomSheet) {
new Handler().postDelayed(() -> {
  bottomSheet.setCancelable(true);
  if (bottomSheet.isShowing()) {
    bottomSheet.cancel();
  }
}
,2500);
}
}
);
}