nus-yam/ex-repair huggingface dataset:
Program: 171756
Project: 171756
Buggy source:
public static ContentValues getContentValuesFromSite(Site site){
  ContentValues values=new ContentValues();
  if (site.getTitle() != null)   values.put(HistoryContract.BrowsingHistory.TITLE,site.getTitle());
  if (site.getUrl() != null)   values.put(HistoryContract.BrowsingHistory.URL,site.getUrl());
  if (site.getViewCount() != 0)   values.put(HistoryContract.BrowsingHistory.VIEW_COUNT,site.getViewCount());
  if (site.getLastViewTimestamp() != 0)   values.put(HistoryContract.BrowsingHistory.LAST_VIEW_TIMESTAMP,site.getLastViewTimestamp());
  if (site.getFavIcon() != null)   values.put(HistoryContract.BrowsingHistory.FAV_ICON,bitmapToBytes(site.getFavIcon()));
  return values;
}

Fixed version (ground truth):
public static ContentValues getContentValuesFromSite(Site site){
  ContentValues values=new ContentValues();
  if (site.getTitle() != null) {
    values.put(HistoryContract.BrowsingHistory.TITLE,site.getTitle());
  }
  if (site.getUrl() != null) {
    values.put(HistoryContract.BrowsingHistory.URL,site.getUrl());
  }
  if (site.getViewCount() != 0) {
    values.put(HistoryContract.BrowsingHistory.VIEW_COUNT,site.getViewCount());
  }
  if (site.getLastViewTimestamp() != 0) {
    values.put(HistoryContract.BrowsingHistory.LAST_VIEW_TIMESTAMP,site.getLastViewTimestamp());
  }
  if (site.getFavIcon() != null) {
    values.put(HistoryContract.BrowsingHistory.FAV_ICON,bitmapToBytes(site.getFavIcon()));
  }
  return values;
}
Program: 171757
Project: 171757
Buggy source:
public int getAdjustPosition(int position){
  int adjustPosition=position;
  if (position < mItems.size()) {
    int lastDateSectionIndex=0;
    for (int i=0; i <= position; i++) {
      if (mItems.get(i) instanceof DateSection)       lastDateSectionIndex=i;
    }
    if (lastDateSectionIndex == 0)     adjustPosition=position - 1;
 else     adjustPosition=position - 1 - lastDateSectionIndex;
  }
  return adjustPosition;
}

Fixed version (ground truth):
public int getAdjustPosition(int position){
  int adjustPosition=position;
  if (position < mItems.size()) {
    int lastDateSectionIndex=0;
    for (int i=0; i <= position; i++) {
      if (mItems.get(i) instanceof DateSection) {
        lastDateSectionIndex=i;
      }
    }
    if (lastDateSectionIndex == 0) {
      adjustPosition=position - 1;
    }
 else {
      adjustPosition=position - 1 - lastDateSectionIndex;
    }
  }
  return adjustPosition;
}
Program: 171758
Project: 171758
Buggy source:
public static String getStringSizeLengthFile(long size){
  DecimalFormat df=new DecimalFormat("String_Node_Str");
  float sizeKb=1024.0f;
  float sizeMo=sizeKb * sizeKb;
  float sizeGo=sizeMo * sizeKb;
  float sizeTerra=sizeGo * sizeKb;
  if (size < sizeMo)   return df.format(size / sizeKb) + "String_Node_Str";
 else   if (size < sizeGo)   return df.format(size / sizeMo) + "String_Node_Str";
 else   if (size < sizeTerra)   return df.format(size / sizeGo) + "String_Node_Str";
  return "String_Node_Str";
}

Fixed version (ground truth):
public static String getStringSizeLengthFile(long size){
  DecimalFormat df=new DecimalFormat("String_Node_Str");
  float sizeKb=1024.0f;
  float sizeMo=sizeKb * sizeKb;
  float sizeGo=sizeMo * sizeKb;
  float sizeTerra=sizeGo * sizeKb;
  if (size < sizeMo) {
    return df.format(size / sizeKb) + "String_Node_Str";
  }
 else   if (size < sizeGo) {
    return df.format(size / sizeMo) + "String_Node_Str";
  }
 else   if (size < sizeTerra) {
    return df.format(size / sizeGo) + "String_Node_Str";
  }
  return "String_Node_Str";
}
Program: 171759
Project: 171759
Buggy source:
private static int getDominantColor(Bitmap source,boolean applyThreshold){
  if (source == null)   return Color.argb(255,255,255,255);
  int[] colorBins=new int[36];
  int maxBin=-1;
  float[] sumHue=new float[36];
  float[] sumSat=new float[36];
  float[] sumVal=new float[36];
  float[] hsv=new float[3];
  int height=source.getHeight();
  int width=source.getWidth();
  int[] pixels=new int[width * height];
  source.getPixels(pixels,0,width,0,0,width,height);
  for (int row=0; row < height; row++) {
    for (int col=0; col < width; col++) {
      int c=pixels[col + row * width];
      if (Color.alpha(c) < 128)       continue;
      Color.colorToHSV(c,hsv);
      if (applyThreshold && (hsv[1] <= 0.35f || hsv[2] <= 0.35f))       continue;
      int bin=(int)Math.floor(hsv[0] / 10.0f);
      sumHue[bin]=sumHue[bin] + hsv[0];
      sumSat[bin]=sumSat[bin] + hsv[1];
      sumVal[bin]=sumVal[bin] + hsv[2];
      colorBins[bin]++;
      if (maxBin < 0 || colorBins[bin] > colorBins[maxBin])       maxBin=bin;
    }
  }
  if (maxBin < 0)   return Color.argb(255,255,255,255);
  hsv[0]=sumHue[maxBin] / colorBins[maxBin];
  hsv[1]=sumSat[maxBin] / colorBins[maxBin];
  hsv[2]=sumVal[maxBin] / colorBins[maxBin];
  return Color.HSVToColor(hsv);
}

