nus-yam/ex-repair huggingface dataset:
Program: 28250
Project: 28250
Buggy source:
@Override public boolean onTouchEvent(MotionEvent ev){
  viewDragHelper.processTouchEvent(ev);
  final int x=(int)ev.getX();
  final int y=(int)ev.getY();
  boolean isDragViewHit=isViewHit(dragView,x,y);
  boolean isSecondViewHit=isViewHit(secondView,x,y);
  dragView.dispatchTouchEvent(ev);
  return isDragViewHit || isSecondViewHit;
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent ev){
  viewDragHelper.processTouchEvent(ev);
  boolean isDragViewHit=isViewHit(dragView,(int)ev.getX(),(int)ev.getY());
  boolean isSecondViewHit=isViewHit(secondView,(int)ev.getX(),(int)ev.getY());
  if (isMaximized()) {
    dragView.dispatchTouchEvent(ev);
  }
  return isDragViewHit || isSecondViewHit;
}
Program: 28251
Project: 28251
Buggy source:
private void recoverDraggablePanelState(Bundle savedInstanceState){
  final DraggablePanelState draggablePanelState=(DraggablePanelState)savedInstanceState.getSerializable(DRAGGABLE_PANEL_STATE);
  if (draggablePanelState == null) {
    draggablePanel.setVisibility(View.GONE);
    return;
  }
  Handler handler=new Handler();
switch (draggablePanelState) {
case MAXIMIZED:
    handler.postDelayed(new Runnable(){
      @Override public void run(){
        draggablePanel.maximize();
      }
    }
,50);
  break;
case MINIMIZED:
handler.postDelayed(new Runnable(){
  @Override public void run(){
    draggablePanel.minimize();
  }
}
,50);
break;
case CLOSED_AT_LEFT:
handler.postDelayed(new Runnable(){
@Override public void run(){
draggablePanel.setVisibility(View.GONE);
draggablePanel.closeToLeft();
}
}
,50);
break;
case CLOSED_AT_RIGHT:
handler.postDelayed(new Runnable(){
@Override public void run(){
draggablePanel.setVisibility(View.GONE);
draggablePanel.closeToRight();
}
}
,50);
break;
default :
draggablePanel.setVisibility(View.GONE);
break;
}
}

Fixed version (ground truth):
private void recoverDraggablePanelState(Bundle savedInstanceState){
  final DraggablePanelState draggablePanelState=(DraggablePanelState)savedInstanceState.getSerializable(DRAGGABLE_PANEL_STATE);
  if (draggablePanelState == null) {
    draggablePanel.setVisibility(View.GONE);
    return;
  }
  Handler handler=new Handler();
switch (draggablePanelState) {
case MAXIMIZED:
    handler.postDelayed(new Runnable(){
      @Override public void run(){
        draggablePanel.maximize();
      }
    }
,DELAY_MILLIS);
  break;
case MINIMIZED:
handler.postDelayed(new Runnable(){
  @Override public void run(){
    draggablePanel.minimize();
  }
}
,DELAY_MILLIS);
break;
case CLOSED_AT_LEFT:
handler.postDelayed(new Runnable(){
@Override public void run(){
draggablePanel.setVisibility(View.GONE);
draggablePanel.closeToLeft();
}
}
,DELAY_MILLIS);
break;
case CLOSED_AT_RIGHT:
handler.postDelayed(new Runnable(){
@Override public void run(){
draggablePanel.setVisibility(View.GONE);
draggablePanel.closeToRight();
}
}
,DELAY_MILLIS);
break;
default :
draggablePanel.setVisibility(View.GONE);
break;
}
}
Program: 28252
Project: 28252
Buggy source:
private void initializeListView(){
  lv_places.setAdapter(placesAdapter);
  lv_places.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int position,    long id){
      lastVideoLoadedPosition=position;
      showPlace(position);
    }
  }
);
}

Fixed version (ground truth):
private void initializeListView(){
  placesListView.setAdapter(placesAdapter);
  placesListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int position,    long id){
      lastVideoLoadedPosition=position;
      showPlace(position);
    }
  }
);
}
Program: 28253
Project: 28253
Buggy source:
private void initializeDraggablePanel(){
  draggablePanel.setFragmentManager(getSupportFragmentManager());
  draggablePanel.setTopFragment(placeFragment);
  draggablePanel.setBottomFragment(mapFragment);
  TypedValue typedValue=new TypedValue();
  getResources().getValue(R.dimen.x_scale_factor,typedValue,true);
  float xScaleFactor=typedValue.getFloat();
  typedValue=new TypedValue();
  getResources().getValue(R.dimen.y_scale_factor,typedValue,true);
  float yScaleFactor=typedValue.getFloat();
  draggablePanel.setXScaleFactor(xScaleFactor);
  draggablePanel.setyScaleFactor(yScaleFactor);
  draggablePanel.setTopViewHeight(getResources().getDimension(R.dimen.top_fragment_height));
  draggablePanel.setTopFragmentMarginRight(getResources().getDimension(R.dimen.top_fragment_margin));
  draggablePanel.setTopFragmentMarginBottom(getResources().getDimension(R.dimen.top_fragment_margin));
  draggablePanel.initializeView();
  draggablePanel.setVisibility(View.GONE);
}

Fixed version (ground truth):
private void initializeDraggablePanel() throws Resources.NotFoundException {
  draggablePanel.setFragmentManager(getSupportFragmentManager());
  draggablePanel.setTopFragment(placeFragment);
  draggablePanel.setBottomFragment(mapFragment);
  TypedValue typedValue=new TypedValue();
  getResources().getValue(R.dimen.x_scale_factor,typedValue,true);
  float xScaleFactor=typedValue.getFloat();
  typedValue=new TypedValue();
  getResources().getValue(R.dimen.y_scale_factor,typedValue,true);
  float yScaleFactor=typedValue.getFloat();
  draggablePanel.setXScaleFactor(xScaleFactor);
  draggablePanel.setyScaleFactor(yScaleFactor);
  draggablePanel.setTopViewHeight(getResources().getDimension(R.dimen.top_fragment_height));
  draggablePanel.setTopFragmentMarginRight(getResources().getDimension(R.dimen.top_fragment_margin));
  draggablePanel.setTopFragmentMarginBottom(getResources().getDimension(R.dimen.top_fragment_margin));
  draggablePanel.initializeView();
  draggablePanel.setVisibility(View.GONE);
}
Program: 28254
Project: 28254
Buggy source:
private void showPlace(int position){
  draggablePanel.setVisibility(View.VISIBLE);
  draggablePanel.maximize();
  PlaceViewModel placeViewModel=placesAdapter.getItem(position);
  placeFragment.showPlace(placeViewModel);
  mapFragment.getMap().clear();
  LatLng latitudeLongitude=new LatLng(placeViewModel.getLatitude(),placeViewModel.getLongitude());
  MarkerOptions marker=new MarkerOptions().position(latitudeLongitude);
  marker.title(placeViewModel.getName());
  marker.snippet(placeViewModel.getLatitude() + "String_Node_Str" + placeViewModel.getLongitude());
  mapFragment.getMap().addMarker(marker);
  mapFragment.getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(latitudeLongitude,10f));
}

