nus-yam/ex-repair huggingface dataset:
Program: 170525
Project: 170525
Buggy source:
@Override public void onViewInitialized(){
  super.onViewInitialized();
  new Handler().postDelayed(new Runnable(){
    @Override public void run(){
      isTransitionComplete=true;
      if (isWaitForTransition)       mView.showProfileInfo(user);
      isWaitForTransition=false;
      getProfileInfo();
      checkFollowingStatus();
    }
  }
,500);
}

Fixed version (ground truth):
@Override public void onViewInitialized(){
  super.onViewInitialized();
  new Handler().postDelayed(new Runnable(){
    @Override public void run(){
      if (mView == null)       return;
      isTransitionComplete=true;
      if (isWaitForTransition)       mView.showProfileInfo(user);
      isWaitForTransition=false;
      getProfileInfo();
      checkFollowingStatus();
    }
  }
,500);
}
Program: 170526
Project: 170526
Buggy source:
@Inject public SearchPresenter(DaoSession daoSession){
  super(daoSession);
  createSearchModels();
}

Fixed version (ground truth):
@Inject public SearchPresenter(DaoSession daoSession){
  super(daoSession);
}
Program: 170527
Project: 170527
Buggy source:
@Override public void showCommitInfo(RepoCommitExt commitExt){
  showCommit(commitExt);
  changedFileCount.setText(String.valueOf(commitExt.getFiles().size()));
  addtionsCount.setText(String.valueOf(commitExt.getStats().getAdditions()));
  deletionsCount.setText(String.valueOf(commitExt.getStats().getDeletions()));
  if (first) {
    getSupportFragmentManager().beginTransaction().add(R.id.container,CommitFilesFragment.create(commitExt.getFiles())).commit();
    first=false;
  }
}

Fixed version (ground truth):
@Override public void showCommitInfo(RepoCommitExt commitExt){
  showCommit(commitExt);
  changedFileCount.setText(String.valueOf(commitExt.getFiles().size()));
  addtionsCount.setText(String.valueOf(commitExt.getStats().getAdditions()));
  deletionsCount.setText(String.valueOf(commitExt.getStats().getDeletions()));
  if (commitFilesFragment == null) {
    commitFilesFragment=CommitFilesFragment.create(commitExt.getFiles());
    getSupportFragmentManager().beginTransaction().add(R.id.container,commitFilesFragment).commit();
  }
 else {
    commitFilesFragment.showCommitFiles(commitExt.getFiles());
  }
}
Program: 170528
Project: 170528
Buggy source:
@Override protected void initView(Bundle savedInstanceState){
  super.initView(savedInstanceState);
  setToolbarBackEnable();
  String repoFullName=user.concat("String_Node_Str").concat(repo);
  setToolbarTitle(getString(R.string.compare),repoFullName);
  Fragment fragment=null;
  if (CommitsListType.Compare.equals(type)) {
    fragment=CommitsFragment.createForCompare(user,repo,before,head);
  }
 else {
    return;
  }
  getSupportFragmentManager().beginTransaction().add(R.id.container,fragment).commit();
}

Fixed version (ground truth):
@Override protected void initView(Bundle savedInstanceState){
  super.initView(savedInstanceState);
  String repoFullName=user.concat("String_Node_Str").concat(repo);
  setToolbarTitle(getString(R.string.compare),repoFullName);
}
Program: 170529
Project: 170529
Buggy source:
@Override public void run(){
  getSupportFragmentManager().beginTransaction().add(R.id.container,issueTimelineFragment).commit();
}

Fixed version (ground truth):
@Override public void run(){
  if (!isAlive)   return;
  getSupportFragmentManager().beginTransaction().add(R.id.container,issueTimelineFragment).commit();
}
Program: 170531
Project: 170531
Buggy source:
@Override protected void initView(Bundle savedInstanceState){
  super.initView(savedInstanceState);
  setToolbarScrollAble(true);
  setToolbarBackEnable();
  setToolbarTitle(getString(R.string.issues));
  addBn.setVisibility(IssuesFilter.Type.Repo.equals(issuesType) ? View.VISIBLE : View.GONE);
  if (IssuesFilter.Type.User.equals(issuesType)) {
    pagerAdapter.setPagerList(FragmentPagerModel.createUserIssuesPagerList(getActivity()));
  }
 else {
    pagerAdapter.setPagerList(FragmentPagerModel.createRepoIssuesPagerList(getActivity(),userId,repoName));
    navView.getMenu().findItem(R.id.nav_type_chooser).setVisible(false);
  }
  listeners=new ArrayList<>();
  for (  FragmentPagerModel pagerModel : pagerAdapter.getPagerList()) {
    listeners.add((IssuesListListener)pagerModel.getFragment());
  }
  tabLayout.setVisibility(View.VISIBLE);
  tabLayout.setupWithViewPager(viewPager);
  viewPager.setAdapter(pagerAdapter);
  showFirstPager();
}

Fixed version (ground truth):
@Override protected void initView(Bundle savedInstanceState){
  super.initView(savedInstanceState);
  setToolbarScrollAble(true);
  setToolbarBackEnable();
  setToolbarTitle(getString(R.string.issues));
  addBn.setVisibility(IssuesFilter.Type.Repo.equals(issuesType) ? View.VISIBLE : View.GONE);
  if (IssuesFilter.Type.User.equals(issuesType)) {
    pagerAdapter.setPagerList(FragmentPagerModel.createUserIssuesPagerList(getActivity(),getFragments()));
  }
 else {
    pagerAdapter.setPagerList(FragmentPagerModel.createRepoIssuesPagerList(getActivity(),userId,repoName,getFragments()));
    navView.getMenu().findItem(R.id.nav_type_chooser).setVisible(false);
  }
  listeners=new ArrayList<>();
  for (  FragmentPagerModel pagerModel : pagerAdapter.getPagerList()) {
    listeners.add((IssuesListListener)pagerModel.getFragment());
  }
  tabLayout.setVisibility(View.VISIBLE);
  tabLayout.setupWithViewPager(viewPager);
  viewPager.setAdapter(pagerAdapter);
  showFirstPager();
}
Program: 170532
Project: 170532
Buggy source:
boolean isTextChanged();