Fixed version (ground truth):
private static int getDominantColor(Bitmap source,boolean applyThreshold){
  if (source == null) {
    return Color.argb(255,255,255,255);
  }
  int[] colorBins=new int[36];
  int maxBin=-1;
  float[] sumHue=new float[36];
  float[] sumSat=new float[36];
  float[] sumVal=new float[36];
  float[] hsv=new float[3];
  int height=source.getHeight();
  int width=source.getWidth();
  int[] pixels=new int[width * height];
  source.getPixels(pixels,0,width,0,0,width,height);
  for (int row=0; row < height; row++) {
    for (int col=0; col < width; col++) {
      int c=pixels[col + row * width];
      if (Color.alpha(c) < 128) {
        continue;
      }
      Color.colorToHSV(c,hsv);
      if (applyThreshold && (hsv[1] <= 0.35f || hsv[2] <= 0.35f)) {
        continue;
      }
      int bin=(int)Math.floor(hsv[0] / 10.0f);
      sumHue[bin]=sumHue[bin] + hsv[0];
      sumSat[bin]=sumSat[bin] + hsv[1];
      sumVal[bin]=sumVal[bin] + hsv[2];
      colorBins[bin]++;
      if (maxBin < 0 || colorBins[bin] > colorBins[maxBin]) {
        maxBin=bin;
      }
    }
  }
  if (maxBin < 0) {
    return Color.argb(255,255,255,255);
  }
  hsv[0]=sumHue[maxBin] / colorBins[maxBin];
  hsv[1]=sumSat[maxBin] / colorBins[maxBin];
  hsv[2]=sumVal[maxBin] / colorBins[maxBin];
  return Color.HSVToColor(hsv);
}
Program: 171760
Project: 171760
Buggy source:
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  final int childCount=getChildCount();
  final int totalWidth=r - l;
  int x=0;
  int y=getMeasuredHeight();
  int prevChildHeight=0;
  for (int i=0; i < childCount; i++) {
    final View child=getChildAt(i);
    if (child.getVisibility() == GONE)     continue;
    final int childWidth=child.getMeasuredWidth();
    final int childHeight=child.getMeasuredHeight();
    if (x + childWidth > totalWidth) {
      x=0;
      y-=prevChildHeight + mSpacing;
    }
    prevChildHeight=childHeight;
    child.layout(x,y - childHeight,x + childWidth,y);
    x+=childWidth + mSpacing;
  }
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  final int childCount=getChildCount();
  final int totalWidth=r - l;
  int x=0;
  int y=getMeasuredHeight();
  int prevChildHeight=0;
  for (int i=0; i < childCount; i++) {
    final View child=getChildAt(i);
    if (child.getVisibility() == GONE) {
      continue;
    }
    final int childWidth=child.getMeasuredWidth();
    final int childHeight=child.getMeasuredHeight();
    if (x + childWidth > totalWidth) {
      x=0;
      y-=prevChildHeight + mSpacing;
    }
    prevChildHeight=childHeight;
    child.layout(x,y - childHeight,x + childWidth,y);
    x+=childWidth + mSpacing;
  }
}
Program: 171761
Project: 171761
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  final int parentWidth=MeasureSpec.getSize(widthMeasureSpec);
  final int childCount=getChildCount();
  int rowWidth=0;
  int totalWidth=0;
  int totalHeight=0;
  boolean firstChild=true;
  for (int i=0; i < childCount; i++) {
    final View child=getChildAt(i);
    if (child.getVisibility() == GONE)     continue;
    measureChild(child,widthMeasureSpec,heightMeasureSpec);
    final int childWidth=child.getMeasuredWidth();
    final int childHeight=child.getMeasuredHeight();
    if (firstChild || (rowWidth + childWidth > parentWidth)) {
      rowWidth=0;
      totalHeight+=childHeight;
      if (!firstChild)       totalHeight+=mSpacing;
      firstChild=false;
    }
    rowWidth+=childWidth;
    if (rowWidth > totalWidth)     totalWidth=rowWidth;
    rowWidth+=mSpacing;
  }
  setMeasuredDimension(totalWidth,totalHeight);
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  final int parentWidth=MeasureSpec.getSize(widthMeasureSpec);
  final int childCount=getChildCount();
  int rowWidth=0;
  int totalWidth=0;
  int totalHeight=0;
  boolean firstChild=true;
  for (int i=0; i < childCount; i++) {
    final View child=getChildAt(i);
    if (child.getVisibility() == GONE) {
      continue;
    }
    measureChild(child,widthMeasureSpec,heightMeasureSpec);
    final int childWidth=child.getMeasuredWidth();
    final int childHeight=child.getMeasuredHeight();
    if (firstChild || (rowWidth + childWidth > parentWidth)) {
      rowWidth=0;
      totalHeight+=childHeight;
      if (!firstChild) {
        totalHeight+=mSpacing;
      }
      firstChild=false;
    }
    rowWidth+=childWidth;
    if (rowWidth > totalWidth) {
      totalWidth=rowWidth;
    }
    rowWidth+=mSpacing;
  }
  setMeasuredDimension(totalWidth,totalHeight);
}
Program: 171762
Project: 171762
Buggy source:
@Override public void onBindViewHolder(SiteViewHolder holder,int position){
  final Site site=sites.get(position);
  holder.text.setText(site.getTitle());
  if (site.getFavIcon() != null) {
    holder.img.setImageBitmap(site.getFavIcon());
    int dominantColor=FavIconUtils.getDominantColor(site.getFavIcon());
    int alpha=(dominantColor & 0xFF000000);
    int red=multiplyColorCodeByPercentage((dominantColor & 0x00FF0000) >> 16,1.1f) << 16;
    int green=multiplyColorCodeByPercentage((dominantColor & 0x0000FF00) >> 8,1.1f) << 8;
    int blue=multiplyColorCodeByPercentage((dominantColor & 0x000000FF),1.1f);
    holder.img.setSupportBackgroundTintList(ColorStateList.valueOf(alpha + red + green+ blue));
  }
 else {
    holder.img.setImageBitmap(null);
  }
  holder.itemView.setTag(site);
  if (clickListener != null) {
    holder.itemView.setOnClickListener(clickListener);
  }
  if (longClickListener != null) {
    holder.itemView.setOnLongClickListener(longClickListener);
  }
}