Fixed version (ground truth):
private void showPlace(int position){
  draggablePanel.setVisibility(View.VISIBLE);
  draggablePanel.maximize();
  PlaceViewModel placeViewModel=placesAdapter.getItem(position);
  placeFragment.showPlace(placeViewModel);
  mapFragment.getMap().clear();
  LatLng latitudeLongitude=new LatLng(placeViewModel.getLatitude(),placeViewModel.getLongitude());
  MarkerOptions marker=new MarkerOptions().position(latitudeLongitude);
  marker.title(placeViewModel.getName());
  marker.snippet(placeViewModel.getLatitude() + "String_Node_Str" + placeViewModel.getLongitude());
  mapFragment.getMap().addMarker(marker);
  mapFragment.getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(latitudeLongitude,ZOOM));
}
Program: 28255
Project: 28255
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  dragView.layout(lastLeftPosition,lastTopPosition,lastLeftPosition + dragView.getMeasuredWidth(),(int)(lastTopPosition + topViewHeight));
  secondView.layout(0,(int)(lastTopPosition + topViewHeight),right,lastTopPosition + bottom);
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  int topViewHeight=this.topViewHeight == DEFAULT_TOP_VIEW_HEIGHT ? dragView.getMeasuredHeight() : (int)this.topViewHeight;
  dragView.layout(lastLeftPosition,lastTopPosition,lastLeftPosition + dragView.getMeasuredWidth(),lastTopPosition + topViewHeight);
  secondView.layout(0,lastTopPosition + topViewHeight,right,lastTopPosition + bottom);
}
Program: 28256
Project: 28256
Buggy source:
private void initializeDraggableView(){
  Handler handler=new Handler();
  handler.postDelayed(new Runnable(){
    @Override public void run(){
      draggableView.setVisibility(View.GONE);
      draggableView.closeToRight();
    }
  }
,10);
}

Fixed version (ground truth):
private void initializeDraggableView(){
  Handler handler=new Handler();
  handler.postDelayed(new Runnable(){
    @Override public void run(){
      draggableView.setVisibility(View.GONE);
      draggableView.closeToRight();
    }
  }
,DELAY_MILLIS);
}
Program: 28257
Project: 28257
Buggy source:
private void renderEpisodes(final TvShowViewModel tvShow){
  List<Renderer<EpisodeViewModel>> episodeRenderers=new LinkedList<Renderer<EpisodeViewModel>>();
  episodeRenderers.add(new EpisodeRenderer(this));
  EpisodeRendererBuilder episodeRendererBuilder=new EpisodeRendererBuilder(episodeRenderers);
  EpisodeRendererAdapter episodesAdapter=new EpisodeRendererAdapter(getLayoutInflater(),episodeRendererBuilder,tvShow.getEpisodes());
  lv_episodes.setAdapter(episodesAdapter);
}

Fixed version (ground truth):
private void renderEpisodes(final TvShowViewModel tvShow){
  List<Renderer<EpisodeViewModel>> episodeRenderers=new LinkedList<Renderer<EpisodeViewModel>>();
  episodeRenderers.add(new EpisodeRenderer());
  EpisodeRendererBuilder episodeRendererBuilder=new EpisodeRendererBuilder(episodeRenderers);
  EpisodeRendererAdapter episodesAdapter=new EpisodeRendererAdapter(getLayoutInflater(),episodeRendererBuilder,tvShow.getEpisodes());
  lv_episodes.setAdapter(episodesAdapter);
}
Program: 28258
Project: 28258
Buggy source:
@Override protected void render(){
  EpisodeViewModel episode=getContent();
  tv_episode_number.setText(String.format("String_Node_Str",position + 1));
  tv_episode_title.setText(episode.getTitle());
  tv_episode_publish_date.setText(episode.getPublishDate());
}

Fixed version (ground truth):
@Override protected void render(){
  EpisodeViewModel episode=getContent();
  episodeNumberTextView.setText(String.format("String_Node_Str",position + 1));
  episodeTitleTextView.setText(episode.getTitle());
  episodeDateTextView.setText(episode.getPublishDate());
}
Program: 28259
Project: 28259
Buggy source:
@Override protected void render(){
  TvShowViewModel tvShow=getContent();
  Picasso.with(context).load(tvShow.getPoster()).placeholder(R.drawable.tv_show_placeholder).into(iv_thumbnail);
  tv_title.setText(tvShow.getTitle().toUpperCase());
  tv_seasons_counter.setText(tvShow.getNumberOfSeasons() + "String_Node_Str");
}

Fixed version (ground truth):
@Override protected void render(){
  TvShowViewModel tvShow=getContent();
  Picasso.with(context).load(tvShow.getPoster()).placeholder(R.drawable.tv_show_placeholder).into(thumbnailImageView);
  titleTextView.setText(tvShow.getTitle().toUpperCase());
  seasonsCounterTextView.setText(tvShow.getNumberOfSeasons() + "String_Node_Str");
}
Program: 28260
Project: 28260
Buggy source:
private void recoverDraggablePanelState(Bundle savedInstanceState){
  final DraggablePanelState draggablePanelState=(DraggablePanelState)savedInstanceState.getSerializable(DRAGGABLE_PANEL_STATE);
  if (draggablePanelState == null) {
    draggablePanel.setVisibility(View.GONE);
    return;
  }
  Handler handler=new Handler();
switch (draggablePanelState) {
case MAXIMIZED:
    handler.postDelayed(new Runnable(){
      @Override public void run(){
        draggablePanel.maximize();
      }
    }
,DELAY_MILLIS);
  break;
case MINIMIZED:
handler.postDelayed(new Runnable(){
  @Override public void run(){
    draggablePanel.minimize();
  }
}
,DELAY_MILLIS);
break;
case CLOSED_AT_LEFT:
handler.postDelayed(new Runnable(){
@Override public void run(){
draggablePanel.setVisibility(View.GONE);
draggablePanel.closeToLeft();
}
}
,DELAY_MILLIS);
break;
case CLOSED_AT_RIGHT:
handler.postDelayed(new Runnable(){
@Override public void run(){
draggablePanel.setVisibility(View.GONE);
draggablePanel.closeToRight();
}
}
,DELAY_MILLIS);
break;
default :
draggablePanel.setVisibility(View.GONE);
break;
}
}

