nus-yam/ex-repair huggingface dataset:
Program: 171654
Project: 171654
Buggy source:
public AddItemInteractorImpl(Executor threadExecutor,MainThread mainThread,Callback callback,TodoListRepository repository,String title,int position,Date deadline,boolean important,String details,String parentTodoListUuid,String parentHeaderUuid){
  super(threadExecutor,mainThread);
  this.callback=callback;
  this.repository=repository;
  this.title=title;
  this.position=position;
  this.deadline=deadline;
  this.important=important;
  this.details=details;
  this.parentTodoListUuid=parentTodoListUuid;
  this.parentHeaderUuid=parentHeaderUuid;
}

Fixed version (ground truth):
public AddItemInteractorImpl(Executor threadExecutor,MainThread mainThread,Callback callback,TodoListRepository repository,String title,int position,boolean important,String details,String parentTodoListUuid,String parentHeaderUuid){
  super(threadExecutor,mainThread);
  this.callback=callback;
  this.repository=repository;
  this.title=title;
  this.position=position;
  this.important=important;
  this.details=details;
  this.parentTodoListUuid=parentTodoListUuid;
  this.parentHeaderUuid=parentHeaderUuid;
}
Program: 171655
Project: 171655
Buggy source:
public EditHeaderInteractorImpl(Executor threadExecutor,MainThread mainThread,Callback callback,TodoListRepository repository,String uuid,String title,int position,int color,String parentTodoListUuid){
  super(threadExecutor,mainThread);
  this.callback=callback;
  this.repository=repository;
  this.uuid=uuid;
  this.title=title;
  this.position=position;
  this.color=color;
  this.parentTodoListUuid=parentTodoListUuid;
}

Fixed version (ground truth):
public EditHeaderInteractorImpl(Executor threadExecutor,MainThread mainThread,Callback callback,TodoListRepository repository,String uuid,String title,int position,String parentTodoListUuid){
  super(threadExecutor,mainThread);
  this.callback=callback;
  this.repository=repository;
  this.uuid=uuid;
  this.title=title;
  this.position=position;
  this.parentTodoListUuid=parentTodoListUuid;
}
Program: 171656
Project: 171656
Buggy source:
public EditItemInteractorImpl(Executor threadExecutor,MainThread mainThread,Callback callback,TodoListRepository repository,String uuid,String title,int position,Date deadline,boolean important,String details,String parentTodoListUuid,String parentHeaderUuid){
  super(threadExecutor,mainThread);
  this.callback=callback;
  this.repository=repository;
  this.uuid=uuid;
  this.title=title;
  this.position=position;
  this.deadline=deadline;
  this.important=important;
  this.details=details;
  this.parentTodoListUuid=parentTodoListUuid;
  this.parentHeaderUuid=parentHeaderUuid;
}

Fixed version (ground truth):
public EditItemInteractorImpl(Executor threadExecutor,MainThread mainThread,Callback callback,TodoListRepository repository,String uuid,String title,int position,boolean important,String details,boolean done,String parentTodoListUuid,String parentHeaderUuid){
  super(threadExecutor,mainThread);
  this.callback=callback;
  this.repository=repository;
  this.uuid=uuid;
  this.title=title;
  this.position=position;
  this.important=important;
  this.details=details;
  this.done=done;
  this.parentTodoListUuid=parentTodoListUuid;
  this.parentHeaderUuid=parentHeaderUuid;
}
Program: 171657
Project: 171657
Buggy source:
public TodoList increaseAccessCounter(){
  return new TodoList(uuid,title,createdAt,changedAt,position,accessCounter + INCREASE);
}

Fixed version (ground truth):
public TodoList increaseAccessCounter(){
  if (accessCounter == Long.MAX_VALUE)   return this;
  return new TodoList(uuid,title,createdAt,changedAt,position,accessCounter + INCREASE);
}
Program: 171658
Project: 171658
Buggy source:
public TodoList update(String title,int position){
  if (this.equals(new TodoList(uuid,title,createdAt,changedAt,position,accessCounter)))   return this;
  return new TodoList(uuid,title,createdAt,new Date(),position,accessCounter);
}

Fixed version (ground truth):
public TodoList update(String title,int position){
  if (this.equals(new TodoList(uuid,title,createdAt,changedAt,position,accessCounter)))   return this;
  return new TodoList(uuid,title,createdAt,changedAt,position,accessCounter);
}
Program: 171659
Project: 171659
Buggy source:
public void onClick(DialogInterface dialog,int whichButton){
  dialog.dismiss();
}

Fixed version (ground truth):
public void onClick(DialogInterface dialog,int whichButton){
  inputManager.hideSoftInputFromWindow(editText.getWindowToken(),0);
  dialog.dismiss();
}
Program: 171660
Project: 171660
Buggy source:
static void showTextInputDialog(final Fragment fragment,String dialogTitle,final InputDialogCallback callback,@Nullable String itemTitle){
  AlertDialog.Builder dialogBuilder=new AlertDialog.Builder(fragment.getContext());
  LayoutInflater inflater=fragment.getActivity().getLayoutInflater();
  final View dialogView=inflater.inflate(R.layout.add_dialog,null);
  dialogBuilder.setView(dialogView);
  final EditText editText=dialogView.findViewById(R.id.header_edit);
  if (itemTitle != null)   editText.append(itemTitle);
  dialogBuilder.setTitle(dialogTitle);
  dialogBuilder.setPositiveButton(R.string.done,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      if (editText.getText().toString().isEmpty()) {
        Toast.makeText(fragment.getActivity(),R.string.title_mandatory,Toast.LENGTH_SHORT).show();
      }
 else {
        callback.update(editText.getText().toString());
      }
    }
  }
);
  dialogBuilder.setNegativeButton(R.string.cancel,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      dialog.dismiss();
    }
  }
);
  dialogBuilder.create().show();
}