Fixed version (ground truth):
@Override public void onBindViewHolder(SiteViewHolder holder,int position){
  final Site site=sites.get(position);
  holder.text.setText(site.getTitle());
  if (site.getFavIcon() != null) {
    holder.img.setImageBitmap(site.getFavIcon());
    int dominantColor=FavIconUtils.getDominantColor(site.getFavIcon());
    int alpha=(dominantColor & 0xFF000000);
    int red=multiplyColorCodeByPercentage((dominantColor & 0x00FF0000) >> 16,1.1f) << 16;
    int green=multiplyColorCodeByPercentage((dominantColor & 0x0000FF00) >> 8,1.1f) << 8;
    int blue=multiplyColorCodeByPercentage((dominantColor & 0x000000FF),1.1f);
    ViewCompat.setBackgroundTintList(holder.img,ColorStateList.valueOf(alpha + red + green+ blue));
  }
 else {
    holder.img.setImageBitmap(null);
  }
  holder.itemView.setTag(site);
  if (clickListener != null) {
    holder.itemView.setOnClickListener(clickListener);
  }
  if (longClickListener != null) {
    holder.itemView.setOnLongClickListener(longClickListener);
  }
}
Program: 171763
Project: 171763
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.fragment_browsing_history,container,false);
  mBtnClearHistory=(Button)v.findViewById(R.id.browsing_history_btn_clear);
  mBtnClearHistory.setOnClickListener(this);
  mContainerRecyclerView=(RecyclerView)v.findViewById(R.id.browsing_history_recycler_view);
  mContainerEmptyView=(ViewGroup)v.findViewById(R.id.browsing_history_empty_view_container);
  return v;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.fragment_browsing_history,container,false);
  v.findViewById(R.id.browsing_history_btn_clear).setOnClickListener(this);
  mContainerRecyclerView=(ViewGroup)v.findViewById(R.id.browsing_history_recycler_view_container);
  mContainerEmptyView=(ViewGroup)v.findViewById(R.id.browsing_history_empty_view_container);
  mRecyclerView=(RecyclerView)v.findViewById(R.id.browsing_history_recycler_view);
  return v;
}
Program: 171764
Project: 171764
Buggy source:
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  LinearLayoutManager layoutManager=new LinearLayoutManager(getActivity());
  mAdapter=new HistoryItemAdapter(mContainerRecyclerView,getActivity(),this,layoutManager);
  mContainerRecyclerView.setAdapter(mAdapter);
  mContainerRecyclerView.setLayoutManager(layoutManager);
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  LinearLayoutManager layoutManager=new LinearLayoutManager(getActivity());
  mAdapter=new HistoryItemAdapter(mRecyclerView,getActivity(),this,layoutManager);
  mRecyclerView.setAdapter(mAdapter);
  mRecyclerView.setLayoutManager(layoutManager);
}
Program: 171765
Project: 171765
Buggy source:
@Override public void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mDownloadListAdapter=new DownloadListAdapter();
  mDownloadListAdapter.fetchEntity();
  mDownloadReceiver=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
      Long downloadId=intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID,0L);
      mDownloadListAdapter.updateItem(downloadId);
    }
  }
;
}

Fixed version (ground truth):
@Override public void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mDownloadListAdapter=new DownloadListAdapter();
  mDownloadListAdapter.fetchEntity();
  mDownloadReceiver=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
      Long downloadId=intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID,0L);
      DownloadInfo downloadInfo=DBUtils.getDbService().getDownloadInfo(downloadId);
      mDownloadListAdapter.updateItem(downloadInfo);
    }
  }
;
}
Program: 171766
Project: 171766
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  Long downloadId=intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID,0L);
  mDownloadListAdapter.updateItem(downloadId);
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  Long downloadId=intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID,0L);
  DownloadInfo downloadInfo=DBUtils.getDbService().getDownloadInfo(downloadId);
  mDownloadListAdapter.updateItem(downloadInfo);
}
Program: 171767
Project: 171767
Buggy source:
@Override public void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mDownloadListAdapter=new DownloadListAdapter();
  mDownloadReceiver=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
      Long downloadId=intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID,0L);
    }
  }
;
}

Fixed version (ground truth):
@Override public void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mDownloadListAdapter=new DownloadListAdapter();
  mDownloadReceiver=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
      intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID,0L);
    }
  }
;
}
Program: 171768
Project: 171768
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  Long downloadId=intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID,0L);
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID,0L);
}
Program: 171769
Project: 171769
Buggy source:
@Override public void onClick(View view){
switch (view.getId()) {
case R.id.display_url:
    notifyParent(FragmentListener.TYPE.SHOW_URL_INPUT,getUrl());
  break;
case R.id.btn_search:
notifyParent(FragmentListener.TYPE.SHOW_URL_INPUT,null);
break;
case R.id.btn_home:
notifyParent(FragmentListener.TYPE.SHOW_HOME,null);
break;
case R.id.btn_menu:
notifyParent(FragmentListener.TYPE.SHOW_MENU,null);
break;
default :
throw new IllegalArgumentException("String_Node_Str");
}
}