Fixed version (ground truth):
private void recoverDraggablePanelState(Bundle savedInstanceState){
  final DraggablePanelState draggablePanelState=(DraggablePanelState)savedInstanceState.getSerializable(DRAGGABLE_PANEL_STATE);
  if (draggablePanelState == null) {
    draggablePanel.setVisibility(View.GONE);
    return;
  }
  updateDraggablePanelStateDelayed(draggablePanelState);
}
Program: 28261
Project: 28261
Buggy source:
private void renderEpisodesHeader(TvShowViewModel tvShow){
  lv_episodes.removeHeaderView(header);
  header=(TextView)getLayoutInflater().inflate(R.layout.episode_header,null);
  header.setText(tvShow.getTitle().toUpperCase() + "String_Node_Str");
  lv_episodes.setAdapter(null);
  lv_episodes.addHeaderView(header);
  lv_episodes.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int position,    long id){
      if (tvShowSelected != null) {
        EpisodeViewModel episodeViewModel=tvShowSelected.getEpisodes().get(position - 1);
        Toast.makeText(getBaseContext(),tvShowSelected.getTitle() + "String_Node_Str" + episodeViewModel.getTitle(),Toast.LENGTH_LONG).show();
      }
    }
  }
);
}

Fixed version (ground truth):
private void renderEpisodesHeader(TvShowViewModel tvShow){
  episodesListView.removeHeaderView(header);
  header=(TextView)getLayoutInflater().inflate(R.layout.episode_header,null);
  header.setText(tvShow.getTitle().toUpperCase() + "String_Node_Str");
  episodesListView.setAdapter(null);
  episodesListView.addHeaderView(header);
  episodesListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int position,    long id){
      if (tvShowSelected != null) {
        EpisodeViewModel episodeViewModel=tvShowSelected.getEpisodes().get(position - 1);
        Toast.makeText(getBaseContext(),tvShowSelected.getTitle() + "String_Node_Str" + episodeViewModel.getTitle(),Toast.LENGTH_LONG).show();
      }
    }
  }
);
}
Program: 28262
Project: 28262
Buggy source:
private void initializeGridView(){
  gv_tv_shows.setAdapter(adapter);
  gv_tv_shows.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int position,    long id){
      TvShowViewModel tvShow=adapter.getItem(position);
      tvShowSelected=tvShow;
      Picasso.with(getBaseContext()).load(tvShow.getFanArt()).placeholder(R.drawable.tv_show_placeholder).into(iv_fan_art);
      renderEpisodesHeader(tvShow);
      renderEpisodes(tvShow);
      draggableView.setVisibility(View.VISIBLE);
      draggableView.maximize();
    }
  }
);
}

Fixed version (ground truth):
private void initializeGridView(){
  tvShowsGridView.setAdapter(adapter);
  tvShowsGridView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int position,    long id){
      TvShowViewModel tvShow=adapter.getItem(position);
      tvShowSelected=tvShow;
      Picasso.with(getBaseContext()).load(tvShow.getFanArt()).placeholder(R.drawable.tv_show_placeholder).into(fanArtImageView);
      renderEpisodesHeader(tvShow);
      renderEpisodes(tvShow);
      draggableView.setVisibility(View.VISIBLE);
      draggableView.maximize();
    }
  }
);
}
Program: 28263
Project: 28263
Buggy source:
@Override public void onClosedToRight(){
  tvShowSelected=null;
  getSupportActionBar().setTitle(R.string.tv_shows_sample_activity_title);
}

Fixed version (ground truth):
@Override public void onClosedToRight(){
  resetActionBarTitle();
}
Program: 28264
Project: 28264
Buggy source:
@Override public void onClosedToLeft(){
  tvShowSelected=null;
  getSupportActionBar().setTitle(R.string.tv_shows_sample_activity_title);
}

Fixed version (ground truth):
@Override public void onClosedToLeft(){
  resetActionBarTitle();
}
Program: 28265
Project: 28265
Buggy source:
@Override public void onMaximized(){
  if (tvShowSelected != null) {
    getSupportActionBar().setTitle(tvShowSelected.getTitle());
  }
}

Fixed version (ground truth):
@Override public void onMaximized(){
  updateActionBarTitle();
}
Program: 28266
Project: 28266
Buggy source:
@Override public void onMinimized(){
  if (tvShowSelected != null) {
    getSupportActionBar().setTitle(tvShowSelected.getTitle());
  }
}

Fixed version (ground truth):
@Override public void onMinimized(){
  updateActionBarTitle();
}
Program: 28267
Project: 28267
Buggy source:
private void hookListeners(){
  draggableView.setDraggableListener(new DraggableListener(){
    @Override public void onMaximized(){
      if (tvShowSelected != null) {
        getSupportActionBar().setTitle(tvShowSelected.getTitle());
      }
    }
    @Override public void onMinimized(){
      if (tvShowSelected != null) {
        getSupportActionBar().setTitle(tvShowSelected.getTitle());
      }
    }
    @Override public void onClosedToLeft(){
      tvShowSelected=null;
      getSupportActionBar().setTitle(R.string.tv_shows_sample_activity_title);
    }
    @Override public void onClosedToRight(){
      tvShowSelected=null;
      getSupportActionBar().setTitle(R.string.tv_shows_sample_activity_title);
    }
  }
);
}

Fixed version (ground truth):
private void hookListeners(){
  draggableView.setDraggableListener(new DraggableListener(){
    @Override public void onMaximized(){
      updateActionBarTitle();
    }
    @Override public void onMinimized(){
      updateActionBarTitle();
    }
    @Override public void onClosedToLeft(){
      resetActionBarTitle();
    }
    @Override public void onClosedToRight(){
      resetActionBarTitle();
    }
  }
);
}
Program: 28268
Project: 28268
Buggy source:
private void renderEpisodes(final TvShowViewModel tvShow){
  List<Renderer<EpisodeViewModel>> episodeRenderers=new LinkedList<Renderer<EpisodeViewModel>>();
  episodeRenderers.add(new EpisodeRenderer());
  EpisodeRendererBuilder episodeRendererBuilder=new EpisodeRendererBuilder(episodeRenderers);
  EpisodeRendererAdapter episodesAdapter=new EpisodeRendererAdapter(getLayoutInflater(),episodeRendererBuilder,tvShow.getEpisodes());
  lv_episodes.setAdapter(episodesAdapter);
}