Fixed version (ground truth):
static void showTextInputDialog(final Fragment fragment,String dialogTitle,final InputDialogCallback callback,@Nullable String itemTitle){
  AlertDialog.Builder dialogBuilder=new AlertDialog.Builder(fragment.getContext());
  LayoutInflater inflater=fragment.getActivity().getLayoutInflater();
  final View dialogView=inflater.inflate(R.layout.input_dialog,null);
  dialogBuilder.setView(dialogView);
  final InputMethodManager inputManager=(InputMethodManager)fragment.getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
  final EditText editText=dialogView.findViewById(R.id.header_edit);
  if (itemTitle != null)   editText.append(itemTitle);
  editText.requestFocus();
  dialogBuilder.setTitle(dialogTitle);
  dialogBuilder.setPositiveButton(R.string.done,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      if (editText.getText().toString().isEmpty()) {
        Toast.makeText(fragment.getActivity(),R.string.title_mandatory,Toast.LENGTH_SHORT).show();
      }
 else {
        callback.update(editText.getText().toString());
      }
      inputManager.hideSoftInputFromWindow(editText.getWindowToken(),0);
    }
  }
);
  dialogBuilder.setNegativeButton(R.string.cancel,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      inputManager.hideSoftInputFromWindow(editText.getWindowToken(),0);
      dialog.dismiss();
    }
  }
);
  dialogBuilder.create().show();
  inputManager.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
}
Program: 171661
Project: 171661
Buggy source:
public static void showEditHeaderDialog(Fragment fragment,final String uuid,final String title,final int position,final boolean expanded){
  final HeaderPresenter presenter=instantiatePresenterWith(fragment);
  BaseDialogs.InputDialogCallback callback=new BaseDialogs.InputDialogCallback(){
    @Override public void update(    String title){
      presenter.editHeader(uuid,title,position,expanded);
    }
  }
;
  showTextInputDialog(fragment,getString(fragment,R.string.edit_category),callback,title);
}

Fixed version (ground truth):
public static void showEditHeaderDialog(Fragment fragment,final String uuid,final String oldTitle,final int position,final boolean expanded){
  final HeaderPresenter presenter=instantiatePresenterWith(fragment);
  BaseDialogs.InputDialogCallback callback=new BaseDialogs.InputDialogCallback(){
    @Override public void update(    String title){
      presenter.editHeader(uuid,title,position,expanded);
    }
  }
;
  showTextInputDialog(fragment,getString(fragment,R.string.edit_category),callback,oldTitle);
}
Program: 171662
Project: 171662
Buggy source:
public static void showAddTodoListDialog(Fragment fragment){
  final TodoListPresenter presenter=new TodoListPresenterImpl(ThreadExecutor.getInstance(),MainThreadImpl.getInstance(),(TodoListPresenter.View)fragment,new PreviewRepositoryImpl());
  BaseDialogs.InputDialogCallback callback=new BaseDialogs.InputDialogCallback(){
    @Override public void update(    String title){
      presenter.addTodoList(title);
    }
  }
;
  showTextInputDialog(fragment,getString(fragment,R.string.add_topic),callback);
}

Fixed version (ground truth):
public static void showAddTodoListDialog(Fragment fragment){
  final TodoListPresenter presenter=instantiatePresenterUsing(fragment);
  BaseDialogs.InputDialogCallback callback=new BaseDialogs.InputDialogCallback(){
    @Override public void update(    String title){
      presenter.addTodoList(title);
    }
  }
;
  showTextInputDialog(fragment,getString(fragment,R.string.add_topic),callback);
}
Program: 171663
Project: 171663
Buggy source:
@Override public void update(String title){
  presenter.addTodoList(title);
}

Fixed version (ground truth):
@Override public void update(String title){
  presenter.editTodoList(uuid,title,position);
}
Program: 171664
Project: 171664
Buggy source:
private void addOrEditItemWithCurrentViewInput(){
  String title=titleEditText.getText().toString();
  if (title.isEmpty()) {
    Toast.makeText(getActivity(),R.string.title_mandatory,Toast.LENGTH_SHORT).show();
    return;
  }
  TodoListHeader header=((TodoListHeader)headerSpinner.getSelectedItem());
  boolean important=importantSwitch.isChecked();
  String details=detailsEditText.getText().toString();
  if (isEditMode()) {
    mPresenter.editItem(itemUuid,title,item.getPosition(),important,details,item.isDone(),todoListUuid,item.getParentHeaderUuid());
  }
 else {
    mPresenter.expandHeaderOfItem(header.getUuid(),header.getTitle(),header.getPosition());
    mPresenter.addItem(title,important,details,todoListUuid,header.getUuid());
  }
}

Fixed version (ground truth):
private void addOrEditItemWithCurrentViewInput(){
  String title=titleEditText.getText().toString();
  if (title.isEmpty()) {
    Toast.makeText(getActivity(),R.string.title_mandatory,Toast.LENGTH_SHORT).show();
    return;
  }
  TodoListHeader header=((TodoListHeader)headerSpinner.getSelectedItem());
  boolean important=importantSwitch.isChecked();
  String details=detailsEditText.getText().toString();
  if (isEditMode()) {
    mPresenter.editItem(itemUuid,title,item.getPosition(),important,details,item.isDone(),todoListUuid,header.getUuid());
  }
 else {
    mPresenter.expandHeaderOfItem(header.getUuid(),header.getTitle(),header.getPosition());
    mPresenter.addItem(title,important,details,todoListUuid,header.getUuid());
  }
}
Program: 171665
Project: 171665
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  final View view=inflater.inflate(R.layout.fragment_add_item,container,false);
  ButterKnife.bind(this,view);
  saveButton.setOnClickListener(this);
  copyTitleButton.setOnClickListener(this);
  copyDetailsButton.setOnClickListener(this);
  loadItems();
  changeAppbarTitle(getActivity(),isEditMode() ? R.string.fragment_edit_item : R.string.fragment_add_item);
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  final View view=inflater.inflate(R.layout.fragment_item,container,false);
  InputMethodManager inputManager=(InputMethodManager)getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
  ButterKnife.bind(this,view);
  saveButton.setOnClickListener(this);
  copyTitleButton.setOnClickListener(this);
  copyDetailsButton.setOnClickListener(this);
  inputManager.toggleSoftInput(InputMethodManager.SHOW_FORCED,InputMethodManager.HIDE_IMPLICIT_ONLY);
  titleEditText.requestFocus();
  loadItems();
  changeAppbarTitle(getActivity(),isEditMode() ? R.string.fragment_edit_item : R.string.fragment_add_item);
  return view;
}
Program: 171666
Project: 171666
Buggy source:
@Override public void onTodoListAdded(String uuid,String title){
  mListener.onTodoListSelected(uuid,title);
}