Fixed version (ground truth):
@Override public void onClick(View view){
switch (view.getId()) {
case R.id.display_url:
    notifyParent(FragmentListener.TYPE.SHOW_URL_INPUT,getUrl());
  break;
case R.id.btn_search:
notifyParent(FragmentListener.TYPE.SHOW_URL_INPUT,null);
break;
case R.id.btn_home:
notifyParent(FragmentListener.TYPE.SHOW_HOME,null);
break;
case R.id.btn_menu:
notifyParent(FragmentListener.TYPE.SHOW_MENU,null);
break;
case R.id.customtab_close:
BrowsingSession.getInstance().clearCustomTabConfig();
getActivity().finishAndRemoveTask();
break;
default :
throw new IllegalArgumentException("String_Node_Str");
}
}
Program: 171770
Project: 171770
Buggy source:
@Override public boolean onTouchEvent(MotionEvent ev){
  boolean eventHandled=false;
  final MotionEvent event=MotionEvent.obtain(ev);
  final int action=MotionEventCompat.getActionMasked(event);
  if (action == MotionEvent.ACTION_DOWN) {
    mNestedOffsetY=0;
  }
  final int eventY=(int)event.getY();
  event.offsetLocation(0,mNestedOffsetY);
switch (action) {
case MotionEvent.ACTION_MOVE:
    int deltaY=mLastY - eventY;
  if (dispatchNestedPreScroll(0,deltaY,mScrollConsumed,mScrollOffset)) {
    deltaY-=mScrollConsumed[1];
    mLastY=eventY - mScrollOffset[1];
    event.offsetLocation(0,-mScrollOffset[1]);
    mNestedOffsetY+=mScrollOffset[1];
  }
eventHandled=super.onTouchEvent(event);
if (dispatchNestedScroll(0,mScrollOffset[1],0,deltaY,mScrollOffset)) {
event.offsetLocation(0,mScrollOffset[1]);
mNestedOffsetY+=mScrollOffset[1];
mLastY-=mScrollOffset[1];
}
break;
case MotionEvent.ACTION_DOWN:
eventHandled=super.onTouchEvent(event);
mLastY=eventY;
startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL);
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
eventHandled=super.onTouchEvent(event);
stopNestedScroll();
break;
default :
}
return eventHandled;
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent ev){
  boolean eventHandled=false;
  final MotionEvent event=MotionEvent.obtain(ev);
  final int action=MotionEventCompat.getActionMasked(event);
  if (action == MotionEvent.ACTION_DOWN) {
    mNestedOffsetY=0;
  }
  if (event.getPointerCount() > 1) {
    return super.onTouchEvent(event);
  }
  final int eventY=(int)event.getY();
  event.offsetLocation(0,mNestedOffsetY);
switch (action) {
case MotionEvent.ACTION_MOVE:
    int deltaY=mLastY - eventY;
  if (dispatchNestedPreScroll(0,deltaY,mScrollConsumed,mScrollOffset)) {
    deltaY-=mScrollConsumed[1];
    mLastY=eventY - mScrollOffset[1];
    event.offsetLocation(0,-mScrollOffset[1]);
    mNestedOffsetY+=mScrollOffset[1];
  }
eventHandled=super.onTouchEvent(event);
if (dispatchNestedScroll(0,mScrollOffset[1],0,deltaY,mScrollOffset)) {
event.offsetLocation(0,mScrollOffset[1]);
mNestedOffsetY+=mScrollOffset[1];
mLastY-=mScrollOffset[1];
}
break;
case MotionEvent.ACTION_DOWN:
eventHandled=super.onTouchEvent(event);
mLastY=eventY;
startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL);
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
eventHandled=super.onTouchEvent(event);
stopNestedScroll();
break;
default :
}
return eventHandled;
}
Program: 171771
Project: 171771
Buggy source:
@Override public boolean handleExternalUrl(final String url){
  return false;
}

Fixed version (ground truth):
@Override public boolean handleExternalUrl(final String url){
  final IWebView webView=getWebView();
  return webView != null && IntentUtils.handleExternalUri(getContext(),webView,url);
}
Program: 171772
Project: 171772
Buggy source:
@Override public IWebView.Callback createCallback(){
  return new IWebView.Callback(){
    @Override public void onPageStarted(    final String url){
      progressView.announceForAccessibility(getString(R.string.accessibility_announcement_loading));
      progressView.setVisibility(View.VISIBLE);
    }
    @Override public void onPageFinished(    boolean isSecure){
      progressView.announceForAccessibility(getString(R.string.accessibility_announcement_loading_finished));
      progressView.setVisibility(View.INVISIBLE);
      if (webView.getVisibility() != View.VISIBLE) {
        webView.setVisibility(View.VISIBLE);
      }
    }
    @Override public void onProgress(    int progress){
      progressView.setProgress(progress);
    }
    @Override public boolean handleExternalUrl(    final String url){
      return false;
    }
    @Override public void onDownloadStart(    Download download){
    }
    @Override public void onLongPress(    IWebView.HitTarget hitTarget){
    }
    @Override public void onURLChanged(    String url){
    }
    @Override public void onEnterFullScreen(    @NonNull IWebView.FullscreenCallback callback,    @Nullable View view){
    }
    @Override public void onExitFullScreen(){
    }
  }
;
}