Fixed version (ground truth):
private void renderEpisodes(final TvShowViewModel tvShow){
  List<Renderer<EpisodeViewModel>> episodeRenderers=new LinkedList<Renderer<EpisodeViewModel>>();
  episodeRenderers.add(new EpisodeRenderer());
  EpisodeRendererBuilder episodeRendererBuilder=new EpisodeRendererBuilder(episodeRenderers);
  EpisodeRendererAdapter episodesAdapter=new EpisodeRendererAdapter(getLayoutInflater(),episodeRendererBuilder,tvShow.getEpisodes());
  episodesListView.setAdapter(episodesAdapter);
}
Program: 28269
Project: 28269
Buggy source:
@Override public void onMaximized(){
  if (!videoView.isPlaying()) {
    videoView.start();
  }
}

Fixed version (ground truth):
@Override public void onMaximized(){
  startVideo();
}
Program: 28270
Project: 28270
Buggy source:
private void hookDraggableViewListener(){
  draggableView.setDraggableListener(new DraggableListener(){
    @Override public void onMaximized(){
      if (!videoView.isPlaying()) {
        videoView.start();
      }
    }
    @Override public void onMinimized(){
    }
    @Override public void onClosedToLeft(){
      if (videoView.isPlaying()) {
        videoView.pause();
      }
    }
    @Override public void onClosedToRight(){
      if (videoView.isPlaying()) {
        videoView.pause();
      }
    }
  }
);
}

Fixed version (ground truth):
private void hookDraggableViewListener(){
  draggableView.setDraggableListener(new DraggableListener(){
    @Override public void onMaximized(){
      startVideo();
    }
    @Override public void onMinimized(){
    }
    @Override public void onClosedToLeft(){
      pauseVideo();
    }
    @Override public void onClosedToRight(){
      pauseVideo();
    }
  }
);
}
Program: 28271
Project: 28271
Buggy source:
private void initializePoster(){
  Picasso.with(this).load(VIDEO_POSTER).placeholder(R.drawable.spiderman_placeholder).into(iv_poster);
  Picasso.with(this).load(VIDEO_THUMBNAIL).placeholder(R.drawable.spiderman_placeholder).into(iv_thumbnail);
}

Fixed version (ground truth):
private void initializePoster(){
  Picasso.with(this).load(VIDEO_POSTER).placeholder(R.drawable.spiderman_placeholder).into(posterImageView);
  Picasso.with(this).load(VIDEO_THUMBNAIL).placeholder(R.drawable.spiderman_placeholder).into(thumbnailImageView);
}
Program: 28272
Project: 28272
Buggy source:
@Override public void onClosedToRight(){
  if (videoView.isPlaying()) {
    videoView.pause();
  }
}

Fixed version (ground truth):
@Override public void onClosedToRight(){
  pauseVideo();
}
Program: 28273
Project: 28273
Buggy source:
@Override public void onClosedToLeft(){
  if (videoView.isPlaying()) {
    videoView.pause();
  }
}

Fixed version (ground truth):
@Override public void onClosedToLeft(){
  pauseVideo();
}
Program: 28274
Project: 28274
Buggy source:
@Override public void onMaximized(){
  if (!youtubePlayer.isPlaying()) {
    youtubePlayer.play();
  }
}

Fixed version (ground truth):
@Override public void onMaximized(){
  playVideo();
}
Program: 28275
Project: 28275
Buggy source:
private void hookDraggablePanelListeners(){
  draggablePanel.setDraggableListener(new DraggableListener(){
    @Override public void onMaximized(){
      if (!youtubePlayer.isPlaying()) {
        youtubePlayer.play();
      }
    }
    @Override public void onMinimized(){
    }
    @Override public void onClosedToLeft(){
      if (youtubePlayer.isPlaying()) {
        youtubePlayer.pause();
      }
    }
    @Override public void onClosedToRight(){
      if (youtubePlayer.isPlaying()) {
        youtubePlayer.pause();
      }
    }
  }
);
}

Fixed version (ground truth):
private void hookDraggablePanelListeners(){
  draggablePanel.setDraggableListener(new DraggableListener(){
    @Override public void onMaximized(){
      playVideo();
    }
    @Override public void onMinimized(){
    }
    @Override public void onClosedToLeft(){
      pauseVideo();
    }
    @Override public void onClosedToRight(){
      pauseVideo();
    }
  }
);
}
Program: 28276
Project: 28276
Buggy source:
@Override public void onClosedToRight(){
  if (youtubePlayer.isPlaying()) {
    youtubePlayer.pause();
  }
}

Fixed version (ground truth):
@Override public void onClosedToRight(){
  pauseVideo();
}
Program: 28277
Project: 28277
Buggy source:
@Override public void onClosedToLeft(){
  if (youtubePlayer.isPlaying()) {
    youtubePlayer.pause();
  }
}

Fixed version (ground truth):
@Override public void onClosedToLeft(){
  pauseVideo();
}
Program: 28278
Project: 28278
Buggy source:
private void initializeDraggablePanel(){
  draggablePanel.setFragmentManager(getSupportFragmentManager());
  draggablePanel.setTopFragment(youtubeFragment);
  MoviePosterFragment moviePosterFragment=new MoviePosterFragment();
  moviePosterFragment.setPoster(VIDEO_POSTER_THUMBNAIL);
  moviePosterFragment.setPosterTitle(VIDEO_POSTER_TITLE);
  draggablePanel.setBottomFragment(moviePosterFragment);
  draggablePanel.initializeView();
  Picasso.with(this).load(SECOND_VIDEO_POSTER_THUMBNAIL).placeholder(R.drawable.xmen_placeholder).into(iv_thumbnail);
}