Fixed version (ground truth):
@Override public void onTodoListAdded(String uuid,String title){
  mPresenter.resume();
}
Program: 171667
Project: 171667
Buggy source:
@Override public void onTodoListEdited(String uuid,String title){
}

Fixed version (ground truth):
@Override public void onTodoListEdited(String uuid,String title){
  mPresenter.resume();
}
Program: 171668
Project: 171668
Buggy source:
@Override public void onCreate(){
  super.onCreate();
  Realm.init(this);
  RealmConfiguration realmConfiguration=new RealmConfiguration.Builder().name(Realm.DEFAULT_REALM_NAME).schemaVersion(0).migration(new RealmMigrator()).build();
  Realm.setDefaultConfiguration(realmConfiguration);
}

Fixed version (ground truth):
@Override public void onCreate(){
  super.onCreate();
  Realm.init(this);
  RealmConfiguration realmConfiguration=new RealmConfiguration.Builder().name(Realm.DEFAULT_REALM_NAME).schemaVersion(SCHEMA_VERSION).migration(new RealmMigrator()).build();
  Realm.setDefaultConfiguration(realmConfiguration);
}
Program: 171669
Project: 171669
Buggy source:
@Override public void onTodoListRetrieved(List<TodoListSection> sections){
  Collections.sort(sections,new PositionComparator());
  List<AbstractFlexibleItem> headerVMs=new ArrayList<>(sections.size());
  for (  TodoListSection section : sections) {
    TodoListHeaderViewModel headerVM=new TodoListHeaderViewModel(section.getHeader());
    headerVM.setSubItems(createSubItemList(headerVM,Lists.newArrayList(section.getItems())));
    headerVMs.add(headerVM);
  }
  if (reload) {
    mView.onTodoListReloaded(headerVMs);
  }
 else {
    reload=true;
    mView.onTodoListLoaded(headerVMs);
  }
}

Fixed version (ground truth):
@Override public void onTodoListRetrieved(List<TodoListSection> sections){
  Collections.sort(sections,new PositionComparator());
  List<AbstractFlexibleItem> headerVMs=new ArrayList<>(sections.size());
  for (  TodoListSection section : sections) {
    TodoListHeaderViewModel headerVM=new TodoListHeaderViewModel(section.getHeader());
    headerVM.setSubItems(createSubItemList(headerVM,Lists.newArrayList(section.getItems())));
    headerVMs.add(headerVM);
  }
  if (reload && sections.size() > 1) {
    mView.onTodoListReloaded(headerVMs);
  }
 else {
    reload=true;
    mView.onTodoListLoaded(headerVMs);
  }
}
Program: 171670
Project: 171670
Buggy source:
private void addOrEditItemWithCurrentViewInput(){
  String title=titleEditText.getText().toString();
  if (title.isEmpty()) {
    Toast.makeText(getActivity(),R.string.title_mandatory,Toast.LENGTH_SHORT).show();
    return;
  }
  TodoListHeader header=((TodoListHeader)headerSpinner.getSelectedItem());
  boolean important=importantSwitch.isChecked();
  String details=richEditor.getHtml();
  if (isEditMode()) {
    mPresenter.editItem(itemUuid,title,item.getPosition(),important,details,item.isDone(),todoListUuid,header.getUuid());
  }
 else {
    mPresenter.expandHeaderOfItem(header.getUuid(),header.getTitle(),header.getPosition());
    mPresenter.addItem(title,important,details,todoListUuid,header.getUuid());
  }
}

Fixed version (ground truth):
private void addOrEditItemWithCurrentViewInput(){
  String title=titleEditText.getText().toString();
  if (title.isEmpty()) {
    Toast.makeText(getActivity(),R.string.title_mandatory,Toast.LENGTH_SHORT).show();
    return;
  }
  TodoListHeader header=((TodoListHeader)headerSpinner.getSelectedItem());
  boolean important=importantSwitch.isChecked();
  String details=(richEditor.getHtml() != null) ? richEditor.getHtml() : "String_Node_Str";
  if (isEditMode()) {
    mPresenter.editItem(itemUuid,title,item.getPosition(),important,details,item.isDone(),todoListUuid,header.getUuid());
  }
 else {
    mPresenter.expandHeaderOfItem(header.getUuid(),header.getTitle(),header.getPosition());
    mPresenter.addItem(title,important,details,todoListUuid,header.getUuid());
  }
}
Program: 171671
Project: 171671
Buggy source:
@Override public void onPostAction(){
  mAdapter.clearSelection();
}

Fixed version (ground truth):
@Override public void onPostAction(){
  mAdapter.clearSelection();
  mRecyclerView.onAdapterMaybeEmpty();
}
Program: 171672
Project: 171672
Buggy source:
@Override public void onPreviewsLoaded(List<TodoListPreviewViewModel> previews){
  SharedPreferences sharedPreferences=PreferenceManager.getDefaultSharedPreferences(getContext());
  boolean permanentDelete=!sharedPreferences.getBoolean(KEY_PREF_TODO,true);
  this.previews=previews;
  this.mAdapter=new FlexibleAdapter<>(previews);
  mRecyclerView.setupRecyclerView(mEmptyView,mAdapter,mFabButton);
  mRecyclerView.setupFlexibleAdapter(this,mAdapter,permanentDelete);
}

Fixed version (ground truth):
@Override public void onPreviewsLoaded(List<TodoListPreviewViewModel> previews){
  SharedPreferences sharedPreferences=PreferenceManager.getDefaultSharedPreferences(getContext());
  boolean permanentDelete=!sharedPreferences.getBoolean(KEY_PREF_TODO,true);
  this.previews=previews;
  this.mAdapter=new FlexibleAdapter<>(previews);
  mRecyclerView.configure(mEmptyView,mAdapter,mFabButton);
  setupFlexibleAdapter(this,mAdapter,permanentDelete);
}
Program: 171673
Project: 171673
Buggy source:
private void deleteItem(int position){
  if (mAdapter.isPermanentDelete()) {
    permanentDeleteItem(position);
    return;
  }
  mAdapter.addSelection(position);
  String message=getString(R.string.deleted_snackbar,mAdapter.getItem(position));
  UndoHelper.OnActionListener removeListener=new UndoHelper.SimpleActionListener(){
    @Override public void onPostAction(){
      mAdapter.clearSelection();
    }
  }
;
  new UndoHelper(mAdapter,this).withPayload(Payload.CHANGE).withAction(UndoHelper.ACTION_REMOVE,removeListener).remove(mAdapter.getSelectedPositions(),getView(),message,getString(R.string.undo),UndoHelper.UNDO_TIMEOUT);
}

