Program: 35577
Project: 35577
Buggy source:
@Override protected void onViewBound(@NonNull View view){
  super.onViewBound(view);
  boolean adapterWasNull=false;
  if (adapter == null) {
    try {
      cache.evictAll();
    }
 catch (    IOException e) {
      Log.e(TAG,"String_Node_Str");
    }
    adapterWasNull=true;
    MessagesListAdapter.HoldersConfig holdersConfig=new MessagesListAdapter.HoldersConfig();
    holdersConfig.setIncoming(MagicIncomingTextMessageViewHolder.class,R.layout.item_custom_incoming_text_message);
    holdersConfig.setOutcoming(MagicOutcomingTextMessageViewHolder.class,R.layout.item_custom_outcoming_text_message);
    adapter=new MessagesListAdapter<>(conversationUser.getUserId(),holdersConfig,new ImageLoader(){
      @Override public void loadImage(      ImageView imageView,      String url){
        GlideApp.with(NextcloudTalkApplication.getSharedApplication().getApplicationContext()).asBitmap().diskCacheStrategy(DiskCacheStrategy.NONE).load(url).centerInside().override(imageView.getMeasuredWidth(),imageView.getMeasuredHeight()).apply(RequestOptions.bitmapTransform(new CircleCrop())).listener(new RequestListener<Bitmap>(){
          @Override public boolean onLoadFailed(          @Nullable GlideException e,          Object model,          Target<Bitmap> target,          boolean isFirstResource){
            TextDrawable drawable=TextDrawable.builder().beginConfig().bold().width(imageView.getMeasuredWidth()).height(imageView.getMeasuredHeight()).endConfig().buildRound("String_Node_Str",getResources().getColor(R.color.nc_grey));
            imageView.setImageDrawable(drawable);
            return true;
          }
          @Override public boolean onResourceReady(          Bitmap resource,          Object model,          Target<Bitmap> target,          DataSource dataSource,          boolean isFirstResource){
            return false;
          }
        }
).into(imageView);
      }
    }
);
  }
  messagesList.setAdapter(adapter);
  adapter.setLoadMoreListener(this);
  adapter.setDateHeadersFormatter(this::format);
  adapter.setOnMessageLongClickListener(this);
  layoutManager=(LinearLayoutManager)messagesList.getLayoutManager();
  popupBubble.setRecyclerView(messagesList);
  popupBubble.setPopupBubbleListener(context -> {
    if (newMessagesCount != 0) {
      new Handler().postDelayed(() -> messagesList.smoothScrollToPosition(newMessagesCount - 1),200);
    }
  }
);
  messagesList.addOnScrollListener(new RecyclerView.OnScrollListener(){
    @Override public void onScrollStateChanged(    RecyclerView recyclerView,    int newState){
      super.onScrollStateChanged(recyclerView,newState);
      if (newState == AbsListView.OnScrollListener.SCROLL_STATE_IDLE) {
        if (newMessagesCount != 0) {
          if (layoutManager.findFirstCompletelyVisibleItemPosition() < newMessagesCount) {
            newMessagesCount=0;
            if (popupBubble != null && popupBubble.isShown()) {
              popupBubble.hide();
            }
          }
        }
      }
    }
  }
);
  messageInput.getInputEditText().setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);
  messageInput.setInputListener(input -> {
    sendMessage(input.toString(),1);
    return true;
  }
);
  if (adapterWasNull && startCallFromNotification == null) {
    setupMentionAutocomplete();
    joinRoomWithPassword();
  }
 else {
    handleFromNotification();
  }
}

Fixed version (ground truth):
@Override protected void onViewBound(@NonNull View view){
  super.onViewBound(view);
  boolean adapterWasNull=false;
  if (adapter == null) {
    try {
      cache.evictAll();
    }
 catch (    IOException e) {
      Log.e(TAG,"String_Node_Str");
    }
    adapterWasNull=true;
    MessagesListAdapter.HoldersConfig holdersConfig=new MessagesListAdapter.HoldersConfig();
    holdersConfig.setIncoming(MagicIncomingTextMessageViewHolder.class,R.layout.item_custom_incoming_text_message);
    holdersConfig.setOutcoming(MagicOutcomingTextMessageViewHolder.class,R.layout.item_custom_outcoming_text_message);
    adapter=new MessagesListAdapter<>(conversationUser.getUserId(),holdersConfig,new ImageLoader(){
      @Override public void loadImage(      ImageView imageView,      String url){
        GlideApp.with(NextcloudTalkApplication.getSharedApplication().getApplicationContext()).asBitmap().diskCacheStrategy(DiskCacheStrategy.NONE).load(url).centerInside().override(imageView.getMeasuredWidth(),imageView.getMeasuredHeight()).apply(RequestOptions.bitmapTransform(new CircleCrop())).listener(new RequestListener<Bitmap>(){
          @Override public boolean onLoadFailed(          @Nullable GlideException e,          Object model,          Target<Bitmap> target,          boolean isFirstResource){
            TextDrawable drawable=TextDrawable.builder().beginConfig().bold().width(imageView.getMeasuredWidth()).height(imageView.getMeasuredHeight()).endConfig().buildRound("String_Node_Str",getResources().getColor(R.color.nc_grey));
            imageView.setImageDrawable(drawable);
            return true;
          }
          @Override public boolean onResourceReady(          Bitmap resource,          Object model,          Target<Bitmap> target,          DataSource dataSource,          boolean isFirstResource){
            return false;
          }
        }
).into(imageView);
      }
    }
);
  }
  messagesList.setAdapter(adapter);
  adapter.setLoadMoreListener(this);
  adapter.setDateHeadersFormatter(this::format);
  adapter.setOnMessageLongClickListener(this);
  layoutManager=(LinearLayoutManager)messagesList.getLayoutManager();
  popupBubble.setRecyclerView(messagesList);
  popupBubble.setPopupBubbleListener(context -> {
    if (newMessagesCount != 0) {
      int scrollPosition;
      if (newMessagesCount - 1 < 0) {
        scrollPosition=0;
      }
 else {
        scrollPosition=newMessagesCount - 1;
      }
      new Handler().postDelayed(() -> messagesList.smoothScrollToPosition(scrollPosition),200);
    }
  }
);
  messagesList.addOnScrollListener(new RecyclerView.OnScrollListener(){
    @Override public void onScrollStateChanged(    RecyclerView recyclerView,    int newState){
      super.onScrollStateChanged(recyclerView,newState);
      if (newState == AbsListView.OnScrollListener.SCROLL_STATE_IDLE) {
        if (newMessagesCount != 0) {
          if (layoutManager.findFirstCompletelyVisibleItemPosition() < newMessagesCount) {
            newMessagesCount=0;
            if (popupBubble != null && popupBubble.isShown()) {
              popupBubble.hide();
            }
          }
        }
      }
    }
  }
);
  messageInput.getInputEditText().setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);
  messageInput.setInputListener(input -> {
    sendMessage(input.toString(),1);
    return true;
  }
);
  if (adapterWasNull && startCallFromNotification == null) {
    setupMentionAutocomplete();
    joinRoomWithPassword();
  }
 else {
    handleFromNotification();
  }
}