Fixed version (ground truth):
private void initializeDraggablePanel(){
  draggablePanel.setFragmentManager(getSupportFragmentManager());
  draggablePanel.setTopFragment(youtubeFragment);
  MoviePosterFragment moviePosterFragment=new MoviePosterFragment();
  moviePosterFragment.setPoster(VIDEO_POSTER_THUMBNAIL);
  moviePosterFragment.setPosterTitle(VIDEO_POSTER_TITLE);
  draggablePanel.setBottomFragment(moviePosterFragment);
  draggablePanel.initializeView();
  Picasso.with(this).load(SECOND_VIDEO_POSTER_THUMBNAIL).placeholder(R.drawable.xmen_placeholder).into(thumbnailImageView);
}
Program: 28279
Project: 28279
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.fragment_movie_poster,container,false);
  ButterKnife.inject(this,view);
  Picasso.with(getActivity()).load(videoPosterThumbnail).placeholder(R.drawable.xmen_placeholder).into(iv_thumbnail);
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.fragment_movie_poster,container,false);
  ButterKnife.inject(this,view);
  Picasso.with(getActivity()).load(videoPosterThumbnail).placeholder(R.drawable.xmen_placeholder).into(thumbnailImageView);
  return view;
}
Program: 28280
Project: 28280
Buggy source:
public void showPlace(PlaceViewModel placeViewModel){
  this.placeViewModel=placeViewModel;
  tv_name.setText(placeViewModel.getName());
  Picasso.with(getActivity()).load(placeViewModel.getPhoto()).placeholder(R.drawable.maps_placeholder).into(iv_photo);
}

Fixed version (ground truth):
public void showPlace(PlaceViewModel placeViewModel){
  this.placeViewModel=placeViewModel;
  nameTextView.setText(placeViewModel.getName());
  Picasso.with(getActivity()).load(placeViewModel.getPhoto()).placeholder(R.drawable.maps_placeholder).into(photoImageView);
}
Program: 28281
Project: 28281
Buggy source:
@Override protected void render(){
  PlaceViewModel place=getContent();
  tv_name.setText(place.getName());
  Picasso.with(context).load(place.getPhoto()).placeholder(R.drawable.maps_placeholder).into(iv_photo);
}

Fixed version (ground truth):
@Override protected void render(){
  PlaceViewModel place=getContent();
  nameTextView.setText(place.getName());
  Picasso.with(context).load(place.getPhoto()).placeholder(R.drawable.maps_placeholder).into(photoImageView);
}
Program: 28282
Project: 28282
Buggy source:
@Override public void onViewPositionChanged(View changedView,int left,int top,int dx,int dy){
  if (draggableView.isDragViewAtBottom()) {
    draggableView.changeDragViewViewAlpha();
  }
 else {
    draggableView.changeDragViewScale();
    draggableView.changeDragViewPosition();
    draggableView.changeSecondViewAlpha();
    draggableView.changeSeondViewPosition();
    draggableView.changeBackgroundAlpha();
  }
  draggableView.invalidate();
}

Fixed version (ground truth):
@Override public void onViewPositionChanged(View changedView,int left,int top,int dx,int dy){
  draggableView.updateLastDragViewPosition(top,left);
  if (draggableView.isDragViewAtBottom()) {
    draggableView.changeDragViewViewAlpha();
  }
 else {
    draggableView.changeDragViewScale();
    draggableView.changeDragViewPosition();
    draggableView.changeSecondViewAlpha();
    draggableView.changeSeondViewPosition();
    draggableView.changeBackgroundAlpha();
  }
  draggableView.invalidate();
}
Program: 28283
Project: 28283
Buggy source:
@Override public int clampViewPositionHorizontal(View child,int left,int dx){
  int newLeft=0;
  if (((isMinimized() && (dx > MINIMUN_DX_FOR_HORIZONTAL_DRAG || dx < -MINIMUN_DX_FOR_HORIZONTAL_DRAG))) || (isDragViewAtBottom())) {
    newLeft=left;
  }
  return newLeft;
}

Fixed version (ground truth):
@Override public int clampViewPositionHorizontal(View child,int left,int dx){
  int newLeft=0;
  if (((isMinimized() && (dx > MINIMUN_DX_FOR_HORIZONTAL_DRAG || dx < -MINIMUN_DX_FOR_HORIZONTAL_DRAG))) || (isDragViewAtBottom() && !isDragViewAtRight())) {
    newLeft=left;
  }
  return newLeft;
}
Program: 28284
Project: 28284
Buggy source:
@Override public int clampViewPositionVertical(View child,int top,int dy){
  int newTop;
  if (isMinimized() && (dy >= MINIMUM_DY_FOR_VERTICAL_DRAG || dy >= -MINIMUM_DY_FOR_VERTICAL_DRAG) || (!isMinimized() && !isDragViewAtBottom())) {
    final int topBound=getPaddingTop();
    final int bottomBound=getHeight() - child.getHeight() - child.getPaddingBottom();
    newTop=Math.min(Math.max(top,topBound),bottomBound);
  }
 else {
    newTop=getHeight() - dragView.getHeight();
  }
  return newTop;
}

Fixed version (ground truth):
@Override public int clampViewPositionVertical(View child,int top,int dy){
  int newTop=getHeight() - dragView.getHeight();
  if (isMinimized() && (dy >= MINIMUM_DY_FOR_VERTICAL_DRAG || dy >= -MINIMUM_DY_FOR_VERTICAL_DRAG) || (!isMinimized() && !isDragViewAtBottom())) {
    final int topBound=getPaddingTop();
    final int bottomBound=getHeight() - child.getHeight() - child.getPaddingBottom();
    newTop=Math.min(Math.max(top,topBound),bottomBound);
  }
  return newTop;
}
Program: 28285
Project: 28285
Buggy source:
private boolean isDragViewAtRight(){
  return dragView.getRight() >= (getWidth() - MINIMUN_DX_FOR_HORIZONTAL_DRAG);
}