Fixed version (ground truth):
private void deleteItem(int position){
  if (mAdapter.isPermanentDelete()) {
    permanentDeleteItem(position);
    return;
  }
  mAdapter.addSelection(position);
  String message=getString(R.string.deleted_snackbar,mAdapter.getItem(position));
  UndoHelper.OnActionListener removeListener=new UndoHelper.SimpleActionListener(){
    @Override public void onPostAction(){
      mAdapter.clearSelection();
      mRecyclerView.onAdapterMaybeEmpty();
    }
  }
;
  new UndoHelper(mAdapter,this).withPayload(Payload.CHANGE).withAction(UndoHelper.ACTION_REMOVE,removeListener).remove(mAdapter.getSelectedPositions(),getView(),message,getString(R.string.undo),UndoHelper.UNDO_TIMEOUT);
}
Program: 171674
Project: 171674
Buggy source:
@Override public void onPostAction(){
  mActionModeHelper.destroyActionModeIfCan();
}

Fixed version (ground truth):
@Override public void onPostAction(){
  mActionModeHelper.destroyActionModeIfCan();
  mRecyclerView.onAdapterMaybeEmpty();
}
Program: 171675
Project: 171675
Buggy source:
@Override public void onTodoListLoaded(List<AbstractFlexibleItem> items){
  SharedPreferences sharedPreferences=PreferenceManager.getDefaultSharedPreferences(getContext());
  boolean permanentDelete=!sharedPreferences.getBoolean(KEY_PREF_HEADER_OR_ITEM,true);
  mAdapter=new FlexibleAdapter<>(items);
  mRecyclerView.setupRecyclerView(mEmptyView,mAdapter,mFabMenu);
  mRecyclerView.setupFlexibleAdapter(this,mAdapter,permanentDelete);
  initializeActionModeHelper();
}

Fixed version (ground truth):
@Override public void onTodoListLoaded(List<AbstractFlexibleItem> items){
  SharedPreferences sharedPreferences=PreferenceManager.getDefaultSharedPreferences(getContext());
  boolean permanentDelete=!sharedPreferences.getBoolean(KEY_PREF_HEADER_OR_ITEM,true);
  mAdapter=new FlexibleAdapter<>(items);
  mRecyclerView.configure(mEmptyView,mAdapter,mFabMenu);
  setupFlexibleAdapter(this,mAdapter,permanentDelete);
  initializeActionModeHelper();
}
Program: 171676
Project: 171676
Buggy source:
@Override public void onTodoListReloaded(List<AbstractFlexibleItem> items){
  mAdapter.updateDataSet(items,true);
}

Fixed version (ground truth):
@Override public void onTodoListReloaded(List<AbstractFlexibleItem> items){
  mAdapter.clearSelection();
  mAdapter.updateDataSet(items,true);
}
Program: 171677
Project: 171677
Buggy source:
private void deleteSelectedItemOrHeader(){
  int position=mAdapter.getSelectedPositions().get(0);
  if (mAdapter.isPermanentDelete()) {
    permanentDeleteItem(position);
    return;
  }
  String message=getString(R.string.deleted_snackbar,mAdapter.getItem(position));
  UndoHelper.OnActionListener removeListener=new UndoHelper.SimpleActionListener(){
    @Override public void onPostAction(){
      mActionModeHelper.destroyActionModeIfCan();
    }
  }
;
  new UndoHelper(mAdapter,this).withPayload(Payload.CHANGE).withAction(UndoHelper.ACTION_REMOVE,removeListener).remove(mAdapter.getSelectedPositions(),getView(),message,getString(R.string.undo),UndoHelper.UNDO_TIMEOUT);
}

Fixed version (ground truth):
private void deleteSelectedItemOrHeader(){
  int position=mAdapter.getSelectedPositions().get(0);
  if (mAdapter.isPermanentDelete()) {
    permanentDeleteItem(position);
    return;
  }
  String message=getString(R.string.deleted_snackbar,mAdapter.getItem(position));
  UndoHelper.OnActionListener removeListener=new UndoHelper.SimpleActionListener(){
    @Override public void onPostAction(){
      mActionModeHelper.destroyActionModeIfCan();
      mRecyclerView.onAdapterMaybeEmpty();
    }
  }
;
  new UndoHelper(mAdapter,this).withPayload(Payload.CHANGE).withAction(UndoHelper.ACTION_REMOVE,removeListener).remove(mAdapter.getSelectedPositions(),getView(),message,getString(R.string.undo),UndoHelper.UNDO_TIMEOUT);
}
Program: 171678
Project: 171678
Buggy source:
public void setupRecyclerView(View emptyView,RecyclerView.Adapter adapter,FloatingActionButton fab){
  RecyclerView.LayoutManager layoutManager=new LinearLayoutManager(getContext());
  FlexibleItemDecoration decoration=new FlexibleItemDecoration(getContext());
  decoration.withDefaultDivider();
  decoration.withDrawOver(true);
  setHasFixedSize(true);
  setLayoutManager(layoutManager);
  setEmptyView(emptyView);
  setAdapter(adapter);
  addItemDecoration(decoration);
  addOnScrollListener(new RecyclerViewScrollListener(fab));
}