Fixed version (ground truth):
@Override public boolean isTextChanged(){
  return markdownEditorCallback.isTextChanged();
}
Program: 170533
Project: 170533
Buggy source:
@Override protected void initView(Bundle savedInstanceState){
  super.initView(savedInstanceState);
  setToolbarBackEnable();
  setToolbarTitle(getString(title));
  MarkdownEditorFragment editorFragment=MarkdownEditorFragment.create(text);
  markdownEditor=editorFragment;
  MarkdownPreviewFragment previewFragment=MarkdownPreviewFragment.create(markdownEditor);
  pagerAdapter.setPagerList(Arrays.asList(new FragmentPagerModel(getString(R.string.write),editorFragment),new FragmentPagerModel(getString(R.string.preview),previewFragment)));
  tabLayout.setVisibility(View.VISIBLE);
  tabLayout.setupWithViewPager(viewPager);
  viewPager.setAdapter(pagerAdapter);
}

Fixed version (ground truth):
@Override protected void initView(Bundle savedInstanceState){
  super.initView(savedInstanceState);
  setToolbarBackEnable();
  setToolbarTitle(getString(title));
  pagerAdapter.setPagerList(FragmentPagerModel.createMarkdownEditorPagerList(getActivity(),text,getFragments()));
  tabLayout.setVisibility(View.VISIBLE);
  tabLayout.setupWithViewPager(viewPager);
  viewPager.setAdapter(pagerAdapter);
}
Program: 170534
Project: 170534
Buggy source:
String getText();

Fixed version (ground truth):
@Override public String getText(){
  return markdownEditorCallback.getText();
}
Program: 170535
Project: 170535
Buggy source:
private void commit(){
  if (StringUtils.isBlank(markdownEditor.getText())) {
    Toasty.warning(getActivity(),getString(R.string.comment_null_warning)).show();
    return;
  }
  Intent data=new Intent();
  data.putExtra("String_Node_Str",markdownEditor.getText());
  setResult(RESULT_OK,data);
  finish();
}

Fixed version (ground truth):
private void commit(){
  if (StringUtils.isBlank(getText())) {
    Toasty.warning(getActivity(),getString(R.string.comment_null_warning)).show();
    return;
  }
  Intent data=new Intent();
  data.putExtra("String_Node_Str",getText());
  setResult(RESULT_OK,data);
  finish();
}
Program: 170536
Project: 170536
Buggy source:
@Override public void showProfileInfo(User user){
  invalidateOptionsMenu();
  setUserAvatar();
  joinedTime.setText(getString(R.string.joined_at).concat("String_Node_Str").concat(StringUtils.getDateStr(user.getCreatedAt())));
  location.setText(user.getLocation());
  if (pagerAdapter.getCount() == 0) {
    pagerAdapter.setPagerList(FragmentPagerModel.createProfilePagerList(getActivity(),user));
    tabLayout.setVisibility(View.VISIBLE);
    tabLayout.setupWithViewPager(viewPager);
    viewPager.setAdapter(pagerAdapter);
    showFirstPager();
  }
 else {
  }
}

Fixed version (ground truth):
@Override public void showProfileInfo(User user){
  invalidateOptionsMenu();
  setUserAvatar();
  joinedTime.setText(getString(R.string.joined_at).concat("String_Node_Str").concat(StringUtils.getDateStr(user.getCreatedAt())));
  location.setText(user.getLocation());
  if (pagerAdapter.getCount() == 0) {
    pagerAdapter.setPagerList(FragmentPagerModel.createProfilePagerList(getActivity(),user,getFragments()));
    tabLayout.setVisibility(View.VISIBLE);
    tabLayout.setupWithViewPager(viewPager);
    viewPager.setAdapter(pagerAdapter);
    showFirstPager();
  }
 else {
  }
}
Program: 170537
Project: 170537
Buggy source:
@NonNull @GET("String_Node_Str") Observable<Response<Issue>> getIssueInfo(@Header("String_Node_Str") boolean forceNetWork,@Path("String_Node_Str") String owner,@Path("String_Node_Str") String repo,@Path("String_Node_Str") int issueNumber);

Fixed version (ground truth):
@NonNull @GET("String_Node_Str") @Headers("String_Node_Str") Observable<Response<Issue>> getIssueInfo(@Header("String_Node_Str") boolean forceNetWork,@Path("String_Node_Str") String owner,@Path("String_Node_Str") String repo,@Path("String_Node_Str") int issueNumber);
Program: 170538
Project: 170538
Buggy source:
private void loadIssueInfo(){
  if (!GitHubHelper.isIssueUrl(issueUrl))   return;
  String[] arrays=issueUrl.substring(issueUrl.indexOf("String_Node_Str") + 4).split("String_Node_Str");
  final String user=arrays[0];
  final String repo=arrays[1];
  final int issueNumber=Integer.parseInt(arrays[3]);
  HttpObserver<Issue> httpObserver=new HttpObserver<Issue>(){
    @Override public void onError(    Throwable error){
      mView.showErrorToast(getErrorTip(error));
      mView.hideLoading();
    }
    @Override public void onSuccess(    HttpResponse<Issue> response){
      issue=response.body();
      mView.showIssue(issue);
      mView.hideLoading();
    }
  }
;
  generalRxHttpExecute(new IObservableCreator<Issue>(){
    @Override public Observable<Response<Issue>> createObservable(    boolean forceNetWork){
      return getIssueService().getIssueInfo(forceNetWork,user,repo,issueNumber);
    }
  }
,httpObserver,true);
  mView.showLoading();
}

Fixed version (ground truth):
private void loadIssueInfo(){
  if (issue != null) {
    loadIssueInfo(issue.getRepoAuthorName(),issue.getRepoName(),issue.getNumber());
  }
 else {
    if (!GitHubHelper.isIssueUrl(issueUrl))     return;
    String[] arrays=issueUrl.substring(issueUrl.indexOf("String_Node_Str") + 4).split("String_Node_Str");
    final String user=arrays[0];
    final String repo=arrays[1];
    final int issueNumber=Integer.parseInt(arrays[3]);
    loadIssueInfo(user,repo,issueNumber);
  }
}
Program: 170539
Project: 170539
Buggy source:
@Override public void onViewInitialized(){
  super.onViewInitialized();
  if (issue == null) {
    loadIssueInfo();
  }
 else {
    mView.showIssue(issue);
  }
}