Fixed version (ground truth):
@Override public IWebView.Callback createCallback(){
  return new IWebView.Callback(){
    @Override public void onPageStarted(    final String url){
      progressView.announceForAccessibility(getString(R.string.accessibility_announcement_loading));
      progressView.setVisibility(View.VISIBLE);
    }
    @Override public void onPageFinished(    boolean isSecure){
      progressView.announceForAccessibility(getString(R.string.accessibility_announcement_loading_finished));
      progressView.setVisibility(View.INVISIBLE);
      if (webView.getVisibility() != View.VISIBLE) {
        webView.setVisibility(View.VISIBLE);
      }
    }
    @Override public void onProgress(    int progress){
      progressView.setProgress(progress);
    }
    @Override public boolean handleExternalUrl(    final String url){
      final IWebView webView=getWebView();
      return webView != null && IntentUtils.handleExternalUri(getContext(),webView,url);
    }
    @Override public void onDownloadStart(    Download download){
    }
    @Override public void onLongPress(    IWebView.HitTarget hitTarget){
    }
    @Override public void onURLChanged(    String url){
    }
    @Override public void onEnterFullScreen(    @NonNull IWebView.FullscreenCallback callback,    @Nullable View view){
    }
    @Override public void onExitFullScreen(){
    }
  }
;
}
Program: 171773
Project: 171773
Buggy source:
/** 
 * Not every locale we ship can be used on every device, due to font or rendering constraints. This method filters down the list before generating the descriptor array.
 */
private LocaleDescriptor[] getUsableLocales(){
  Collection<String> shippingLocales=LocaleManager.getPackagedLocaleTags(getContext());
  if (shippingLocales == null) {
    final String fallbackTag=LocaleManager.getInstance().getFallbackLocaleTag();
    return new LocaleDescriptor[]{new LocaleDescriptor(fallbackTag)};
  }
  final int initialCount=shippingLocales.size();
  final Set<LocaleDescriptor> locales=new HashSet<>(initialCount);
  for (  String tag : shippingLocales) {
    final LocaleDescriptor descriptor=new LocaleDescriptor(tag);
    if (!descriptor.isUsable(this.characterValidator)) {
      Log.w(LOG_TAG,"String_Node_Str" + tag + "String_Node_Str");
      continue;
    }
    locales.add(descriptor);
  }
  final int usableCount=locales.size();
  final LocaleDescriptor[] descriptors=locales.toArray(new LocaleDescriptor[usableCount]);
  Arrays.sort(descriptors,0,usableCount);
  return descriptors;
}

Fixed version (ground truth):
/** 
 * Not every locale we ship can be used on every device, due to font or rendering constraints. This method filters down the list before generating the descriptor array.
 */
private LocaleDescriptor[] getUsableLocales(){
  final Collection<String> shippingLocales=LocaleManager.getPackagedLocaleTags(getContext());
  final int initialCount=shippingLocales.size();
  final Set<LocaleDescriptor> locales=new HashSet<>(initialCount);
  for (  String tag : shippingLocales) {
    final LocaleDescriptor descriptor=new LocaleDescriptor(tag);
    if (!descriptor.isUsable(this.characterValidator)) {
      Log.w(LOG_TAG,"String_Node_Str" + tag + "String_Node_Str");
      continue;
    }
    locales.add(descriptor);
  }
  final int usableCount=locales.size();
  final LocaleDescriptor[] descriptors=locales.toArray(new LocaleDescriptor[usableCount]);
  Arrays.sort(descriptors,0,usableCount);
  return descriptors;
}
Program: 171774
Project: 171774
Buggy source:
@Test public void OpenTest() throws InterruptedException, UiObjectNotFoundException {
  final long waitingTime=TestHelper.waitingTime;
  UiObject openWithBtn=TestHelper.mDevice.findObject(new UiSelector().resourceId("String_Node_Str").enabled(true));
  UiObject openWithTitle=TestHelper.mDevice.findObject(new UiSelector().className("String_Node_Str").text("String_Node_Str").enabled(true));
  UiObject openWithList=TestHelper.mDevice.findObject(new UiSelector().resourceId("String_Node_Str").enabled(true));
  TestHelper.firstViewBtn.waitForExists(waitingTime);
  TestHelper.firstViewBtn.click();
  TestHelper.urlBar.waitForExists(waitingTime);
  TestHelper.urlBar.click();
  TestHelper.inlineAutocompleteEditText.waitForExists(waitingTime);
  TestHelper.inlineAutocompleteEditText.clearTextField();
  TestHelper.inlineAutocompleteEditText.setText("String_Node_Str");
  TestHelper.hint.waitForExists(waitingTime);
  TestHelper.pressEnterKey();
  TestHelper.webView.waitForExists(waitingTime);
  TestHelper.menuButton.perform(click());
  openWithBtn.waitForExists(waitingTime);
  openWithBtn.click();
  openWithTitle.waitForExists(waitingTime);
  assertTrue(openWithTitle.exists());
  assertTrue(openWithList.exists());
}