Fixed version (ground truth):
private boolean isDragViewAtRight(){
  return dragView.getRight() == getWidth();
}
Program: 28287
Project: 28287
Buggy source:
@Override public void run(){
  try {
    int nBytesRead=line.read(audioBytes,0,line.available());
    int nSamplesRead=nBytesRead / 2;
    short[] samples=new short[nSamplesRead];
    ByteBuffer.wrap(audioBytes).order(ByteOrder.LITTLE_ENDIAN).asShortBuffer().get(samples);
    ShortBuffer sBuff=ShortBuffer.wrap(samples,0,nSamplesRead);
    recorder.recordSamples(sampleRate,numChannels,sBuff);
  }
 catch (  org.bytedeco.javacv.FrameRecorder.Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    int nBytesRead=0;
    while (nBytesRead == 0) {
      nBytesRead=line.read(audioBytes,0,line.available());
    }
    int nSamplesRead=nBytesRead / 2;
    short[] samples=new short[nSamplesRead];
    ByteBuffer.wrap(audioBytes).order(ByteOrder.LITTLE_ENDIAN).asShortBuffer().get(samples);
    ShortBuffer sBuff=ShortBuffer.wrap(samples,0,nSamplesRead);
    recorder.recordSamples(sampleRate,numChannels,sBuff);
  }
 catch (  org.bytedeco.javacv.FrameRecorder.Exception e) {
    e.printStackTrace();
  }
}
Program: 28288
Project: 28288
Buggy source:
public static void main(String[] args) throws Exception {
  String modelTxt="String_Node_Str";
  String modelBin="String_Node_Str";
  String imageFile=(args.length > 0) ? args[0] : "String_Node_Str";
  Importer importer=null;
  try {
    importer=createCaffeImporter(modelTxt,modelBin);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  if (importer == null) {
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str" + modelTxt);
    System.err.println("String_Node_Str" + modelBin);
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    System.exit(-1);
  }
  Net net=new Net();
  importer.populateNet(net);
  importer.close();
  Mat img=imread(imageFile);
  if (img.empty()) {
    System.err.println("String_Node_Str" + imageFile);
    System.exit(-1);
  }
  resize(img,img,new Size(224,224));
  Blob inputBlob=new Blob(img);
  net.setBlob("String_Node_Str",inputBlob);
  net.forward();
  Blob prob=net.getBlob("String_Node_Str");
  Point classId=new Point();
  double[] classProb=new double[1];
  getMaxClass(prob,classId,classProb);
  List<String> classNames=readClassNames();
  System.out.println("String_Node_Str" + classId.x() + "String_Node_Str"+ classNames.get(classId.x())+ "String_Node_Str");
  System.out.println("String_Node_Str" + classId.x());
  System.out.println("String_Node_Str" + classProb[0] * 100 + "String_Node_Str");
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  String modelTxt="String_Node_Str";
  String modelBin="String_Node_Str";
  String imageFile=(args.length > 0) ? args[0] : "String_Node_Str";
  Importer importer=null;
  try {
    importer=createCaffeImporter(modelTxt,modelBin);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  if (importer == null) {
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str" + modelTxt);
    System.err.println("String_Node_Str" + modelBin);
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    System.exit(-1);
  }
  Net net=new Net();
  importer.populateNet(net);
  importer.close();
  Mat img=imread(imageFile);
  if (img.empty()) {
    System.err.println("String_Node_Str" + imageFile);
    System.exit(-1);
  }
  resize(img,img,new Size(224,224));
  Blob inputBlob=Blob.fromImages(img);
  net.setBlob("String_Node_Str",inputBlob);
  net.forward();
  Blob prob=net.getBlob("String_Node_Str");
  Point classId=new Point();
  double[] classProb=new double[1];
  getMaxClass(prob,classId,classProb);
  List<String> classNames=readClassNames();
  System.out.println("String_Node_Str" + classId.x() + "String_Node_Str"+ classNames.get(classId.x())+ "String_Node_Str");
  System.out.println("String_Node_Str" + classId.x());
  System.out.println("String_Node_Str" + classProb[0] * 100 + "String_Node_Str");
}
Program: 28289
Project: 28289
Buggy source:
@Override public long call(Pointer opaque,long offset,int whence){
  try {
    InputStream is=inputStreams.get(opaque);
switch (whence) {
case 0:
      is.reset();
    break;
case 1:
  break;
default :
return -1;
}
is.skip(offset);
return 0;
}
 catch (Throwable t) {
System.err.println("String_Node_Str" + t);
return -1;
}
}

Fixed version (ground truth):
@Override public long call(Pointer opaque,long offset,int whence){
  try {
    InputStream is=inputStreams.get(opaque);
switch (whence) {
case 0:
      is.reset();
    break;
case 1:
  break;
default :
return -1;
}
long remaining=offset;
while (remaining > 0) {
long skipped=is.skip(remaining);
if (skipped == 0) break;
remaining-=skipped;
}
return 0;
}
 catch (Throwable t) {
System.err.println("String_Node_Str" + t);
return -1;
}
}
Program: 28290
Project: 28290
Buggy source:
public Frame pull() throws Exception {
  av_frame_unref(filt_frame);
  int ret=av_buffersink_get_frame(buffersink_ctx,filt_frame);
  if (ret == -11 || ret == AVERROR_EOF) {
    return null;
  }
 else   if (ret < 0) {
    throw new Exception("String_Node_Str" + av_make_error_string(new BytePointer(256),256,ret).getString());
  }
  frame.imageWidth=filt_frame.width();
  frame.imageHeight=filt_frame.height();
  frame.imageDepth=Frame.DEPTH_UBYTE;
  if (filt_frame.data(1) == null) {
    frame.imageStride=filt_frame.linesize(0);
    BytePointer ptr=filt_frame.data(0);
    if (ptr != null && !ptr.equals(image_ptr[0])) {
      image_ptr[0]=ptr.capacity(frame.imageHeight * frame.imageStride);
      image_buf[0]=ptr.asBuffer();
    }
    frame.image=image_buf;
    frame.image[0].position(0).limit(frame.imageHeight * frame.imageStride);
    frame.imageChannels=frame.imageStride / frame.imageWidth;
  }
 else {
    frame.imageStride=frame.imageWidth;
    int size=avpicture_get_size(filt_frame.format(),frame.imageWidth,frame.imageHeight);
    if (image_ptr[0] == null || image_ptr[0].capacity() < size) {
      image_ptr[0]=new BytePointer(size);
      image_buf[0]=image_ptr[0].asBuffer();
    }
    frame.image=image_buf;
    frame.image[0].position(0).limit(size);
    frame.imageChannels=2;
    ret=avpicture_layout(new AVPicture(filt_frame),filt_frame.format(),frame.imageWidth,frame.imageHeight,image_ptr[0].position(0),image_ptr[0].capacity());
  }
  return frame;
}

Fixed version (ground truth):
public Frame pull() throws Exception {
  av_frame_unref(filt_frame);
  int ret=av_buffersink_get_frame(buffersink_ctx,filt_frame);
  if (ret == -11 || ret == AVERROR_EOF) {
    return null;
  }
 else   if (ret < 0) {
    throw new Exception("String_Node_Str" + av_make_error_string(new BytePointer(256),256,ret).getString());
  }
  frame.imageWidth=filt_frame.width();
  frame.imageHeight=filt_frame.height();
  frame.imageDepth=Frame.DEPTH_UBYTE;
  if (filt_frame.data(1) == null) {
    frame.imageStride=filt_frame.linesize(0);
    BytePointer ptr=filt_frame.data(0);
    if (ptr != null && !ptr.equals(image_ptr[0])) {
      image_ptr[0]=ptr.capacity(frame.imageHeight * frame.imageStride);
      image_buf[0]=ptr.asBuffer();
    }
    frame.image=image_buf;
    frame.image[0].position(0).limit(frame.imageHeight * frame.imageStride);
    frame.imageChannels=frame.imageStride / frame.imageWidth;
  }
 else {
    frame.imageStride=frame.imageWidth;
    int size=avpicture_get_size(filt_frame.format(),frame.imageWidth,frame.imageHeight);
    if (image_buf[0] == null || image_buf[0].capacity() < size) {
      image_buf[0]=ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder());
    }
    frame.image=image_buf;
    frame.image[0].position(0).limit(size);
    frame.imageChannels=2;
    ret=avpicture_layout(new AVPicture(filt_frame),filt_frame.format(),frame.imageWidth,frame.imageHeight,(ByteBuffer)frame.image[0].position(0),frame.image[0].capacity());
  }
  return frame;
}
Program: 28291
Project: 28291
Buggy source:
public static void main(final String[] args){
  final Mat pFrame=imread("String_Node_Str",CV_LOAD_IMAGE_GRAYSCALE), cFrame=imread("String_Node_Str",CV_LOAD_IMAGE_GRAYSCALE), pGray=new Mat(), cGray=new Mat(), Optical_Flow=new Mat();
  pFrame.convertTo(pGray,CV_32FC1);
  cFrame.convertTo(cGray,CV_32FC1);
  final DenseOpticalFlow tvl1=createOptFlow_DualTVL1();
  tvl1.calc(pGray,cGray,Optical_Flow);
  final Mat OF=new Mat(pGray.rows(),pGray.cols(),CV_32FC1);
  final FloatBuffer in=Optical_Flow.<FloatBuffer>createBuffer(), out=OF.<FloatBuffer>createBuffer();
  final int height=pGray.rows(), width=pGray.cols();
  for (int y=0; y < height; y++) {
    for (int x=0; x < width; x++) {
      final float xVelocity=in.get();
      final float yVelocity=in.get();
      final float pixelVelocity=(float)Math.sqrt(xVelocity * xVelocity + yVelocity * yVelocity);
      out.put(pixelVelocity);
    }
  }
  imwrite("String_Node_Str",OF);
}

Fixed version (ground truth):
public static void main(final String[] args){
  final Mat pFrame=imread("String_Node_Str",CV_LOAD_IMAGE_GRAYSCALE), cFrame=imread("String_Node_Str",CV_LOAD_IMAGE_GRAYSCALE), pGray=new Mat(), cGray=new Mat(), Optical_Flow=new Mat();
  pFrame.convertTo(pGray,CV_32FC1);
  cFrame.convertTo(cGray,CV_32FC1);
  final DenseOpticalFlow tvl1=createOptFlow_DualTVL1();
  tvl1.calc(pGray,cGray,Optical_Flow);
  final Mat OF=new Mat(pGray.rows(),pGray.cols(),CV_32FC1);
  final FloatBuffer in=Optical_Flow.createBuffer(), out=OF.createBuffer();
  final int height=pGray.rows(), width=pGray.cols();
  for (int y=0; y < height; y++) {
    for (int x=0; x < width; x++) {
      final float xVelocity=in.get();
      final float yVelocity=in.get();
      final float pixelVelocity=(float)Math.sqrt(xVelocity * xVelocity + yVelocity * yVelocity);
      out.put(pixelVelocity);
    }
  }
  imwrite("String_Node_Str",OF);
}
Program: 28296
Project: 28296
Buggy source:
private void doCallbackAllocator(Class cls,String callbackName){
  String instanceTypeName=getFunctionClassName(cls);
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str" + cls.getCanonicalName() + "String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str" + instanceTypeName + "String_Node_Str"+ instanceTypeName+ "String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str" + callbackName + "String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str" + instanceTypeName + "String_Node_Str");
  deallocators.register(cls);
  out.println("String_Node_Str" + jclasses.register(Pointer.class) + "String_Node_Str");
  out.println("String_Node_Str" + callbackName + "String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}

Fixed version (ground truth):
private void doCallbackAllocator(Class cls,String callbackName){
  String instanceTypeName=getFunctionClassName(cls);
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str" + cls.getCanonicalName() + "String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str" + instanceTypeName + "String_Node_Str"+ instanceTypeName+ "String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str" + callbackName + "String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str" + mangle(cls.getName()) + "String_Node_Str");
  deallocators.register(cls);
  out.println("String_Node_Str" + jclasses.register(Pointer.class) + "String_Node_Str");
  out.println("String_Node_Str" + callbackName + "String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}
Program: 28298
Project: 28298
Buggy source:
public void onViewCreated(View view,Bundle savedInstanceState){
  if (view.getContext() != null && builder != null) {
    mLibTask=new LibraryTask(view.getContext());
    executeLibTask(mLibTask);
  }
}

Fixed version (ground truth):
public void onViewCreated(View view,Bundle savedInstanceState){
  if (view.getContext() != null && builder != null) {
    mLibTask=new LibraryTask(view.getContext().getApplicationContext());
    executeLibTask(mLibTask);
  }
}
Program: 28300
Project: 28300
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  boolean customTheme=false;
  Bundle bundle=getIntent().getExtras();
  if (bundle != null) {
    int themeId=bundle.getInt(Libs.BUNDLE_THEME,-1);
    if (themeId != -1) {
      customTheme=true;
      setTheme(themeId);
    }
  }
  if (!customTheme) {
    setTheme(R.style.Theme_AppCompat);
  }
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_opensource);
  String title="String_Node_Str";
  if (bundle != null) {
    title=bundle.getString(Libs.BUNDLE_TITLE);
  }
  LibsFragment fragment=new LibsFragment();
  fragment.setArguments(bundle);
  ActionBar ab=getSupportActionBar();
  if (ab != null) {
    Colors colors=bundle == null ? null : (Colors)bundle.getParcelable(Libs.BUNDLE_COLORS);
    if (colors != null) {
      ab.setBackgroundDrawable(new ColorDrawable(colors.appBarColor));
      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().setStatusBarColor(colors.statusBarColor);
      }
    }
 else     ab.setBackgroundDrawable(null);
    ab.setDisplayHomeAsUpEnabled(true);
    if (TextUtils.isEmpty(title)) {
      ab.setDisplayShowTitleEnabled(false);
    }
 else {
      ab.setDisplayShowTitleEnabled(true);
      ab.setTitle(title);
    }
    ab.setDisplayUseLogoEnabled(true);
  }
  FragmentManager fragmentManager=getSupportFragmentManager();
  fragmentManager.beginTransaction().replace(R.id.frame_container,fragment).commit();
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  boolean customTheme=false;
  Bundle bundle=getIntent().getExtras();
  if (bundle != null) {
    int themeId=bundle.getInt(Libs.BUNDLE_THEME,-1);
    if (themeId != -1) {
      customTheme=true;
      setTheme(themeId);
    }
  }
  if (!customTheme) {
    setTheme(R.style.Theme_AppCompat);
  }
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_opensource);
  String title="String_Node_Str";
  if (bundle != null) {
    title=bundle.getString(Libs.BUNDLE_TITLE);
  }
  LibsFragment fragment=new LibsFragment();
  fragment.setArguments(bundle);
  ActionBar ab=getSupportActionBar();
  if (ab != null) {
    if (bundle != null && bundle.containsKey(Libs.BUNDLE_COLORS)) {
      Colors colors=bundle.getParcelable(Libs.BUNDLE_COLORS);
      if (colors != null) {
        ab.setBackgroundDrawable(new ColorDrawable(colors.appBarColor));
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
          getWindow().setStatusBarColor(colors.statusBarColor);
        }
      }
 else {
        ab.setBackgroundDrawable(null);
      }
    }
    ab.setDisplayHomeAsUpEnabled(true);
    if (TextUtils.isEmpty(title)) {
      ab.setDisplayShowTitleEnabled(false);
    }
 else {
      ab.setDisplayShowTitleEnabled(true);
      ab.setTitle(title);
    }
    ab.setDisplayUseLogoEnabled(true);
  }
  FragmentManager fragmentManager=getSupportFragmentManager();
  fragmentManager.beginTransaction().replace(R.id.frame_container,fragment).commit();
}
Program: 28301
Project: 28301
Buggy source:
/** 
 * 旋转图片为指定角度<br> 来自：http://blog.51cto.com/cping1982/130066
 * @param image 目标图像
 * @param degree 旋转角度
 * @return 旋转后的图片
 * @since 3.2.2
 */