Fixed version (ground truth):
@Override public void onViewInitialized(){
  super.onViewInitialized();
  if (issue == null || issue.getBodyHtml() == null) {
    loadIssueInfo();
  }
 else {
    mView.showIssue(issue);
  }
}
Program: 170540
Project: 170540
Buggy source:
@Override public void writeToParcel(Parcel dest,int flags){
  dest.writeInt(this.id);
  dest.writeString(this.name);
  dest.writeString(this.fullName);
  dest.writeByte(this.repPrivate ? (byte)1 : (byte)0);
  dest.writeString(this.htmlUrl);
  dest.writeString(this.description);
  dest.writeString(this.language);
  dest.writeParcelable(this.owner,flags);
  dest.writeString(this.defaultBranch);
  dest.writeLong(this.createdAt != null ? this.createdAt.getTime() : -1);
  dest.writeLong(this.updatedAt != null ? this.updatedAt.getTime() : -1);
  dest.writeLong(this.pushedAt != null ? this.pushedAt.getTime() : -1);
  dest.writeString(this.gitUrl);
  dest.writeString(this.sshUrl);
  dest.writeString(this.cloneUrl);
  dest.writeString(this.svnUrl);
  dest.writeInt(this.size);
  dest.writeInt(this.stargazersCount);
  dest.writeInt(this.watchersCount);
  dest.writeInt(this.forksCount);
  dest.writeInt(this.openIssuesCount);
  dest.writeInt(this.subscribersCount);
  dest.writeByte(this.fork ? (byte)1 : (byte)0);
  dest.writeParcelable(this.parent,flags);
  dest.writeParcelable(this.permissions,flags);
}

Fixed version (ground truth):
@Override public void writeToParcel(Parcel dest,int flags){
  dest.writeInt(this.id);
  dest.writeString(this.name);
  dest.writeString(this.fullName);
  dest.writeByte(this.repPrivate ? (byte)1 : (byte)0);
  dest.writeString(this.htmlUrl);
  dest.writeString(this.description);
  dest.writeString(this.language);
  dest.writeParcelable(this.owner,flags);
  dest.writeString(this.defaultBranch);
  dest.writeLong(this.createdAt != null ? this.createdAt.getTime() : -1);
  dest.writeLong(this.updatedAt != null ? this.updatedAt.getTime() : -1);
  dest.writeLong(this.pushedAt != null ? this.pushedAt.getTime() : -1);
  dest.writeString(this.gitUrl);
  dest.writeString(this.sshUrl);
  dest.writeString(this.cloneUrl);
  dest.writeString(this.svnUrl);
  dest.writeInt(this.size);
  dest.writeInt(this.stargazersCount);
  dest.writeInt(this.watchersCount);
  dest.writeInt(this.forksCount);
  dest.writeInt(this.openIssuesCount);
  dest.writeInt(this.subscribersCount);
  dest.writeByte(this.fork ? (byte)1 : (byte)0);
  dest.writeParcelable(this.parent,flags);
  dest.writeParcelable(this.permissions,flags);
  dest.writeByte(this.hasIssues ? (byte)1 : (byte)0);
  dest.writeByte(this.hasProjects ? (byte)1 : (byte)0);
  dest.writeByte(this.hasDownloads ? (byte)1 : (byte)0);
  dest.writeByte(this.hasWiki ? (byte)1 : (byte)0);
  dest.writeByte(this.hasPages ? (byte)1 : (byte)0);
}
Program: 170541
Project: 170541
Buggy source:
protected Repository(Parcel in){
  this.id=in.readInt();
  this.name=in.readString();
  this.fullName=in.readString();
  this.repPrivate=in.readByte() != 0;
  this.htmlUrl=in.readString();
  this.description=in.readString();
  this.language=in.readString();
  this.owner=in.readParcelable(User.class.getClassLoader());
  this.defaultBranch=in.readString();
  long tmpCreatedAt=in.readLong();
  this.createdAt=tmpCreatedAt == -1 ? null : new Date(tmpCreatedAt);
  long tmpUpdatedAt=in.readLong();
  this.updatedAt=tmpUpdatedAt == -1 ? null : new Date(tmpUpdatedAt);
  long tmpPushedAt=in.readLong();
  this.pushedAt=tmpPushedAt == -1 ? null : new Date(tmpPushedAt);
  this.gitUrl=in.readString();
  this.sshUrl=in.readString();
  this.cloneUrl=in.readString();
  this.svnUrl=in.readString();
  this.size=in.readInt();
  this.stargazersCount=in.readInt();
  this.watchersCount=in.readInt();
  this.forksCount=in.readInt();
  this.openIssuesCount=in.readInt();
  this.subscribersCount=in.readInt();
  this.fork=in.readByte() != 0;
  this.parent=in.readParcelable(Repository.class.getClassLoader());
  this.permissions=in.readParcelable(RepositoryPermissions.class.getClassLoader());
}

Fixed version (ground truth):
protected Repository(Parcel in){
  this.id=in.readInt();
  this.name=in.readString();
  this.fullName=in.readString();
  this.repPrivate=in.readByte() != 0;
  this.htmlUrl=in.readString();
  this.description=in.readString();
  this.language=in.readString();
  this.owner=in.readParcelable(User.class.getClassLoader());
  this.defaultBranch=in.readString();
  long tmpCreatedAt=in.readLong();
  this.createdAt=tmpCreatedAt == -1 ? null : new Date(tmpCreatedAt);
  long tmpUpdatedAt=in.readLong();
  this.updatedAt=tmpUpdatedAt == -1 ? null : new Date(tmpUpdatedAt);
  long tmpPushedAt=in.readLong();
  this.pushedAt=tmpPushedAt == -1 ? null : new Date(tmpPushedAt);
  this.gitUrl=in.readString();
  this.sshUrl=in.readString();
  this.cloneUrl=in.readString();
  this.svnUrl=in.readString();
  this.size=in.readInt();
  this.stargazersCount=in.readInt();
  this.watchersCount=in.readInt();
  this.forksCount=in.readInt();
  this.openIssuesCount=in.readInt();
  this.subscribersCount=in.readInt();
  this.fork=in.readByte() != 0;
  this.parent=in.readParcelable(Repository.class.getClassLoader());
  this.permissions=in.readParcelable(RepositoryPermissions.class.getClassLoader());
  this.hasIssues=in.readByte() != 0;
  this.hasProjects=in.readByte() != 0;
  this.hasDownloads=in.readByte() != 0;
  this.hasWiki=in.readByte() != 0;
  this.hasPages=in.readByte() != 0;
}
Program: 170543
Project: 170543
Buggy source:
@Override public void prepareLoadData(){
  if (mView == null)   return;
  if (mView.isPagerFragment() && (!isViewInitialized() || !mView.isFragmentShowed()))   return;
  if (isLoaded)   return;
  isLoaded=true;
  loadData();
}

Fixed version (ground truth):
@Override public void prepareLoadData(){
  if (mView == null) {
    return;
  }
  if (mView.isPagerFragment() && (!isViewInitialized() || !mView.isFragmentShowed())) {
    return;
  }
  if (isLoaded)   return;
  isLoaded=true;
  loadData();
}
Program: 170544
Project: 170544
Buggy source:
@Override public void onPageSelected(final int position){
  postNotifyFragmentStatus(prePosition,false,100);
  postNotifyFragmentStatus(position,true,500);
  prePosition=position;
}