Fixed version (ground truth):
public void setupRecyclerView(View emptyView,RecyclerView.Adapter adapter,View view){
  RecyclerView.LayoutManager layoutManager=new LinearLayoutManager(getContext());
  FlexibleItemDecoration decoration=new FlexibleItemDecoration(getContext());
  decoration.withDefaultDivider();
  decoration.withDrawOver(true);
  setHasFixedSize(true);
  setLayoutManager(layoutManager);
  setEmptyView(emptyView);
  setAdapter(adapter);
  addItemDecoration(decoration);
  addOnScrollListener(new RecyclerViewScrollListener(view));
}
Program: 171679
Project: 171679
Buggy source:
@Override public void onScrollStateChanged(RecyclerView recyclerView,int newState){
  fab.show(true);
  if (newState == RecyclerView.SCROLL_STATE_IDLE && recyclerView.getAdapter().getItemCount() != 0) {
    int lastVisibleItemPosition=((LinearLayoutManager)recyclerView.getLayoutManager()).findLastCompletelyVisibleItemPosition();
    int firstVisibleItemPosition=((LinearLayoutManager)recyclerView.getLayoutManager()).findFirstCompletelyVisibleItemPosition();
    if (lastVisibleItemPosition != RecyclerView.NO_POSITION && lastVisibleItemPosition == recyclerView.getAdapter().getItemCount() - 1 && firstVisibleItemPosition != 0)     fab.hide(true);
  }
  super.onScrollStateChanged(recyclerView,newState);
}

Fixed version (ground truth):
@Override public void onScrollStateChanged(RecyclerView recyclerView,int newState){
  show(view);
  if (newState == RecyclerView.SCROLL_STATE_IDLE && recyclerView.getAdapter().getItemCount() != 0) {
    int lastVisibleItemPosition=((LinearLayoutManager)recyclerView.getLayoutManager()).findLastCompletelyVisibleItemPosition();
    int firstVisibleItemPosition=((LinearLayoutManager)recyclerView.getLayoutManager()).findFirstCompletelyVisibleItemPosition();
    if (lastVisibleItemPosition != RecyclerView.NO_POSITION && lastVisibleItemPosition == recyclerView.getAdapter().getItemCount() - 1 && firstVisibleItemPosition != 0)     hide(view);
  }
  super.onScrollStateChanged(recyclerView,newState);
}
Program: 171680
Project: 171680
Buggy source:
public RecyclerViewScrollListener(FloatingActionButton fab){
  this.fab=fab;
}

Fixed version (ground truth):
public RecyclerViewScrollListener(View view){
  this.view=view;
}
Program: 171681
Project: 171681
Buggy source:
private static void showTextInputDialog(Fragment fragment,String title,final InputDialogCallback callback){
  AlertDialog.Builder dialogBuilder=new AlertDialog.Builder(fragment.getContext());
  LayoutInflater inflater=fragment.getActivity().getLayoutInflater();
  final View dialogView=inflater.inflate(R.layout.add_dialog,null);
  dialogBuilder.setView(dialogView);
  final EditText editText=dialogView.findViewById(R.id.header_edit);
  dialogBuilder.setTitle(title);
  dialogBuilder.setPositiveButton(R.string.done,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      callback.add(editText.getText().toString());
    }
  }
);
  dialogBuilder.setNegativeButton(R.string.cancel,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      dialog.dismiss();
    }
  }
);
  dialogBuilder.create().show();
}

Fixed version (ground truth):
private static void showTextInputDialog(final Fragment fragment,String title,final InputDialogCallback callback){
  AlertDialog.Builder dialogBuilder=new AlertDialog.Builder(fragment.getContext());
  LayoutInflater inflater=fragment.getActivity().getLayoutInflater();
  final View dialogView=inflater.inflate(R.layout.add_dialog,null);
  dialogBuilder.setView(dialogView);
  final EditText editText=dialogView.findViewById(R.id.header_edit);
  dialogBuilder.setTitle(title);
  dialogBuilder.setPositiveButton(R.string.done,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      if (editText.getText().toString().isEmpty()) {
        Toast.makeText(fragment.getActivity(),R.string.title_mandatory,Toast.LENGTH_SHORT).show();
      }
 else {
        callback.add(editText.getText().toString());
      }
    }
  }
);
  dialogBuilder.setNegativeButton(R.string.cancel,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      dialog.dismiss();
    }
  }
);
  dialogBuilder.create().show();
}
Program: 171682
Project: 171682
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  final View view=inflater.inflate(R.layout.fragment_preview,container,false);
  ButterKnife.bind(this,view);
  mFabButton.setOnClickListener(this);
  changeAppbarTitle(getActivity(),R.string.app_name);
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  final View view=inflater.inflate(R.layout.fragment_preview,container,false);
  ButterKnife.bind(this,view);
  mFabButton.setShowAnimation(fadeIn());
  mFabButton.setHideAnimation(fadeOut());
  mFabButton.setOnClickListener(this);
  changeAppbarTitle(getActivity(),R.string.app_name);
  return view;
}
Program: 171683
Project: 171683
Buggy source:
@Override public void onTodoListLoaded(List<TodoListHeaderViewModel> items){
  this.items=items;
  mAdapter=new FlexibleAdapter<>(items);
  mRecyclerView.setupFlexibleAdapter(this,mAdapter);
  mRecyclerView.setupRecyclerView(mEmptyView,mAdapter,mFabHeader);
  mAdapter.setSwipeEnabled(true);
  mAdapter.getItemTouchHelperCallback().setSwipeThreshold(0.666F);
}

Fixed version (ground truth):
@Override public void onTodoListLoaded(List<TodoListHeaderViewModel> items){
  this.items=items;
  mAdapter=new FlexibleAdapter<>(items);
  mRecyclerView.setupFlexibleAdapter(this,mAdapter);
  mRecyclerView.setupRecyclerView(mEmptyView,mAdapter,mFabMenu);
  mAdapter.setSwipeEnabled(true);
  mAdapter.getItemTouchHelperCallback().setSwipeThreshold(0.666F);
}
Program: 171684
Project: 171684
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  final View view=inflater.inflate(R.layout.fragment_todo_list,container,false);
  ButterKnife.bind(this,view);
  mFabHeader.setOnClickListener(this);
  mFabHeaderMenu.setOnClickListener(this);
  mFabItemMenu.setOnClickListener(this);
  changeAppbarTitle(getActivity(),title);
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  final View view=inflater.inflate(R.layout.fragment_todo_list,container,false);
  ButterKnife.bind(this,view);
  mFabHeader.setHideAnimation(fadeOut());
  mFabHeader.setShowAnimation(fadeIn());
  mFabMenu.setMenuButtonHideAnimation(fadeOut());
  mFabMenu.setMenuButtonShowAnimation(fadeIn());
  mFabHeader.setOnClickListener(this);
  mFabHeaderMenu.setOnClickListener(this);
  mFabItemMenu.setOnClickListener(this);
  changeAppbarTitle(getActivity(),title);
  return view;
}
Program: 171685
Project: 171685
Buggy source:
@Override public void onTimeout(){
  stopTimeout();
  loginButton.setEnabled(true);
  progress.setVisibility(View.GONE);
  Snackbar.make(coordinatorLayout,R.string.timeout_error,Snackbar.LENGTH_LONG).show();
  steamService.disconnect();
}