public Img rotate(int degree){
  final BufferedImage image=this.srcImage;
  int width=image.getWidth(null);
  int height=image.getHeight(null);
  final BufferedImage destImg=new BufferedImage(width,height,getTypeInt());
  Graphics2D graphics2d=destImg.createGraphics();
  graphics2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BILINEAR);
  graphics2d.rotate(Math.toRadians(degree),width / 2,height / 2);
  graphics2d.drawImage(image,0,0,null);
  graphics2d.dispose();
  this.destImage=destImg;
  return this;
}

Fixed version (ground truth):
/** 
 * 旋转图片为指定角度<br> 来自：http://blog.51cto.com/cping1982/130066
 * @param degree 旋转角度
 * @return 旋转后的图片
 * @since 3.2.2
 */
public Img rotate(int degree){
  final BufferedImage image=this.srcImage;
  int width=image.getWidth(null);
  int height=image.getHeight(null);
  final BufferedImage destImg=new BufferedImage(width,height,getTypeInt());
  Graphics2D graphics2d=destImg.createGraphics();
  graphics2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BILINEAR);
  graphics2d.rotate(Math.toRadians(degree),width / 2,height / 2);
  graphics2d.drawImage(image,0,0,null);
  graphics2d.dispose();
  this.destImage=destImg;
  return this;
}
Program: 28302
Project: 28302
Buggy source:
/** 
 * 生成随机颜色
 * @param random 随机对象 {@link Random}
 * @return 随机颜色
 * @since 4.1.5
 */