Fixed version (ground truth):
@Test public void OpenTest() throws InterruptedException, UiObjectNotFoundException {
  final long waitingTime=TestHelper.waitingTime;
  UiObject openWithBtn=TestHelper.mDevice.findObject(new UiSelector().resourceId("String_Node_Str").enabled(true));
  UiObject openWithTitle=TestHelper.mDevice.findObject(new UiSelector().className("String_Node_Str").text("String_Node_Str").enabled(true));
  UiObject openWithList=TestHelper.mDevice.findObject(new UiSelector().resourceId("String_Node_Str").enabled(true));
  TestHelper.firstViewBtn.waitForExists(waitingTime);
  TestHelper.firstViewBtn.click();
  TestHelper.urlBar.waitForExists(waitingTime);
  TestHelper.urlBar.click();
  TestHelper.inlineAutocompleteEditText.waitForExists(waitingTime);
  TestHelper.inlineAutocompleteEditText.clearTextField();
  TestHelper.inlineAutocompleteEditText.setText("String_Node_Str");
  TestHelper.hint.waitForExists(waitingTime);
  TestHelper.pressEnterKey();
  TestHelper.webView.waitForExists(waitingTime);
  TestHelper.menuButton.perform(click());
  openWithBtn.waitForExists(waitingTime);
  openWithBtn.click();
  openWithTitle.waitForExists(waitingTime);
  assertTrue(openWithTitle.exists());
  assertTrue(openWithList.exists());
  TestHelper.pressBackKey();
}
Program: 171776
Project: 171776
Buggy source:
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  if (!drawHint || TextUtils.isEmpty(hint)) {
    return;
  }
  final float y=(canvas.getHeight() + bounds.height()) / 2;
  final float max=(canvas.getWidth() / 2) - (bounds.width() / 2);
  final float min=padding;
  final float x=(max - min) * animationOffset + min;
  canvas.drawText(hint,x,y,paint);
}

Fixed version (ground truth):
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  if (!drawHint || TextUtils.isEmpty(hint)) {
    return;
  }
  final float y=((float)canvas.getHeight() + bounds.height()) / 2;
  final float max=((float)canvas.getWidth() - bounds.width()) / 2;
  final float min=padding;
  final float x=(max - min) * animationOffset + min;
  canvas.drawText(hint,x,y,paint);
}
Program: 171777
Project: 171777
Buggy source:
public SQL SET(String... columnOrValue){
  strBuilder.append("String_Node_Str");
  for (int i=0; i < columnOrValue.length; i=i + 2) {
    if (i != 0) {
      strBuilder.append("String_Node_Str");
    }
    strBuilder.append(columnOrValue[i]).append("String_Node_Str").append(columnOrValue[i + 1]);
  }
  return this;
}

Fixed version (ground truth):
public SQL SET(String... columnEqualsValue){
  strBuilder.append("String_Node_Str");
  for (int i=0; i < columnEqualsValue.length; i++) {
    if (i != 0) {
      strBuilder.append("String_Node_Str");
    }
    strBuilder.append(columnEqualsValue[i]);
  }
  return this;
}
Program: 171778
Project: 171778
Buggy source:
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return null;
}

Fixed version (ground truth):
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return "String_Node_Str";
}
Program: 171779
Project: 171779
Buggy source:
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return null;
}

Fixed version (ground truth):
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return "String_Node_Str";
}
Program: 171780
Project: 171780
Buggy source:
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return null;
}

Fixed version (ground truth):
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return "String_Node_Str";
}
Program: 171781
Project: 171781
Buggy source:
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return null;
}

Fixed version (ground truth):
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return "String_Node_Str";
}
Program: 171782
Project: 171782
Buggy source:
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return null;
}

Fixed version (ground truth):
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return String.format("String_Node_Str",colName);
}
Program: 171783
Project: 171783
Buggy source:
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return null;
}

Fixed version (ground truth):
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return "String_Node_Str";
}
Program: 171784
Project: 171784
Buggy source:
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return null;
}

Fixed version (ground truth):
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return "String_Node_Str";
}
Program: 171785
Project: 171785
Buggy source:
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return null;
}

Fixed version (ground truth):
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return "String_Node_Str";
}
Program: 171786
Project: 171786
Buggy source:
@Override public String getMessage(){
  return null;
}

Fixed version (ground truth):
@Override public String getMessage(){
  return "String_Node_Str";
}
Program: 171787
Project: 171787
Buggy source:
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return null;
}

Fixed version (ground truth):
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return "String_Node_Str";
}
Program: 171788
Project: 171788
Buggy source:
@Override public String getMessage(){
  return null;
}

Fixed version (ground truth):
@Override public String getMessage(){
  return "String_Node_Str";
}
Program: 171789
Project: 171789
Buggy source:
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return null;
}

Fixed version (ground truth):
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return "String_Node_Str";
}
Program: 171790
Project: 171790
Buggy source:
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return null;
}

Fixed version (ground truth):
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return "String_Node_Str";
}
Program: 171791
Project: 171791
Buggy source:
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return null;
}

Fixed version (ground truth):
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return "String_Node_Str";
}
Program: 171792
Project: 171792
Buggy source:
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return null;
}

Fixed version (ground truth):
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return "String_Node_Str";
}
Program: 171793
Project: 171793
Buggy source:
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return null;
}

Fixed version (ground truth):
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return "String_Node_Str";
}
Program: 171794
Project: 171794
Buggy source:
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return null;
}

Fixed version (ground truth):
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return "String_Node_Str";
}
Program: 171795
Project: 171795
Buggy source:
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return null;
}

Fixed version (ground truth):
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return "String_Node_Str";
}
Program: 171796
Project: 171796
Buggy source:
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return null;
}

Fixed version (ground truth):
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return "String_Node_Str";
}
Program: 171797
Project: 171797
Buggy source:
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return null;
}

Fixed version (ground truth):
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return "String_Node_Str";
}
Program: 171798
Project: 171798
Buggy source:
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return null;
}

Fixed version (ground truth):
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return "String_Node_Str";
}
Program: 171799
Project: 171799
Buggy source:
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return null;
}

Fixed version (ground truth):
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return "String_Node_Str";
}
Program: 171800
Project: 171800
Buggy source:
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return null;
}

Fixed version (ground truth):
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return "String_Node_Str";
}
Program: 171801
Project: 171801
Buggy source:
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return null;
}

Fixed version (ground truth):
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return "String_Node_Str";
}
Program: 171802
Project: 171802
Buggy source:
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return null;
}