Fixed version (ground truth):
@Override public void onTimeout(){
  stopTimeout();
  loginButton.setEnabled(true);
  progress.setVisibility(View.GONE);
  Snackbar.make(coordinatorLayout,R.string.timeout_error,Snackbar.LENGTH_LONG).show();
}
Program: 171686
Project: 171686
Buggy source:
public void logoff(){
  Log.i(TAG,"String_Node_Str");
  steamId=0;
  stopFarming();
  steamUser.logOff();
  Prefs.writeUsername("String_Node_Str");
  Prefs.writeLoginKey("String_Node_Str");
  disconnect();
  updateNotification(getString(R.string.logged_out));
}

Fixed version (ground truth):
public void logoff(){
  Log.i(TAG,"String_Node_Str");
  steamId=0;
  logOnDetails=null;
  stopFarming();
  steamUser.logOff();
  Prefs.writeUsername("String_Node_Str");
  Prefs.writeLoginKey("String_Node_Str");
  updateNotification(getString(R.string.logged_out));
}
Program: 171688
Project: 171688
Buggy source:
public void login(final LogOnDetails details){
  Log.i(TAG,"String_Node_Str");
  details.loginId=NOTIF_ID;
  loginHandle=executor.submit(new Runnable(){
    @Override public void run(){
      waitForConnection();
      steamUser.logOn(details,Prefs.getMachineId());
    }
  }
);
}

Fixed version (ground truth):
public void login(final LogOnDetails details){
  Log.i(TAG,"String_Node_Str");
  details.loginId=NOTIF_ID;
  logOnDetails=details;
  if (!connected) {
    connect();
  }
 else {
    reconnect();
  }
}
Program: 171689
Project: 171689
Buggy source:
/** 
 * Try to login using saved details in prefs
 */
private void attemptRestoreLogin(){
  Prefs.init(this);
  final String username=Prefs.getUsername();
  final String loginKey=Prefs.getLoginKey();
  final byte[] sentryData=readSentryFile();
  if (username.isEmpty() || loginKey.isEmpty()) {
    return;
  }
  Log.i(TAG,"String_Node_Str");
  final LogOnDetails details=new LogOnDetails();
  details.username(username);
  details.loginkey=loginKey;
  if (sentryData != null) {
    details.sentryFileHash=CryptoHelper.SHAHash(sentryData);
  }
  details.shouldRememberPassword=true;
  login(details);
}

Fixed version (ground truth):
/** 
 * Log in using saved credentials
 */
private void attemptRestoreLogin(){
  final String username=Prefs.getUsername();
  final String loginKey=Prefs.getLoginKey();
  final byte[] sentryData=readSentryFile();
  if (username.isEmpty() || loginKey.isEmpty()) {
    return;
  }
  Log.i(TAG,"String_Node_Str");
  final LogOnDetails details=new LogOnDetails();
  details.username(username);
  details.loginkey=loginKey;
  if (sentryData != null) {
    details.sentryFileHash=CryptoHelper.SHAHash(sentryData);
  }
  details.shouldRememberPassword=true;
  details.loginId=NOTIF_ID;
  steamUser.logOn(details,Prefs.getMachineId());
}
Program: 171690
Project: 171690
Buggy source:
@Override public void onDestroy(){
  Log.i(TAG,"String_Node_Str");
  stopForeground(true);
  running=false;
  stopFarming();
  executor.shutdownNow();
  scheduler.shutdownNow();
  wakeLock.release();
  try {
    unregisterReceiver(receiver);
  }
 catch (  IllegalArgumentException e) {
    e.printStackTrace();
  }
  super.onDestroy();
}

Fixed version (ground truth):
@Override public void onDestroy(){
  Log.i(TAG,"String_Node_Str");
  new Thread(new Runnable(){
    @Override public void run(){
      steamClient.disconnect();
    }
  }
).start();
  stopForeground(true);
  running=false;
  stopFarming();
  executor.shutdownNow();
  scheduler.shutdownNow();
  wakeLock.release();
  try {
    unregisterReceiver(receiver);
  }
 catch (  IllegalArgumentException e) {
    e.printStackTrace();
  }
  super.onDestroy();
}
Program: 171691
Project: 171691
Buggy source:
public void start(){
  running=true;
  executor.execute(new Runnable(){
    @Override public void run(){
      steamClient.connect();
    }
  }
);
  scheduler.scheduleWithFixedDelay(new Runnable(){
    @Override public void run(){
      try {
        update();
      }
 catch (      Exception e) {
        Log.i(TAG,"String_Node_Str",e);
      }
    }
  }
,500,500,TimeUnit.MILLISECONDS);
}