Fixed version (ground truth):
@Override public void onPageSelected(final int position){
  postNotifyFragmentStatus(prePosition,false,100);
  postNotifyFragmentStatus(position,true,500);
  prePosition=position;
  Logger.d("String_Node_Str" + position);
}
Program: 170545
Project: 170545
Buggy source:
@NonNull public ArrayList<Fragment> getFragments(){
  return fragments;
}

Fixed version (ground truth):
@NonNull public ArrayList<Fragment> getFragments(){
  if (fragments == null) {
    fragments=new ArrayList<>();
    for (int i=0; i < getPagerSize(); i++) {
      fragments.add(null);
    }
  }
  return fragments;
}
Program: 170546
Project: 170546
Buggy source:
@Override public void onAttachFragment(Fragment fragment){
  super.onAttachFragment(fragment);
  fragments.add(fragment);
  Logger.d("String_Node_Str" + fragment);
}

Fixed version (ground truth):
@Override public void onAttachFragment(Fragment fragment){
  super.onAttachFragment(fragment);
  int fragmentPosition=getFragmentPosition(fragment);
  if (fragmentPosition != -1)   getFragments().set(fragmentPosition,fragment);
  Logger.d("String_Node_Str" + fragment);
}
Program: 170547
Project: 170547
Buggy source:
@Override protected void onClick(){
  super.onClick();
  oriColor=getSelectedColor();
  colorChooserDialog=new ColorChooserDialog.Builder(BaseActivity.getCurActivity(),this,R.string.theme_accent_color).titleSub(R.string.choose_theme).customColors(getAccentColors(),null).preselect(oriColor).customButton(0).accentMode(true).show();
}

Fixed version (ground truth):
@Override protected void onClick(){
  super.onClick();
  oriColor=getSelectedColor();
  new ColorChooserDialog.Builder(BaseActivity.getCurActivity(),this,R.string.theme_accent_color).titleSub(R.string.choose_theme).customColors(getAccentColors(),null).preselect(oriColor).customButton(0).accentMode(true).show();
}
Program: 170548
Project: 170548
Buggy source:
@Override public void onBindViewHolder(PreferenceViewHolder holder){
  super.onBindViewHolder(holder);
  colorView=holder.findViewById(R.id.color_view);
  colorView.setBackgroundResource(R.drawable.shape_circle);
  colorView.getBackground().setColorFilter(getSelectedColor(),PorterDuff.Mode.SRC_IN);
}

Fixed version (ground truth):
@Override public void onBindViewHolder(PreferenceViewHolder holder){
  super.onBindViewHolder(holder);
  View colorView=holder.findViewById(R.id.color_view);
  colorView.setBackgroundResource(R.drawable.shape_circle);
  colorView.getBackground().setColorFilter(getSelectedColor(),PorterDuff.Mode.SRC_IN);
}
Program: 170549
Project: 170549
Buggy source:
@Override public void onColorSelection(@NonNull ColorChooserDialog dialog,@ColorInt int selectedColor){
  PrefHelper.set(PrefHelper.ACCENT_COLOR,getColorIndex(selectedColor));
  colorView.getBackground().setColorFilter(selectedColor,PorterDuff.Mode.SRC_IN);
  if (colorChooserCallback != null && oriColor != selectedColor) {
    colorChooserCallback.onColorChanged(oriColor,selectedColor);
  }
}

Fixed version (ground truth):
@Override public void onColorSelection(@NonNull ColorChooserDialog dialog,@ColorInt int selectedColor){
  PrefHelper.set(PrefHelper.ACCENT_COLOR,getColorIndex(selectedColor));
  if (colorChooserCallback != null && oriColor != selectedColor) {
    colorChooserCallback.onColorChanged(oriColor,selectedColor);
  }
}
Program: 170550
Project: 170550
Buggy source:
@Override protected void onCreate(@Nullable Bundle savedInstanceState){
  ThemeEngine.apply(this);
  AppHelper.updateAppLanguage(getActivity());
  super.onCreate(savedInstanceState);
  isAlive=true;
  setupActivityComponent(getAppComponent());
  DataAutoAccess.getData(this,savedInstanceState);
  if (mPresenter != null) {
    mPresenter.onRestoreInstanceState(savedInstanceState == null ? getIntent().getExtras() : savedInstanceState);
    mPresenter.attachView(this);
  }
  if (savedInstanceState != null && AppData.INSTANCE.getAuthUser() == null) {
    DataAutoAccess.getData(AppData.INSTANCE,savedInstanceState);
  }
  getScreenSize();
  if (getContentView() != 0) {
    setContentView(getContentView());
    ButterKnife.bind(getActivity());
  }
  initActivity();
  initView(savedInstanceState);
  if (mPresenter != null)   mPresenter.onViewInitialized();
}

Fixed version (ground truth):
@Override protected void onCreate(@Nullable Bundle savedInstanceState){
  if ((AppData.INSTANCE.getAuthUser() == null || AppData.INSTANCE.getLoggedUser() == null) && !this.getClass().equals(SplashActivity.class) && !this.getClass().equals(LoginActivity.class)) {
    super.onCreate(savedInstanceState);
    finishAffinity();
    startActivity(new Intent(getActivity(),SplashActivity.class));
    return;
  }
  ThemeEngine.apply(this);
  AppHelper.updateAppLanguage(getActivity());
  super.onCreate(savedInstanceState);
  isAlive=true;
  setupActivityComponent(getAppComponent());
  DataAutoAccess.getData(this,savedInstanceState);
  if (mPresenter != null) {
    mPresenter.onRestoreInstanceState(savedInstanceState == null ? getIntent().getExtras() : savedInstanceState);
    mPresenter.attachView(this);
  }
  if (savedInstanceState != null && AppData.INSTANCE.getAuthUser() == null) {
    DataAutoAccess.getData(AppData.INSTANCE,savedInstanceState);
  }
  getScreenSize();
  if (getContentView() != 0) {
    setContentView(getContentView());
    ButterKnife.bind(getActivity());
  }
  initActivity();
  initView(savedInstanceState);
  if (mPresenter != null)   mPresenter.onViewInitialized();
}
Program: 170551
Project: 170551
Buggy source:
public static void showDownloadServiceSetting(Context context){
  try {
    Intent intent=new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    intent.setData(Uri.parse("String_Node_Str" + DOWNLOAD_SERVICE_PACKAGE_NAME));
    context.startActivity(intent);
  }
 catch (  ActivityNotFoundException e) {
    Intent intent=new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    context.startActivity(intent);
  }
}