Fixed version (ground truth):
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return "String_Node_Str";
}
Program: 171803
Project: 171803
Buggy source:
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return null;
}

Fixed version (ground truth):
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return "String_Node_Str";
}
Program: 171804
Project: 171804
Buggy source:
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return null;
}

Fixed version (ground truth):
/** 
 * get error message.
 * @return error message
 */
@Override public String getMessage(){
  return "String_Node_Str";
}
Program: 171805
Project: 171805
Buggy source:
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return null;
}

Fixed version (ground truth):
/** 
 * get system hint message for user on how to deal with this exception
 * @return hint message
 */
@Override public String getHint(){
  return "String_Node_Str";
}
Program: 171806
Project: 171806
Buggy source:
void drainUntil(long upToNanos){
  long now=timeNanos;
  PriorityBlockingQueue<TestTask> q=queue;
  for (; ; ) {
    TestTask tt=q.peek();
    if (tt == null || tt.dueNanos > upToNanos) {
      break;
    }
    q.poll();
    timeNanos=tt.dueNanos;
    tt.run();
  }
  timeNanos=upToNanos;
}

Fixed version (ground truth):
void drainUntil(long upToNanos){
  long now=timeNanos;
  PriorityBlockingQueue<TestTask> q=queue;
  for (; ; ) {
    TestTask tt=q.peek();
    if (tt == null || tt.dueNanos > upToNanos) {
      break;
    }
    q.remove(tt);
    timeNanos=tt.dueNanos;
    tt.run();
  }
  timeNanos=upToNanos;
}
Program: 171808
Project: 171808
Buggy source:
/** 
 * Search OSM for places with the specified name
 * @param searchString Name of the place to be searched
 */
private void search(String searchString){
  DeviceLocationData deviceLocationData=((MainActivity)getActivity()).getLastKnownLocation();
  Action action=new Action(){
    @Override public void action(    ArrayList<Place> places){
      searchedPlaces=places;
      adapterElements.clear();
      adapterElements=new ArrayList<>(searchedPlaces);
      try {
        setupRecyclerView();
      }
 catch (      Exception ignored) {
      }
      filterElements();
    }
  }
;
  ArrayList<Pair> pairs=new ArrayList<>();
  pairs.add(new Pair("String_Node_Str",searchString));
  if (deviceLocationData != null && deviceLocationData.getLocality() != null)   pairs.add(new Pair("String_Node_Str",searchString + "String_Node_Str" + deviceLocationData.getLocality()));
  if (DeviceUtils.isInternetConnected(getActivity()))   Request.getPlaces(action,pairs);
}

Fixed version (ground truth):
/** 
 * Search OSM for places with the specified name
 * @param searchString Name of the place to be searched
 */
private void search(String searchString){
  DeviceLocationData deviceLocationData=((MainActivity)getActivity()).getLastKnownLocation();
  Action action=new Action(){
    @Override public void action(    ArrayList<Place> places){
      searchedPlaces=places;
      adapterElements.clear();
      adapterElements=new ArrayList<>(searchedPlaces);
      try {
        setupRecyclerView();
      }
 catch (      Exception ignored) {
      }
      filterElements();
    }
  }
;
  ArrayList<Pair> pairs=new ArrayList<>();
  pairs.add(new Pair("String_Node_Str",searchString));
  if (deviceLocationData != null && deviceLocationData.getLocality() != null)   pairs.add(new Pair("String_Node_Str",searchString + "String_Node_Str" + deviceLocationData.getLocality()));
  if (DeviceUtils.isInternetConnected(getActivity())) {
    Request.getPlaces(getContext(),action,pairs);
  }
}
Program: 171809
Project: 171809
Buggy source:
/** 
 * @param action     The method to apply on each Place which is returned by nominatim
 * @param parameters A set of keys and values to provide to the request. Each map will be triggered in a different request
 * @see Action
 */
public GetPlaces(Action action,ArrayList<Pair>... parameters){
  this.action=action;
  this.parameters=parameters;
}

Fixed version (ground truth):
/** 
 * @param action     The method to apply on each Place which is returned by nominatim
 * @param parameters A set of keys and values to provide to the request. Each map will be triggered in a different request
 * @see Action
 */
public GetPlaces(Context context,Action action,ArrayList<Pair>... parameters){
  this.context=context;
  this.action=action;
  this.parameters=parameters;
}
Program: 171810
Project: 171810
Buggy source:
public static void getPlaces(Action a,ArrayList<Pair>... parameters){
  try {
    new GetPlaces(a,parameters).execute();
  }
 catch (  IllegalStateException e) {
  }
}

Fixed version (ground truth):
public static void getPlaces(Context context,Action a,ArrayList<Pair>... parameters){
  try {
    new GetPlaces(context,a,parameters).execute();
  }
 catch (  IllegalStateException e) {
  }
}
Program: 171812
Project: 171812
Buggy source:
@Override public Publisher<T> apply(Flowable<T> upstream){
  HideAtStartShowAtError<T> delegate=new HideAtStartShowAtError<>(view.hideErrorState(),view.showErrorState(),error -> error instanceof UnexpectedResponseError,uiScheduler);
  return upstream.compose(delegate);
}