Fixed version (ground truth):
public void start(){
  running=true;
  if (!Prefs.getLoginKey().isEmpty()) {
    connect();
  }
  scheduler.scheduleWithFixedDelay(new Runnable(){
    @Override public void run(){
      try {
        update();
      }
 catch (      Exception e) {
        Log.i(TAG,"String_Node_Str",e);
      }
    }
  }
,500,500,TimeUnit.MILLISECONDS);
}
Program: 171692
Project: 171692
Buggy source:
@Test public void testInstallAndUpdatePackageNotFound() throws InterruptedException {
  String releaseName="String_Node_Str";
  InstallRequest installRequest=new InstallRequest();
  installRequest.setInstallProperties(createInstallProperties(releaseName));
  PackageIdentifier packageIdentifier=new PackageIdentifier();
  packageIdentifier.setPackageName("String_Node_Str");
  packageIdentifier.setPackageVersion("String_Node_Str");
  installRequest.setPackageIdentifier(packageIdentifier);
  Release release=install(installRequest);
  installRequest.setPackageIdentifier(packageIdentifier);
  assertThat(release).isNotNull();
  assertThat(release.getPkg().getMetadata().getVersion()).isEqualTo("String_Node_Str");
  Info info=this.releaseService.status(releaseName);
  assertThat(info).isNotNull();
  UpgradeProperties upgradeProperties=new UpgradeProperties();
  upgradeProperties.setReleaseName(releaseName);
  UpgradeRequest upgradeRequest=new UpgradeRequest();
  upgradeRequest.setUpgradeProperties(upgradeProperties);
  packageIdentifier=new PackageIdentifier();
  String packageName="String_Node_Str";
  String packageVersion="String_Node_Str";
  packageIdentifier.setPackageName(packageName);
  packageIdentifier.setPackageVersion(packageVersion);
  upgradeRequest.setPackageIdentifier(packageIdentifier);
  try {
    upgrade(upgradeRequest);
    fail("String_Node_Str");
  }
 catch (  SkipperException e) {
    assertThat(e.getMessage()).isEqualTo("String_Node_Str");
  }
  delete(release.getName());
}

Fixed version (ground truth):
@Test public void testInstallAndUpdatePackageNotFound() throws InterruptedException {
  String releaseName="String_Node_Str";
  InstallRequest installRequest=new InstallRequest();
  installRequest.setInstallProperties(createInstallProperties(releaseName));
  PackageIdentifier packageIdentifier=new PackageIdentifier();
  packageIdentifier.setPackageName("String_Node_Str");
  packageIdentifier.setPackageVersion("String_Node_Str");
  installRequest.setPackageIdentifier(packageIdentifier);
  Release release=install(installRequest);
  installRequest.setPackageIdentifier(packageIdentifier);
  assertThat(release).isNotNull();
  assertThat(release.getPkg().getMetadata().getVersion()).isEqualTo("String_Node_Str");
  Info info=this.releaseService.status(releaseName);
  assertThat(info).isNotNull();
  UpgradeProperties upgradeProperties=new UpgradeProperties();
  upgradeProperties.setReleaseName(releaseName);
  UpgradeRequest upgradeRequest=new UpgradeRequest();
  upgradeRequest.setUpgradeProperties(upgradeProperties);
  packageIdentifier=new PackageIdentifier();
  String packageName="String_Node_Str";
  String packageVersion="String_Node_Str";
  packageIdentifier.setPackageName(packageName);
  packageIdentifier.setPackageVersion(packageVersion);
  upgradeRequest.setPackageIdentifier(packageIdentifier);
  try {
    upgrade(upgradeRequest);
    fail("String_Node_Str");
  }
 catch (  SkipperException e) {
    assertThat(e.getMessage()).isEqualTo(String.format("String_Node_Str",packageName,packageVersion));
  }
  delete(release.getName());
}
Program: 171694
Project: 171694
Buggy source:
@Bean public RestTemplate restTemplate(RestTemplateBuilder restTemplateBuilder){
  RestTemplate restTemplate=restTemplateBuilder.build();
  return validateRestTemplate(restTemplate);
}

Fixed version (ground truth):
@Bean public RestTemplate restTemplate(RestTemplateBuilder restTemplateBuilder,ObjectMapper objectMapper){
  RestTemplate restTemplate=restTemplateBuilder.errorHandler(new SkipperClientResponseErrorHandler(objectMapper)).build();
  return validateRestTemplate(restTemplate);
}
Program: 171695
Project: 171695
Buggy source:
/** 
 * Return a Properties object given a String that contains YAML. The Properties created by this factory have nested paths for hierarchical objects. All exposed values are of type  {@code String}</b> for access through the common   {@link Properties#getProperty} method.See YamlPropertiesFactoryBean for more information.
 * @param yamlString String that contains YAML
 * @return properties object containing contents of YAML file
 */
public Properties convertYamlToProperties(String yamlString){
  YamlPropertiesFactoryBean yaml=new YamlPropertiesFactoryBean();
  Properties values;
  if (StringUtils.hasText(yamlString)) {
    try (InputStream is=new ByteArrayInputStream(yamlString.getBytes())){
      yaml.setResources(new InputStreamResource(is));
      yaml.afterPropertiesSet();
      values=yaml.getObject();
    }
 catch (    Exception e) {
      throw new IllegalArgumentException("String_Node_Str" + yamlString,e);
    }
  }
 else {
    values=new Properties();
  }
  return values;
}

Fixed version (ground truth):
/** 
 * Return a Properties object given a String that contains YAML. The Properties created by this factory have nested paths for hierarchical objects. All exposed values are of type   {@code String}</b> for access through the common  {@link Properties#getProperty} method. See YamlPropertiesFactoryBean for moreinformation.
 * @param yamlString String that contains YAML
 * @return properties object containing contents of YAML file
 */
public Properties convertYamlToProperties(String yamlString){
  YamlPropertiesFactoryBean yaml=new YamlPropertiesFactoryBean();
  Properties values;
  if (StringUtils.hasText(yamlString)) {
    try (InputStream is=new ByteArrayInputStream(yamlString.getBytes())){
      yaml.setResources(new InputStreamResource(is));
      yaml.afterPropertiesSet();
      values=yaml.getObject();
    }
 catch (    Exception e) {
      throw new IllegalArgumentException("String_Node_Str" + yamlString,e);
    }
  }
 else {
    values=new Properties();
  }
  return values;
}
Program: 171696
Project: 171696
Buggy source:
@Test public void install() throws Exception {
  InstallProperties installProperties=new InstallProperties();
  PackageMetadata packageMetadata=packageMetadataRepository.findByNameAndVersion("String_Node_Str","String_Node_Str");
  MvcResult result=mockMvc.perform(post("String_Node_Str" + packageMetadata.getId() + "String_Node_Str").content(convertObjectToJson(installProperties))).andDo(print()).andExpect(status().isCreated()).andReturn();
}