public static Color randomColor(){
  final Random random=getRandom();
  return new Color(random.nextInt(255),random.nextInt(255),random.nextInt(255));
}

Fixed version (ground truth):
/** 
 * 生成随机颜色
 * @return 随机颜色
 * @since 4.1.5
 */
public static Color randomColor(){
  final Random random=getRandom();
  return new Color(random.nextInt(255),random.nextInt(255),random.nextInt(255));
}
Program: 28303
Project: 28303
Buggy source:
/** 
 * 旋转图片为指定角度<br> 来自：http://blog.51cto.com/cping1982/130066
 * @param image 目标图像
 * @param degree 旋转角度
 * @return 旋转后的图片
 * @since 3.2.2
 */
public Img rotate(int degree){
  final BufferedImage image=this.srcImage;
  int width=image.getWidth(null);
  int height=image.getHeight(null);
  int type=ImageUtil.toBufferedImage(image).getTransparency();
  final BufferedImage destImg=new BufferedImage(width,height,type);
  Graphics2D graphics2d=destImg.createGraphics();
  graphics2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BILINEAR);
  graphics2d.rotate(Math.toRadians(degree),width / 2,height / 2);
  graphics2d.drawImage(image,0,0,null);
  graphics2d.dispose();
  this.destImage=destImg;
  return this;
}

Fixed version (ground truth):
/** 
 * 旋转图片为指定角度<br> 来自：http://blog.51cto.com/cping1982/130066
 * @param image 目标图像
 * @param degree 旋转角度
 * @return 旋转后的图片
 * @since 3.2.2
 */
public Img rotate(int degree){
  final BufferedImage image=this.srcImage;
  int width=image.getWidth(null);
  int height=image.getHeight(null);
  final BufferedImage destImg=new BufferedImage(width,height,getTypeInt());
  Graphics2D graphics2d=destImg.createGraphics();
  graphics2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BILINEAR);
  graphics2d.rotate(Math.toRadians(degree),width / 2,height / 2);
  graphics2d.drawImage(image,0,0,null);
  graphics2d.dispose();
  this.destImage=destImg;
  return this;
}
Program: 28304
Project: 28304
Buggy source:
/** 
 * 从Image取图片并开始处理
 * @param imageFile 图片文件
 * @return {@link Img}
 */
public static Img from(Image image){
  return new Img(ImageUtil.toBufferedImage(image));
}

Fixed version (ground truth):
/** 
 * 从Image取图片并开始处理
 * @param image 图片
 * @return {@link Img}
 */
public static Img from(Image image){
  return new Img(ImageUtil.toBufferedImage(image));
}