Fixed version (ground truth):
public static void showDownloadServiceSetting(Context context){
  try {
    Intent intent=new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    intent.setData(Uri.parse("String_Node_Str" + DOWNLOAD_SERVICE_PACKAGE_NAME));
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(intent);
  }
 catch (  ActivityNotFoundException e) {
    Intent intent=new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(intent);
  }
}
Program: 170552
Project: 170552
Buggy source:
@NonNull @GET("String_Node_Str") Observable<Response<ArrayList<Repository>>> getForks(@Header("String_Node_Str") boolean forceNetWork,@Path("String_Node_Str") String owner,@Path("String_Node_Str") String repo);

Fixed version (ground truth):
@NonNull @GET("String_Node_Str") Observable<Response<ArrayList<Repository>>> getForks(@Header("String_Node_Str") boolean forceNetWork,@Path("String_Node_Str") String owner,@Path("String_Node_Str") String repo,@Query("String_Node_Str") int page);
Program: 170553
Project: 170553
Buggy source:
@Override public void loadEvents(final boolean isReload,final int page){
  mView.showLoading();
  final boolean readCacheFirst=!isReload && page == 1;
  HttpObserver<ArrayList<Event>> httpObserver=new HttpObserver<ArrayList<Event>>(){
    @Override public void onError(    Throwable error){
      mView.hideLoading();
      mView.showShortToast(error.getMessage());
    }
    @Override public void onSuccess(    HttpResponse<ArrayList<Event>> response){
      mView.hideLoading();
      correctEvent(response.body());
      if (events == null || isReload || readCacheFirst) {
        events=response.body();
      }
 else {
        events.addAll(response.body());
      }
      mView.showEvents(events);
    }
  }
;
  generalRxHttpExecute(new IObservableCreator<ArrayList<Event>>(){
    @Override public Observable<Response<ArrayList<Event>>> createObservable(    boolean forceNetWork){
      return getObservable(forceNetWork,page);
    }
  }
,httpObserver,readCacheFirst);
}

Fixed version (ground truth):
@Override public void loadEvents(final boolean isReload,final int page){
  mView.showLoading();
  final boolean readCacheFirst=!isReload && page == 1;
  HttpObserver<ArrayList<Event>> httpObserver=new HttpObserver<ArrayList<Event>>(){
    @Override public void onError(    Throwable error){
      mView.hideLoading();
      mView.showShortToast(error.getMessage());
    }
    @Override public void onSuccess(    HttpResponse<ArrayList<Event>> response){
      mView.hideLoading();
      correctEvent(response.body());
      if (events == null || isReload || readCacheFirst) {
        events=response.body();
      }
 else {
        events.addAll(response.body());
      }
      if (response.body().size() > 0) {
        mView.showEvents(events);
      }
 else {
        mView.setCanLoadMore(false);
      }
    }
  }
;
  generalRxHttpExecute(new IObservableCreator<ArrayList<Event>>(){
    @Override public Observable<Response<ArrayList<Event>>> createObservable(    boolean forceNetWork){
      return getObservable(forceNetWork,page);
    }
  }
,httpObserver,readCacheFirst);
}
Program: 170554
Project: 170554
Buggy source:
@Override public void onSuccess(HttpResponse<ArrayList<Event>> response){
  mView.hideLoading();
  correctEvent(response.body());
  if (events == null || isReload || readCacheFirst) {
    events=response.body();
  }
 else {
    events.addAll(response.body());
  }
  mView.showEvents(events);
}

Fixed version (ground truth):
@Override public void onSuccess(HttpResponse<ArrayList<Event>> response){
  mView.hideLoading();
  correctEvent(response.body());
  if (events == null || isReload || readCacheFirst) {
    events=response.body();
  }
 else {
    events.addAll(response.body());
  }
  if (response.body().size() > 0) {
    mView.showEvents(events);
  }
 else {
    mView.setCanLoadMore(false);
  }
}
Program: 170555
Project: 170555
Buggy source:
@Override public void loadRepositories(final boolean isReLoad,final int page){
  if (type.equals(RepositoriesFragment.RepositoriesType.SEARCH)) {
    searchRepos(page);
    return;
  }
  mView.showLoading();
  final boolean readCacheFirst=!isReLoad && page == 1 && !type.equals(RepositoriesFragment.RepositoriesType.TRENDING);
  HttpObserver<ArrayList<Repository>> httpObserver=new HttpObserver<ArrayList<Repository>>(){
    @Override public void onError(    @NonNull Throwable error){
      mView.hideLoading();
      mView.showLoadError(error.getMessage());
    }
    @Override public void onSuccess(    @NonNull HttpResponse<ArrayList<Repository>> response){
      mView.hideLoading();
      if (isReLoad || readCacheFirst || repos == null) {
        repos=response.body();
      }
 else {
        repos.addAll(response.body());
      }
      mView.showRepositories(repos);
    }
  }
;
  generalRxHttpExecute(new IObservableCreator<ArrayList<Repository>>(){
    @Nullable @Override public Observable<Response<ArrayList<Repository>>> createObservable(    boolean forceNetWork){
      return getObservable(forceNetWork,page);
    }
  }
,httpObserver,readCacheFirst);
}

Fixed version (ground truth):
@Override public void loadRepositories(final boolean isReLoad,final int page){
  if (type.equals(RepositoriesFragment.RepositoriesType.SEARCH)) {
    searchRepos(page);
    return;
  }
  mView.showLoading();
  final boolean readCacheFirst=!isReLoad && page == 1 && !type.equals(RepositoriesFragment.RepositoriesType.TRENDING);
  HttpObserver<ArrayList<Repository>> httpObserver=new HttpObserver<ArrayList<Repository>>(){
    @Override public void onError(    @NonNull Throwable error){
      mView.hideLoading();
      mView.showLoadError(error.getMessage());
    }
    @Override public void onSuccess(    @NonNull HttpResponse<ArrayList<Repository>> response){
      mView.hideLoading();
      if (isReLoad || readCacheFirst || repos == null) {
        repos=response.body();
      }
 else {
        repos.addAll(response.body());
      }
      if (response.body().size() > 0) {
        mView.showRepositories(repos);
      }
 else {
        mView.setCanLoadMore(false);
      }
    }
  }
;
  generalRxHttpExecute(new IObservableCreator<ArrayList<Repository>>(){
    @Nullable @Override public Observable<Response<ArrayList<Repository>>> createObservable(    boolean forceNetWork){
      return getObservable(forceNetWork,page);
    }
  }
,httpObserver,readCacheFirst);
}
Program: 170556
Project: 170556
Buggy source:
private Observable<Response<ArrayList<Repository>>> getObservable(boolean forceNetWork,int page){
  String loginedUser=AppData.INSTANCE.getLoggedUser().getLogin();
switch (type) {
case OWNED:
    return getRepoService().getUserRepos(forceNetWork,user,page);
case STARRED:
  return getRepoService().getStarredRepos(forceNetWork,user,page);
case TRENDING:
return getOpenHubService().getTrendingRepos(since);
case FORKS:
return getRepoService().getForks(forceNetWork,user,repo);
default :
return null;
}
}