Fixed version (ground truth):
@Override public Publisher<T> apply(Flowable<T> upstream){
  HideAtStartShowAtError<T> delegate=new HideAtStartShowAtError<>(view.hideErrorState(),view.showErrorState(),error -> !(error instanceof ContentNotFoundError),uiScheduler);
  return upstream.compose(delegate);
}
Program: 171813
Project: 171813
Buggy source:
@Test public void shouldPresent_AnotherError_IntoView() throws Exception {
  Flowable<FactAboutNumber> broken=Flowable.error(new IllegalAccessError("String_Node_Str"));
  when(usecase.fetchTrivia()).thenReturn(broken);
  presenter.fetchRandomFacts();
  BehavioursVerifier.with(view).shouldShowLoading().shouldShowErrorState().shouldNotShowEmptyState().shouldHideLoading();
  DataFlowWatcher.with(onNext,onError,onCompleted).shouldFinishWithError();
  verify(strategist,atLeastOnce()).applyStrategy(any());
}

Fixed version (ground truth):
@Test public void shouldPresent_AnotherError_IntoView() throws Exception {
  Flowable<FactAboutNumber> broken=Flowable.error(new IllegalAccessError("String_Node_Str"));
  when(usecase.fetchTrivia()).thenReturn(broken);
  presenter.fetchRandomFacts();
  BehavioursVerifier.with(view).showLoadingFirstHideLoadingAfter().shouldShowErrorState().shouldNotShowEmptyState();
  DataFlowWatcher.with(onNext,onError,onCompleted).shouldFinishWithError();
  verify(strategist,atLeastOnce()).applyStrategy(any());
}
Program: 171814
Project: 171814
Buggy source:
@Test public void shouldPresent_UnexpectedResponseError_IntoView() throws Exception {
  Flowable<FactAboutNumber> error5xx=Flowable.error(new UnexpectedResponseError("String_Node_Str"));
  when(usecase.fetchTrivia()).thenReturn(error5xx);
  presenter.fetchRandomFacts();
  BehavioursVerifier.with(view).shouldShowLoading().shouldNotShowEmptyState().shouldShowErrorState().shouldHideLoading();
  DataFlowWatcher.with(onNext,onError,onCompleted).shouldFinishWithError();
  verify(strategist,atLeastOnce()).applyStrategy(any());
}

Fixed version (ground truth):
@Test public void shouldPresent_UnexpectedResponseError_IntoView() throws Exception {
  Flowable<FactAboutNumber> error5xx=Flowable.error(new UnexpectedResponseError("String_Node_Str"));
  when(usecase.fetchTrivia()).thenReturn(error5xx);
  presenter.fetchRandomFacts();
  BehavioursVerifier.with(view).showLoadingFirstHideLoadingAfter().shouldNotShowEmptyState().shouldShowErrorState();
  DataFlowWatcher.with(onNext,onError,onCompleted).shouldFinishWithError();
  verify(strategist,atLeastOnce()).applyStrategy(any());
}
Program: 171815
Project: 171815
Buggy source:
@Test public void shouldPresent_AvailableData_IntoView() throws Exception {
  Flowable<FactAboutNumber> data=Flowable.just(ImmutableFactAboutNumber.of("String_Node_Str","String_Node_Str"),ImmutableFactAboutNumber.of("String_Node_Str","String_Node_Str"));
  when(usecase.fetchTrivia()).thenReturn(data);
  presenter.fetchRandomFacts();
  BehavioursVerifier.with(view).shouldShowLoading().shouldNotShowEmptyState().shouldNotShowErrorState().shouldHideLoading();
  DataFlowWatcher.with(onNext,onError,onCompleted).shouldReceiveItems(2);
  verify(strategist,atLeastOnce()).applyStrategy(any());
}

Fixed version (ground truth):
@Test public void shouldPresent_AvailableData_IntoView() throws Exception {
  Flowable<FactAboutNumber> data=Flowable.just(ImmutableFactAboutNumber.of("String_Node_Str","String_Node_Str"),ImmutableFactAboutNumber.of("String_Node_Str","String_Node_Str"));
  when(usecase.fetchTrivia()).thenReturn(data);
  presenter.fetchRandomFacts();
  BehavioursVerifier.with(view).showLoadingFirstHideLoadingAfter().shouldNotShowEmptyState().shouldNotShowErrorState();
  DataFlowWatcher.with(onNext,onError,onCompleted).shouldReceiveItems(2);
  verify(strategist,atLeastOnce()).applyStrategy(any());
}
Program: 171816
Project: 171816
Buggy source:
@Test public void shouldPresent_NoContentError_IntoView() throws Exception {
  Flowable<FactAboutNumber> noContent=Flowable.error(new ContentNotFoundError());
  when(usecase.fetchTrivia()).thenReturn(noContent);
  presenter.fetchRandomFacts();
  BehavioursVerifier.with(view).shouldShowLoading().shouldShowEmptyState().shouldHideLoading().shouldNotShowErrorState();
  DataFlowWatcher.with(onNext,onError,onCompleted).shouldFinishWithError();
  verify(strategist,atLeastOnce()).applyStrategy(any());
}

Fixed version (ground truth):
@Test public void shouldPresent_NoContentError_IntoView() throws Exception {
  Flowable<FactAboutNumber> noContent=Flowable.error(new ContentNotFoundError());
  when(usecase.fetchTrivia()).thenReturn(noContent);
  presenter.fetchRandomFacts();
  BehavioursVerifier.with(view).showLoadingFirstHideLoadingAfter().shouldShowEmptyState().shouldNotShowErrorState();
  DataFlowWatcher.with(onNext,onError,onCompleted).shouldFinishWithError();
  verify(strategist,atLeastOnce()).applyStrategy(any());
}
Program: 171817
Project: 171817
Buggy source:
public WeixinApiService(){
  httpClient=FastHttpClient.newBuilder().cookieJar(cookieJar).build();
}

Fixed version (ground truth):
public WeixinApiService(){
  httpClient=FastHttpClient.newBuilder().readTimeout(120,TimeUnit.SECONDS).connectTimeout(120,TimeUnit.SECONDS).cookieJar(cookieJar).build();
}