Fixed version (ground truth):
@Test public void install() throws Exception {
  InstallProperties installProperties=new InstallProperties();
  installProperties.setPlatformName("String_Node_Str");
  PackageMetadata packageMetadata=packageMetadataRepository.findByNameAndVersion("String_Node_Str","String_Node_Str");
  mockMvc.perform(post("String_Node_Str" + packageMetadata.getId() + "String_Node_Str").content(convertObjectToJson(installProperties))).andDo(print()).andExpect(status().isCreated()).andReturn();
}
Program: 171697
Project: 171697
Buggy source:
private void setGenres(final MovieViewHolder holder,Integer movieId){
  ApiInterface apiService=ApiClient.getClient().create(ApiInterface.class);
  Call<Movie> call=apiService.getMovieDetails(movieId,mContext.getResources().getString(R.string.MOVIE_DB_API_KEY));
  call.enqueue(new Callback<Movie>(){
    @Override public void onResponse(    Call<Movie> call,    Response<Movie> response){
      if (response.code() != 200)       return;
      List<Genre> genresList=response.body().getGenres();
      String genres="String_Node_Str";
      for (int i=0; i < genresList.size(); i++) {
        if (i == genresList.size() - 1) {
          genres=genres.concat(genresList.get(i).getGenreName());
        }
 else {
          genres=genres.concat(genresList.get(i).getGenreName() + "String_Node_Str");
        }
      }
      holder.movieGenreTextView.setText(genres);
    }
    @Override public void onFailure(    Call<Movie> call,    Throwable t){
    }
  }
);
}

Fixed version (ground truth):
private void setGenres(MovieViewHolder holder,Movie movie){
  String genreString="String_Node_Str";
  for (int i=0; i < movie.getGenres().size(); i++) {
    if (i == movie.getGenres().size() - 1)     genreString+=movie.getGenres().get(i).getGenreName();
 else     genreString+=movie.getGenres().get(i).getGenreName() + "String_Node_Str";
  }
  holder.movieGenreTextView.setText(genreString);
}
Program: 171698
Project: 171698
Buggy source:
public MoviesLargeAdapter(Context context,List<MovieBrief> movies){
  mContext=context;
  mMovies=movies;
}

Fixed version (ground truth):
public MoviesLargeAdapter(Context context,List<Movie> movies){
  mContext=context;
  mMovies=movies;
}
Program: 171699
Project: 171699
Buggy source:
@Override public void onBindViewHolder(MovieViewHolder holder,int position){
  Glide.with(mContext.getApplicationContext()).load(Constant.IMAGE_LOADING_BASE_URL_1000 + mMovies.get(position).getBackdropPath()).asBitmap().centerCrop().diskCacheStrategy(DiskCacheStrategy.ALL).into(holder.moviePosterImageView);
  holder.movieTitleTextView.setText(mMovies.get(position).getTitle());
  if (mMovies.get(position).getVoteAverage() > 0)   holder.movieRatingTextView.setText(mMovies.get(position).getVoteAverage() + Constant.RATING_SYMBOL);
 else   holder.movieRatingTextView.setVisibility(View.GONE);
  setGenres(holder,mMovies.get(position).getId());
}

Fixed version (ground truth):
@Override public void onBindViewHolder(MovieViewHolder holder,int position){
  Glide.with(mContext.getApplicationContext()).load(Constant.IMAGE_LOADING_BASE_URL_1000 + mMovies.get(position).getBackdropPath()).asBitmap().centerCrop().diskCacheStrategy(DiskCacheStrategy.ALL).into(holder.moviePosterImageView);
  holder.movieTitleTextView.setText(mMovies.get(position).getTitle());
  if (mMovies.get(position).getVoteAverage() > 0)   holder.movieRatingTextView.setText(mMovies.get(position).getVoteAverage() + Constant.RATING_SYMBOL);
 else   holder.movieRatingTextView.setVisibility(View.GONE);
  setGenres(holder,mMovies.get(position));
}
Program: 171700
Project: 171700
Buggy source:
private void loadUpcomingMovies(){
  ApiInterface apiService=ApiClient.getClient().create(ApiInterface.class);
  Call<UpcomingMoviesResponse> call=apiService.getUpcomingMovies(getResources().getString(R.string.MOVIE_DB_API_KEY),1,"String_Node_Str");
  call.enqueue(new Callback<UpcomingMoviesResponse>(){
    @Override public void onResponse(    Call<UpcomingMoviesResponse> call,    Response<UpcomingMoviesResponse> response){
      if (response.code() != 200)       return;
      mUpcomingLayout.setVisibility(View.VISIBLE);
      for (      MovieBrief movieBrief : response.body().getResults()) {
        if (movieBrief.getBackdropPath() != null)         mUpcomingMovies.add(movieBrief);
      }
      mUpcomingAdapter.notifyDataSetChanged();
    }
    @Override public void onFailure(    Call<UpcomingMoviesResponse> call,    Throwable t){
    }
  }
);
}

Fixed version (ground truth):
private void loadUpcomingMovies(){
  final ApiInterface apiService=ApiClient.getClient().create(ApiInterface.class);
  Call<UpcomingMoviesResponse> call=apiService.getUpcomingMovies(getResources().getString(R.string.MOVIE_DB_API_KEY),1,"String_Node_Str");
  call.enqueue(new Callback<UpcomingMoviesResponse>(){
    @Override public void onResponse(    Call<UpcomingMoviesResponse> call,    Response<UpcomingMoviesResponse> response){
      if (response.code() != 200)       return;
      mUpcomingLayout.setVisibility(View.VISIBLE);
      for (      MovieBrief movie : response.body().getResults()) {
        Call<Movie> call2=apiService.getMovieDetails(movie.getId(),getResources().getString(R.string.MOVIE_DB_API_KEY));
        call2.enqueue(new Callback<Movie>(){
          @Override public void onResponse(          Call<Movie> call,          Response<Movie> response){
            if (response.code() != 200)             return;
            if (response.body().getBackdropPath() != null) {
              mUpcomingMovies.add(response.body());
              mUpcomingAdapter.notifyDataSetChanged();
            }
          }
          @Override public void onFailure(          Call<Movie> call,          Throwable t){
          }
        }
);
      }
    }
    @Override public void onFailure(    Call<UpcomingMoviesResponse> call,    Throwable t){
    }
  }
);
}