Fixed version (ground truth):
private Observable<Response<ArrayList<Repository>>> getObservable(boolean forceNetWork,int page){
  String loginedUser=AppData.INSTANCE.getLoggedUser().getLogin();
switch (type) {
case OWNED:
    return getRepoService().getUserRepos(forceNetWork,user,page);
case STARRED:
  return getRepoService().getStarredRepos(forceNetWork,user,page);
case TRENDING:
return getOpenHubService().getTrendingRepos(since);
case FORKS:
return getRepoService().getForks(forceNetWork,user,repo,page);
default :
return null;
}
}
Program: 170557
Project: 170557
Buggy source:
private void searchRepos(final int page){
  mView.showLoading();
  HttpObserver<SearchResult<Repository>> httpObserver=new HttpObserver<SearchResult<Repository>>(){
    @Override public void onError(    @NonNull Throwable error){
      mView.hideLoading();
      mView.showLoadError(error.getMessage());
    }
    @Override public void onSuccess(    @NonNull HttpResponse<SearchResult<Repository>> response){
      mView.hideLoading();
      if (repos == null || page == 1) {
        repos=response.body().getItems();
      }
 else {
        repos.addAll(response.body().getItems());
      }
      mView.showRepositories(repos);
    }
  }
;
  generalRxHttpExecute(new IObservableCreator<SearchResult<Repository>>(){
    @Nullable @Override public Observable<Response<SearchResult<Repository>>> createObservable(    boolean forceNetWork){
      return getSearchService().searchRepos(searchModel.getQuery(),searchModel.getSort(),searchModel.getOrder(),page);
    }
  }
,httpObserver);
}

Fixed version (ground truth):
private void searchRepos(final int page){
  mView.showLoading();
  HttpObserver<SearchResult<Repository>> httpObserver=new HttpObserver<SearchResult<Repository>>(){
    @Override public void onError(    @NonNull Throwable error){
      mView.hideLoading();
      mView.showLoadError(error.getMessage());
    }
    @Override public void onSuccess(    @NonNull HttpResponse<SearchResult<Repository>> response){
      mView.hideLoading();
      if (repos == null || page == 1) {
        repos=response.body().getItems();
      }
 else {
        repos.addAll(response.body().getItems());
      }
      if (response.body().getItems().size() > 0) {
        mView.showRepositories(repos);
      }
 else {
        mView.setCanLoadMore(false);
      }
    }
  }
;
  generalRxHttpExecute(new IObservableCreator<SearchResult<Repository>>(){
    @Nullable @Override public Observable<Response<SearchResult<Repository>>> createObservable(    boolean forceNetWork){
      return getSearchService().searchRepos(searchModel.getQuery(),searchModel.getSort(),searchModel.getOrder(),page);
    }
  }
,httpObserver);
}
Program: 170558
Project: 170558
Buggy source:
@Override public void onSuccess(@NonNull HttpResponse<SearchResult<Repository>> response){
  mView.hideLoading();
  if (repos == null || page == 1) {
    repos=response.body().getItems();
  }
 else {
    repos.addAll(response.body().getItems());
  }
  mView.showRepositories(repos);
}

Fixed version (ground truth):
@Override public void onSuccess(@NonNull HttpResponse<SearchResult<Repository>> response){
  mView.hideLoading();
  if (repos == null || page == 1) {
    repos=response.body().getItems();
  }
 else {
    repos.addAll(response.body().getItems());
  }
  if (response.body().getItems().size() > 0) {
    mView.showRepositories(repos);
  }
 else {
    mView.setCanLoadMore(false);
  }
}
Program: 170560
Project: 170560
Buggy source:
private void searchUsers(final int page){
  mView.showLoading();
  HttpObserver<SearchResult<User>> httpObserver=new HttpObserver<SearchResult<User>>(){
    @Override public void onError(    Throwable error){
      mView.hideLoading();
      mView.showShortToast(error.getMessage());
    }
    @Override public void onSuccess(    HttpResponse<SearchResult<User>> response){
      mView.hideLoading();
      if (users == null || page == 1) {
        users=response.body().getItems();
      }
 else {
        users.addAll(response.body().getItems());
      }
      mView.showUsers(users);
    }
  }
;
  generalRxHttpExecute(new IObservableCreator<SearchResult<User>>(){
    @Override public Observable<Response<SearchResult<User>>> createObservable(    boolean forceNetWork){
      return getSearchService().searchUsers(searchModel.getQuery(),searchModel.getSort(),searchModel.getOrder(),page);
    }
  }
,httpObserver);
}

Fixed version (ground truth):
private void searchUsers(final int page){
  mView.showLoading();
  HttpObserver<SearchResult<User>> httpObserver=new HttpObserver<SearchResult<User>>(){
    @Override public void onError(    Throwable error){
      mView.hideLoading();
      mView.showShortToast(error.getMessage());
    }
    @Override public void onSuccess(    HttpResponse<SearchResult<User>> response){
      mView.hideLoading();
      if (users == null || page == 1) {
        users=response.body().getItems();
      }
 else {
        users.addAll(response.body().getItems());
      }
      if (response.body().getItems().size() > 0) {
        mView.showUsers(users);
      }
 else {
        mView.setCanLoadMore(false);
      }
    }
  }
;
  generalRxHttpExecute(new IObservableCreator<SearchResult<User>>(){
    @Override public Observable<Response<SearchResult<User>>> createObservable(    boolean forceNetWork){
      return getSearchService().searchUsers(searchModel.getQuery(),searchModel.getSort(),searchModel.getOrder(),page);
    }
  }
,httpObserver);
}
Program: 170561
Project: 170561
Buggy source:
@Override public void onSuccess(HttpResponse<SearchResult<User>> response){
  mView.hideLoading();
  if (users == null || page == 1) {
    users=response.body().getItems();
  }
 else {
    users.addAll(response.body().getItems());
  }
  mView.showUsers(users);
}

Fixed version (ground truth):
@Override public void onSuccess(HttpResponse<SearchResult<User>> response){
  mView.hideLoading();
  if (users == null || page == 1) {
    users=response.body().getItems();
  }
 else {
    users.addAll(response.body().getItems());
  }
  if (response.body().getItems().size() > 0) {
    mView.showUsers(users);
  }
 else {
    mView.setCanLoadMore(false);
  }
}
Program: 170562
Project: 170562
Buggy source:
@Override boolean shouldFlipSizes(){
  return mSensorOffset % 180 != 0;
}

Fixed version (ground truth):
@Override boolean shouldFlipSizes(){
  return (mDeviceOrientation + mSensorOffset) % 180 != 0;
}
Program: 170563
Project: 170563
Buggy source:
void enable(Display display){
  mDisplay=display;
  mListener.enable();
  mLastKnownDisplayOffset=DISPLAY_ORIENTATIONS.get(display.getRotation());
  mCallbacks.onDisplayOffsetChanged(mLastKnownDisplayOffset);
}

Fixed version (ground truth):
void enable(Context context){
  mDisplay=((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
  mListener.enable();
  mLastKnownDisplayOffset=DISPLAY_ORIENTATIONS.get(mDisplay.getRotation());
  mCallbacks.onDisplayOffsetChanged(mLastKnownDisplayOffset);
}
Program: 170564
Project: 170564
Buggy source:
/** 
 * Checks that we have appropriate permissions for this session type. Throws if session = audio and manifest did not add the microphone permissions.
 * @return true if we can go on, false otherwise.
 */
@SuppressLint("String_Node_Str") protected boolean checkPermissions(SessionType sessionType,Audio audio){
  checkPermissionsManifestOrThrow(sessionType,audio);
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M)   return true;
  Context c=getContext();
  boolean needsCamera=true;
  boolean needsAudio=sessionType == SessionType.VIDEO && audio == Audio.ON;
  needsCamera=needsCamera && c.checkSelfPermission(Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED;
  needsAudio=needsAudio && c.checkSelfPermission(Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED;
  if (needsCamera || needsAudio) {
    requestPermissions(needsCamera,needsAudio);
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Checks that we have appropriate permissions for this session type. Throws if session = audio and manifest did not add the microphone permissions.     
 * @param sessionType
 * @param audio
 * @return true if we can go on, false otherwise.
 */
@SuppressLint("String_Node_Str") protected boolean checkPermissions(SessionType sessionType,Audio audio){
  checkPermissionsManifestOrThrow(sessionType,audio);
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M)   return true;
  Context c=getContext();
  boolean needsCamera=true;
  boolean needsAudio=sessionType == SessionType.VIDEO && audio == Audio.ON;
  needsCamera=needsCamera && c.checkSelfPermission(Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED;
  needsAudio=needsAudio && c.checkSelfPermission(Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED;
  if (needsCamera || needsAudio) {
    requestPermissions(needsCamera,needsAudio);
    return false;
  }
  return true;
}
Program: 170565
Project: 170565
Buggy source:
/** 
 * Controls whether CameraView should play sound effects on certain events (picture taken, focus complete). Note that: - On API level < 16, this flag is always false - Camera1 will always play the shutter sound when taking pictures
 * @param playSounds whether to play sound effects
 */
public void setPlaySounds(boolean playSounds){
  mPlaySounds=playSounds && Build.VERSION.SDK_INT >= 16;
}

Fixed version (ground truth):
/** 
 * Controls whether CameraView should play sound effects on certain events (picture taken, focus complete). Note that: - On API level   {@literal <} 16, this flag is always false- Camera1 will always play the shutter sound when taking pictures
 * @param playSounds whether to play sound effects
 */
public void setPlaySounds(boolean playSounds){
  mPlaySounds=playSounds && Build.VERSION.SDK_INT >= 16;
}
Program: 170566
Project: 170566
Buggy source:
Camera2(CameraView.CameraListenerWrapper callback,PreviewImpl preview,Context context){
  super(callback,preview);
  preview.setCallback(new PreviewImpl.OnPreviewSurfaceChangedCallback(){
    @Override public void onPreviewSurfaceChanged(){
    }
  }
);
  mCameraManager=(CameraManager)context.getSystemService(Context.CAMERA_SERVICE);
  try {
    for (    final String cameraId : mCameraManager.getCameraIdList()) {
      CameraCharacteristics characteristics=mCameraManager.getCameraCharacteristics(cameraId);
      @SuppressWarnings("String_Node_Str") int orientation=characteristics.get(CameraCharacteristics.LENS_FACING);
      if (orientation == CameraCharacteristics.LENS_FACING_BACK) {
        float[] maxFocus=characteristics.get(CameraCharacteristics.LENS_INFO_AVAILABLE_FOCAL_LENGTHS);
        if (maxFocus == null) {
          continue;
        }
        SizeF size=characteristics.get(CameraCharacteristics.SENSOR_INFO_PHYSICAL_SIZE);
        if (size == null) {
          continue;
        }
        float w=size.getWidth();
        float h=size.getHeight();
        mExtraPropertiesMap.put(cameraId,new ExtraProperties((float)Math.toDegrees(2 * Math.atan(w / (maxFocus[0] * 2))),(float)Math.toDegrees(2 * Math.atan(h / (maxFocus[0] * 2)))));
      }
    }
  }
 catch (  CameraAccessException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
Camera2(CameraView.CameraListenerWrapper callback,PreviewImpl preview,Context context){
  super(callback,preview);
  mCameraManager=(CameraManager)context.getSystemService(Context.CAMERA_SERVICE);
  try {
    for (    final String cameraId : mCameraManager.getCameraIdList()) {
      CameraCharacteristics characteristics=mCameraManager.getCameraCharacteristics(cameraId);
      @SuppressWarnings("String_Node_Str") int orientation=characteristics.get(CameraCharacteristics.LENS_FACING);
      if (orientation == CameraCharacteristics.LENS_FACING_BACK) {
        float[] maxFocus=characteristics.get(CameraCharacteristics.LENS_INFO_AVAILABLE_FOCAL_LENGTHS);
        if (maxFocus == null) {
          continue;
        }
        SizeF size=characteristics.get(CameraCharacteristics.SENSOR_INFO_PHYSICAL_SIZE);
        if (size == null) {
          continue;
        }
        float w=size.getWidth();
        float h=size.getHeight();
        mExtraPropertiesMap.put(cameraId,new ExtraProperties((float)Math.toDegrees(2 * Math.atan(w / (maxFocus[0] * 2))),(float)Math.toDegrees(2 * Math.atan(h / (maxFocus[0] * 2)))));
      }
    }
  }
 catch (  CameraAccessException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 170567
Project: 170567
Buggy source:
CameraImpl(CameraView.CameraListenerWrapper callback,PreviewImpl preview){
  mCameraListener=callback;
  mPreview=preview;
}

Fixed version (ground truth):
CameraImpl(CameraView.CameraListenerWrapper callback,PreviewImpl preview){
  mCameraListener=callback;
  mPreview=preview;
  mPreview.setSurfaceCallback(this);
}
Program: 170568
Project: 170568
Buggy source:
TextureViewPreview(Context context,ViewGroup parent){
  final View view=View.inflate(context,R.layout.texture_view,parent);
  mTextureView=(TextureView)view.findViewById(R.id.texture_view);
  mTextureView.setSurfaceTextureListener(new TextureView.SurfaceTextureListener(){
    @Override public void onSurfaceTextureAvailable(    SurfaceTexture surface,    int width,    int height){
      setSurfaceSize(width,height);
      dispatchSurfaceChanged();
    }
    @Override public void onSurfaceTextureSizeChanged(    SurfaceTexture surface,    int width,    int height){
      setSurfaceSize(width,height);
      dispatchSurfaceChanged();
    }
    @Override public boolean onSurfaceTextureDestroyed(    SurfaceTexture surface){
      setSurfaceSize(0,0);
      return true;
    }
    @Override public void onSurfaceTextureUpdated(    SurfaceTexture surface){
    }
  }
);
}

Fixed version (ground truth):
TextureViewPreview(Context context,ViewGroup parent){
  final View view=View.inflate(context,R.layout.texture_view,parent);
  mTextureView=(TextureView)view.findViewById(R.id.texture_view);
  mTextureView.setSurfaceTextureListener(new TextureView.SurfaceTextureListener(){
    @Override public void onSurfaceTextureAvailable(    SurfaceTexture surface,    int width,    int height){
      onSurfaceAvailable(width,height);
    }
    @Override public void onSurfaceTextureSizeChanged(    SurfaceTexture surface,    int width,    int height){
      onSurfaceSizeChanged(width,height);
    }
    @Override public boolean onSurfaceTextureDestroyed(    SurfaceTexture surface){
      onSurfaceDestroyed();
      return true;
    }
    @Override public void onSurfaceTextureUpdated(    SurfaceTexture surface){
    }
  }
);
}
Program: 170569
Project: 170569
Buggy source:
@Override public void onSurfaceTextureAvailable(SurfaceTexture surface,int width,int height){
  setSurfaceSize(width,height);
  dispatchSurfaceChanged();
}

Fixed version (ground truth):
@Override public void onSurfaceTextureAvailable(SurfaceTexture surface,int width,int height){
  onSurfaceAvailable(width,height);
}
Program: 170570
Project: 170570
Buggy source:
@Override public boolean onSurfaceTextureDestroyed(SurfaceTexture surface){
  setSurfaceSize(0,0);
  return true;
}

Fixed version (ground truth):
@Override public boolean onSurfaceTextureDestroyed(SurfaceTexture surface){
  onSurfaceDestroyed();
  return true;
}
Program: 170571
Project: 170571
Buggy source:
@Override public void onSurfaceTextureSizeChanged(SurfaceTexture surface,int width,int height){
  setSurfaceSize(width,height);
  dispatchSurfaceChanged();
}

Fixed version (ground truth):
@Override public void onSurfaceTextureSizeChanged(SurfaceTexture surface,int width,int height){
  onSurfaceSizeChanged(width,height);
}
Program: 170572
Project: 170572
Buggy source:
CameraImpl(CameraListener callback,PreviewImpl preview){
  mCameraListener=callback;
  mPreview=preview;
}

Fixed version (ground truth):
CameraImpl(CameraView.CameraListenerWrapper callback,PreviewImpl preview){
  mCameraListener=callback;
  mPreview=preview;
}
Program: 170573
Project: 170573
Buggy source:
public void onPictureTaken(YuvImage yuv){
}

Fixed version (ground truth):
public void onPictureTaken(byte[] jpeg){
}
Program: 170574
Project: 170574
Buggy source:
@Override Size getPreviewSize(){
  if (mPreviewSize == null && mCameraCharacteristics != null) {
    TreeSet<Size> sizes=new TreeSet<>();
    sizes.addAll(getAvailablePreviewResolutions());
    TreeSet<AspectRatio> aspectRatios=new CommonAspectRatioFilter(getAvailablePreviewResolutions(),getAvailableCaptureResolutions()).filter();
    AspectRatio targetRatio=aspectRatios.size() > 0 ? aspectRatios.last() : null;
    Iterator<Size> descendingSizes=sizes.descendingIterator();
    Size size;
    while (descendingSizes.hasNext() && mPreviewSize == null) {
      size=descendingSizes.next();
      if (targetRatio == null || targetRatio.matches(size)) {
        mPreviewSize=size;
        break;
      }
    }
  }
  return mPreviewSize;
}

Fixed version (ground truth):
@Override Size getPreviewSize(){
  if (mPreviewSize == null && mCameraCharacteristics != null) {
    TreeSet<Size> sizes=new TreeSet<>();
    sizes.addAll(getAvailablePreviewResolutions());
  }
  return mPreviewSize;
}
Program: 170575
Project: 170575
Buggy source:
@Override Size getCaptureSize(){
  if (mCaptureSize == null && mCameraCharacteristics != null) {
    TreeSet<Size> sizes=new TreeSet<>();
    sizes.addAll(getAvailableCaptureResolutions());
    TreeSet<AspectRatio> aspectRatios=new CommonAspectRatioFilter(getAvailablePreviewResolutions(),getAvailableCaptureResolutions()).filter();
    AspectRatio targetRatio=aspectRatios.size() > 0 ? aspectRatios.last() : null;
    Iterator<Size> descendingSizes=sizes.descendingIterator();
    Size size;
    while (descendingSizes.hasNext() && mCaptureSize == null) {
      size=descendingSizes.next();
      if (targetRatio == null || targetRatio.matches(size)) {
        mCaptureSize=size;
        break;
      }
    }
  }
  return mCaptureSize;
}

Fixed version (ground truth):
@Override Size getCaptureSize(){
  if (mCaptureSize == null && mCameraCharacteristics != null) {
    TreeSet<Size> sizes=new TreeSet<>();
    sizes.addAll(getAvailableCaptureResolutions());
  }
  return mCaptureSize;
}
Program: 170577
Project: 170577
Buggy source:
@Override public void run(){
  callback.onBitmapReady(result);
}

Fixed version (ground truth):
@Override public void run(){
  callback.onBitmapReady(bitmap);
}