nus-yam/ex-repair huggingface dataset:
Program: 81066
Project: 81066
Buggy source:
private void setupLayersSpeedDial(){
  mLayersFab=(uk.co.markormesher.android_fab.FloatingActionButton)findViewById(R.id.layersSpeedDial);
  ViewGroup.MarginLayoutParams p=(ViewGroup.MarginLayoutParams)mLayersFab.getLayoutParams();
  LAYERS_FAB_DEFAULT_BOTTOM_MARGIN=p.bottomMargin;
  mLayersFab.setIcon(R.drawable.ic_layers_white_24dp);
  mLayersFab.setBackgroundColour(ContextCompat.getColor(this,R.color.theme_accent));
  LayersSpeedDialAdapter adapter=new LayersSpeedDialAdapter(this);
  adapter.addLayerActivationListener(mMapFragment);
  adapter.addLayerActivationListener(new LayersSpeedDialAdapter.LayerActivationListener(){
    @Override public void onActivateLayer(    LayerInfo layer){
      Handler h=new Handler(getMainLooper());
      h.postDelayed(new Runnable(){
        @Override public void run(){
          mLayersFab.rebuildSpeedDialMenu();
        }
      }
,100);
    }
    @Override public void onDeactivateLayer(    LayerInfo layer){
      Handler h=new Handler(getMainLooper());
      h.postDelayed(new Runnable(){
        @Override public void run(){
          mLayersFab.rebuildSpeedDialMenu();
        }
      }
,100);
    }
  }
);
  mLayersFab.setMenuAdapter(adapter);
  mLayersFab.setOnSpeedDialOpenListener(new uk.co.markormesher.android_fab.FloatingActionButton.OnSpeedDialOpenListener(){
    @Override public void onOpen(    uk.co.markormesher.android_fab.FloatingActionButton v){
      mLayersFab.setIcon(R.drawable.ic_add_white_24dp);
    }
  }
);
  mLayersFab.setOnSpeedDialCloseListener(new uk.co.markormesher.android_fab.FloatingActionButton.OnSpeedDialCloseListener(){
    @Override public void onClose(    uk.co.markormesher.android_fab.FloatingActionButton v){
      mLayersFab.setIcon(R.drawable.ic_layers_white_24dp);
    }
  }
);
  mLayersFab.setContentCoverEnabled(false);
}

Fixed version (ground truth):
private void setupLayersSpeedDial(){
  mLayersFab=(uk.co.markormesher.android_fab.FloatingActionButton)findViewById(R.id.layersSpeedDial);
  ViewGroup.MarginLayoutParams p=(ViewGroup.MarginLayoutParams)mLayersFab.getLayoutParams();
  LAYERS_FAB_DEFAULT_BOTTOM_MARGIN=p.bottomMargin;
}
Program: 81068
Project: 81068
Buggy source:
public RealtimeIndicatorView(Context context,AttributeSet attrs){
  super(context,attrs);
  TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.RealtimeIndicatorView,0,0);
  mFillColor=a.getColor(R.styleable.RealtimeIndicatorView_fillColor,mFillColor);
  mLineColor=a.getColor(R.styleable.RealtimeIndicatorView_lineColor,mLineColor);
  mDuration=a.getInteger(R.styleable.RealtimeIndicatorView_duration,mDuration);
  a.recycle();
  mFillPaint=new Paint();
  mFillPaint.setColor(mFillColor);
  mFillPaint.setStyle(Paint.Style.FILL);
  mFillPaint.setAntiAlias(true);
  mLinePaint=new Paint();
  mLinePaint.setStrokeWidth(3);
  mLinePaint.setColor(mLineColor);
  mLinePaint.setStyle(Paint.Style.STROKE);
  mLinePaint.setAntiAlias(true);
  setOnMeasureCallback();
}

Fixed version (ground truth):
public RealtimeIndicatorView(Context context,AttributeSet attrs){
  super(context,attrs);
  TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.RealtimeIndicatorView,0,0);
  mFillColor=a.getColor(R.styleable.RealtimeIndicatorView_fillColor,mFillColor);
  mLineColor=a.getColor(R.styleable.RealtimeIndicatorView_lineColor,mLineColor);
  mDuration=a.getInteger(R.styleable.RealtimeIndicatorView_duration,mDuration);
  a.recycle();
  mFillPaint=new Paint();
  mFillPaint.setColor(mFillColor);
  mFillPaint.setStyle(Paint.Style.FILL);
  mFillPaint.setAntiAlias(true);
  mLinePaint=new Paint();
  mLinePaint.setStrokeWidth(3);
  mLinePaint.setColor(mLineColor);
  mLinePaint.setStyle(Paint.Style.STROKE);
  mLinePaint.setAntiAlias(true);
  setOnMeasureCallback();
  ensureInit();
}
Program: 81069
Project: 81069
Buggy source:
private void setOnMeasureCallback(){
  ViewTreeObserver vto=getViewTreeObserver();
  vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      removeOnGlobalLayoutListener(this);
      mAnimation1=new Animation(){
        @Override protected void applyTransformation(        float interpolatedTime,        Transformation t){
          int height=getHeight();
          mNewRadius=height * interpolatedTime;
          invalidate();
        }
      }
;
      mAnimation1.setDuration(mDuration);
      mAnimation1.setRepeatMode(Animation.REVERSE);
      mAnimation1.setInterpolator(new FastOutLinearInInterpolator());
      mAnimation1.setRepeatCount(Animation.INFINITE);
      startAnimation(mAnimation1);
    }
  }
);
}

Fixed version (ground truth):
private void setOnMeasureCallback(){
  getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      removeOnGlobalLayoutListener(this);
      initAnimation();
    }
  }
);
}
Program: 81070
Project: 81070
Buggy source:
@Override public void onGlobalLayout(){
  removeOnGlobalLayoutListener(this);
  mAnimation1=new Animation(){
    @Override protected void applyTransformation(    float interpolatedTime,    Transformation t){
      int height=getHeight();
      mNewRadius=height * interpolatedTime;
      invalidate();
    }
  }
;
  mAnimation1.setDuration(mDuration);
  mAnimation1.setRepeatMode(Animation.REVERSE);
  mAnimation1.setInterpolator(new FastOutLinearInInterpolator());
  mAnimation1.setRepeatCount(Animation.INFINITE);
  startAnimation(mAnimation1);
}

Fixed version (ground truth):
@Override public void onGlobalLayout(){
  removeOnGlobalLayoutListener(this);
  initAnimation();
}
Program: 81071
Project: 81071
Buggy source:
/** 
 * Sets the header for this list to be instantiated in another layout, but still controlled by this fragment
 * @param header     header that will be controlled by this fragment
 * @param headerView View that contains this header
 */
public void setHeader(ArrivalsListHeader header,View headerView){
  mHeader=header;
  mHeaderView=headerView;
}

Fixed version (ground truth):
/** 
 * Sets the header for this list to be instantiated in another layout, but still controlled by this fragment
 * @param header     header that will be controlled by this fragment
 * @param headerView View that contains this header
 */
public void setHeader(ArrivalsListHeader header,View headerView){
  mHeader=header;
  mHeaderView=headerView;
  mHeader.initView(mHeaderView);
  mExternalHeader=true;
}
Program: 81072
Project: 81072
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
  final int id=item.getItemId();
  if (id == R.id.show_on_map) {
    if (mStop != null) {
      HomeActivity.start(getActivity(),mStop.getId(),mStop.getLatitude(),mStop.getLongitude());
    }
    return true;
  }
 else   if (id == R.id.refresh) {
    refresh();
    return true;
  }
 else   if (id == R.id.filter) {
    if (mStop != null) {
      showRoutesFilterDialog();
    }
  }
 else   if (id == R.id.edit_name) {
    mHeader.beginNameEdit(null);
  }
 else   if (id == R.id.toggle_favorite) {
    setFavorite(!mFavorite);
    mHeader.refresh();
  }
 else   if (id == R.id.report_problem) {
    if (mStop != null) {
      ReportStopProblemFragment.show(getSherlockActivity(),mStop);
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
  final int id=item.getItemId();
  if (id == R.id.show_on_map) {
    if (mStop != null) {
      HomeActivity.start(getActivity(),mStop.getId(),mStop.getLatitude(),mStop.getLongitude());
    }
    return true;
  }
 else   if (id == R.id.refresh) {
    refresh();
    return true;
  }
 else   if (id == R.id.filter) {
    if (mStop != null) {
      showRoutesFilterDialog();
    }
  }
 else   if (id == R.id.edit_name) {
    if (mHeader != null) {
      mHeader.beginNameEdit(null);
    }
  }
 else   if (id == R.id.toggle_favorite) {
    setFavorite(!mFavorite);
    if (mHeader != null) {
      mHeader.refresh();
    }
  }
 else   if (id == R.id.report_problem) {
    if (mStop != null) {
      ReportStopProblemFragment.show(getSherlockActivity(),mStop);
    }
  }
  return false;
}
Program: 81073
Project: 81073
Buggy source:
private void setRoutesFilter(boolean[] checks){
  final int len=checks.length;
  final ArrayList<String> newFilter=new ArrayList<String>(len);
  ObaArrivalInfoResponse response=getArrivalsLoader().getLastGoodResponse();
  final List<ObaRoute> routes=response.getRoutes(mStop.getRouteIds());
  assert(routes.size() == len);
  for (int i=0; i < len; ++i) {
    final ObaRoute route=routes.get(i);
    if (checks[i]) {
      newFilter.add(route.getId());
    }
  }
  if (newFilter.size() == len) {
    newFilter.clear();
  }
  setRoutesFilter(newFilter);
  mHeader.refresh();
}

Fixed version (ground truth):
private void setRoutesFilter(boolean[] checks){
  final int len=checks.length;
  final ArrayList<String> newFilter=new ArrayList<String>(len);
  ObaArrivalInfoResponse response=getArrivalsLoader().getLastGoodResponse();
  final List<ObaRoute> routes=response.getRoutes(mStop.getRouteIds());
  assert(routes.size() == len);
  for (int i=0; i < len; ++i) {
    final ObaRoute route=routes.get(i);
    if (checks[i]) {
      newFilter.add(route.getId());
    }
  }
  if (newFilter.size() == len) {
    newFilter.clear();
  }
  setRoutesFilter(newFilter);
  if (mHeader != null) {
    mHeader.refresh();
  }
}
Program: 81074
Project: 81074
Buggy source:
@Override public void onResume(){
  ArrivalsListLoader loader=getArrivalsLoader();
  if (loader != null) {
    ObaArrivalInfoResponse lastGood=loader.getLastGoodResponse();
    if (lastGood != null) {
      setResponseData(lastGood.getArrivalInfo(),lastGood.getSituations());
    }
  }
  getLoaderManager().restartLoader(TRIPS_FOR_STOP_LOADER,null,mTripsForStopCallback);
  long lastResponseTime=getArrivalsLoader().getLastResponseTime();
  long newPeriod=Math.min(RefreshPeriod,(lastResponseTime + RefreshPeriod) - System.currentTimeMillis());
  if (newPeriod <= 0) {
    refresh();
  }
 else {
    mRefreshHandler.postDelayed(mRefresh,newPeriod);
  }
  super.onResume();
}

Fixed version (ground truth):
@Override public void onResume(){
  if (mListener != null) {
    final Handler handler=new Handler();
    handler.post(new Runnable(){
      @Override public void run(){
        mListener.onListViewCreated(getListView());
      }
    }
);
  }
  if (mHeader != null) {
    Log.d(TAG,"String_Node_Str");
    mHeader.refresh();
  }
  ArrivalsListLoader loader=getArrivalsLoader();
  if (loader != null) {
    ObaArrivalInfoResponse lastGood=loader.getLastGoodResponse();
    if (lastGood != null) {
      setResponseData(lastGood.getArrivalInfo(),lastGood.getSituations());
    }
  }
  getLoaderManager().restartLoader(TRIPS_FOR_STOP_LOADER,null,mTripsForStopCallback);
  long lastResponseTime=getArrivalsLoader().getLastResponseTime();
  long newPeriod=Math.min(RefreshPeriod,(lastResponseTime + RefreshPeriod) - System.currentTimeMillis());
  if (newPeriod <= 0) {
    refresh();
  }
 else {
    mRefreshHandler.postDelayed(mRefresh,newPeriod);
  }
  super.onResume();
}
Program: 81076
Project: 81076
Buggy source:
private void setResponseData(ObaArrivalInfo[] info,List<ObaSituation> situations){
  mHeader.refresh();
  if (situations != null) {
    refreshSituations(situations);
  }
 else {
    refreshSituations(new ArrayList<ObaSituation>());
  }
  if (info != null) {
    setEmptyText(UIHelp.getNoArrivalsMessage(getActivity(),getArrivalsLoader().getMinutesAfter(),false));
    mAdapter.setData(info,mRoutesFilter);
  }
}

Fixed version (ground truth):
private void setResponseData(ObaArrivalInfo[] info,List<ObaSituation> situations){
  if (mHeader != null) {
    mHeader.refresh();
  }
  if (situations != null) {
    refreshSituations(situations);
  }
 else {
    refreshSituations(new ArrayList<ObaSituation>());
  }
  if (info != null) {
    setEmptyText(UIHelp.getNoArrivalsMessage(getActivity(),getArrivalsLoader().getMinutesAfter(),false));
    mAdapter.setData(info,mRoutesFilter);
  }
}
Program: 81078
Project: 81078
Buggy source:
private void setupSlidingPanel(){
  mSlidingPanel=(SlidingUpPanelLayout)findViewById(R.id.sliding_layout);
  mSlidingPanel.hidePanel();
  mSlidingPanel.setOverlayed(true);
  mSlidingPanel.setPanelSlideListener(new SlidingUpPanelLayout.PanelSlideListener(){
    @Override public void onPanelSlide(    View panel,    float slideOffset){
      Log.d(TAG,"String_Node_Str" + slideOffset);
    }
    @Override public void onPanelExpanded(    View panel){
      Log.d(TAG,"String_Node_Str");
    }
    @Override public void onPanelCollapsed(    View panel){
      Log.d(TAG,"String_Node_Str");
    }
    @Override public void onPanelAnchored(    View panel){
      Log.d(TAG,"String_Node_Str");
      if (mFocusedStop != null && mMapFragment != null) {
        mMapFragment.setMapCenter(mFocusedStop.getLocation(),true,true);
      }
    }
    @Override public void onPanelHidden(    View panel){
      Log.d(TAG,"String_Node_Str");
      if (mArrivalsListFragment != null) {
        FragmentManager fm=getSupportFragmentManager();
        fm.beginTransaction().remove(mArrivalsListFragment).commit();
      }
    }
  }
);
}

Fixed version (ground truth):
private void setupSlidingPanel(){
  mSlidingPanel=(SlidingUpPanelLayout)findViewById(R.id.sliding_layout);
  mArrivalsListHeaderView=findViewById(R.id.arrivals_list_header);
  mSlidingPanel.hidePanel();
  mSlidingPanel.setOverlayed(true);
  mSlidingPanel.setAnchorPoint(MapModeController.OVERLAY_PERCENTAGE);
  mSlidingPanel.setPanelSlideListener(new SlidingUpPanelLayout.PanelSlideListener(){
    @Override public void onPanelSlide(    View panel,    float slideOffset){
      Log.d(TAG,"String_Node_Str" + slideOffset);
    }
    @Override public void onPanelExpanded(    View panel){
      Log.d(TAG,"String_Node_Str");
    }
    @Override public void onPanelCollapsed(    View panel){
      Log.d(TAG,"String_Node_Str");
    }
    @Override public void onPanelAnchored(    View panel){
      Log.d(TAG,"String_Node_Str");
      if (mFocusedStop != null && mMapFragment != null) {
        mMapFragment.setMapCenter(mFocusedStop.getLocation(),true,true);
      }
    }
    @Override public void onPanelHidden(    View panel){
      Log.d(TAG,"String_Node_Str");
      if (mArrivalsListFragment != null) {
        FragmentManager fm=getSupportFragmentManager();
        fm.beginTransaction().remove(mArrivalsListFragment).commit();
      }
    }
  }
);
}
Program: 81079
Project: 81079
Buggy source:
/** 
 * Called by the BaseMapFragment when a stop obtains focus, or no stops have focus
 * @param stop the ObaStop that obtained focus, or null if no stop is in focus
 * @param routes a HashMap of all route display names that serve this stop - key is routeId
 */
@Override public void onFocusChanged(ObaStop stop,HashMap<String,ObaRoute> routes){
  mFocusedStop=stop;
  if (stop != null) {
    FragmentManager fm=getSupportFragmentManager();
    mArrivalsListFragment=new ArrivalsListFragment();
    ArrivalsListHeader header=new ArrivalsListHeader(this,mArrivalsListFragment);
    mArrivalsListFragment.setHeader(header,findViewById(R.id.arrivals_list_header));
    Intent i=new ArrivalsListFragment.IntentBuilder(this,stop,routes).build();
    mArrivalsListFragment.setArguments(FragmentUtils.getIntentArgs(i));
    fm.beginTransaction().replace(R.id.slidingFragment,mArrivalsListFragment).commit();
    mSlidingPanel.setAnchorPoint(MapModeController.OVERLAY_PERCENTAGE);
    mSlidingPanel.showPanel();
  }
 else {
    mSlidingPanel.hidePanel();
  }
}

Fixed version (ground truth):
/** 
 * Called by the BaseMapFragment when a stop obtains focus, or no stops have focus
 * @param stop   the ObaStop that obtained focus, or null if no stop is in focus
 * @param routes a HashMap of all route display names that serve this stop - key is routeId
 */
@Override public void onFocusChanged(ObaStop stop,HashMap<String,ObaRoute> routes){
  mFocusedStop=stop;
  if (stop != null) {
    FragmentManager fm=getSupportFragmentManager();
    mArrivalsListFragment=new ArrivalsListFragment();
    mArrivalsListFragment.setListener(this);
    mArrivalsListHeader=new ArrivalsListHeader(this,mArrivalsListFragment);
    mArrivalsListFragment.setHeader(mArrivalsListHeader,mArrivalsListHeaderView);
    Intent i=new ArrivalsListFragment.IntentBuilder(this,stop,routes).build();
    mArrivalsListFragment.setArguments(FragmentUtils.getIntentArgs(i));
    fm.beginTransaction().replace(R.id.slidingFragment,mArrivalsListFragment).commit();
    mSlidingPanel.showPanel();
  }
 else {
    mSlidingPanel.hidePanel();
  }
}
Program: 81080
Project: 81080
Buggy source:
private Notification createNotification(Uri alertUri){
  Intent deleteIntent=new Intent(mContext,TripService.class);
  deleteIntent.setAction(TripService.ACTION_CANCEL);
  deleteIntent.setData(alertUri);
  return new NotificationCompat.Builder(mContext).setSmallIcon(R.drawable.ic_stat_notification).setDefaults(Notification.DEFAULT_ALL).setOnlyAlertOnce(true).setDeleteIntent(PendingIntent.getService(mContext,0,deleteIntent,PendingIntent.FLAG_UPDATE_CURRENT)).getNotification();
}

Fixed version (ground truth):
private Notification createNotification(PendingIntent deleteIntent){
  return new NotificationCompat.Builder(mContext).setSmallIcon(R.drawable.ic_stat_notification).setDefaults(Notification.DEFAULT_ALL).setOnlyAlertOnce(true).setDeleteIntent(deleteIntent).build();
}
Program: 81081
Project: 81081
Buggy source:
@SuppressWarnings("String_Node_Str") private void setLatestInfo(Notification notification,String stopId,String routeId,long timeDiff){
  final String title=mContext.getString(R.string.app_name);
  final PendingIntent intent=PendingIntent.getActivity(mContext,0,new ArrivalsListActivity.Builder(mContext,stopId).getIntent(),PendingIntent.FLAG_UPDATE_CURRENT);
  notification.setLatestEventInfo(mContext,title,getNotifyText(routeId,timeDiff),intent);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void setLatestInfo(Notification notification,String stopId,String routeId,long timeDiff,PendingIntent deleteIntent){
  final String title=mContext.getString(R.string.app_name);
  final PendingIntent intent=PendingIntent.getActivity(mContext,0,new ArrivalsListActivity.Builder(mContext,stopId).getIntent(),PendingIntent.FLAG_UPDATE_CURRENT);
  notification.setLatestEventInfo(mContext,title,getNotifyText(routeId,timeDiff),intent);
  notification.deleteIntent=deleteIntent;
}
Program: 81082
Project: 81082
Buggy source:
private void notify(Cursor c){
  final int id=c.getInt(COL_ID);
  final String tripId=c.getString(COL_TRIP_ID);
  final String stopId=c.getString(COL_STOP_ID);
  final int state=c.getInt(COL_STATE);
  if (state == TripAlerts.STATE_CANCELLED) {
    return;
  }
  final Uri tripUri=ObaContract.Trips.buildUri(tripId,stopId);
  final String routeId=UIHelp.stringForQuery(mContext,tripUri,Trips.ROUTE_ID);
  Notification notification=mTaskContext.getNotification(id);
  if (notification == null) {
    notification=createNotification(mUri);
  }
  setLatestInfo(notification,stopId,routeId,mTimeDiff);
  mTaskContext.setNotification(id,notification);
}

Fixed version (ground truth):
private void notify(Cursor c){
  final int id=c.getInt(COL_ID);
  final String tripId=c.getString(COL_TRIP_ID);
  final String stopId=c.getString(COL_STOP_ID);
  final int state=c.getInt(COL_STATE);
  if (state == TripAlerts.STATE_CANCELLED) {
    return;
  }
  final Uri tripUri=ObaContract.Trips.buildUri(tripId,stopId);
  final String routeId=UIHelp.stringForQuery(mContext,tripUri,Trips.ROUTE_ID);
  Notification notification=mTaskContext.getNotification(id);
  Intent deleteIntent=new Intent(mContext,TripService.class);
  deleteIntent.setAction(TripService.ACTION_CANCEL);
  deleteIntent.setData(mUri);
  PendingIntent pendingIntent=PendingIntent.getService(mContext,0,deleteIntent,PendingIntent.FLAG_UPDATE_CURRENT);
  if (notification == null) {
    notification=createNotification(pendingIntent);
  }
  setLatestInfo(notification,stopId,routeId,mTimeDiff,pendingIntent);
  mTaskContext.setNotification(id,notification);
}
Program: 81083
Project: 81083
Buggy source:
@Override public Loader<Cursor> onCreateLoader(int id,Bundle args){
  return new CursorLoader(getActivity(),ObaContract.Stops.CONTENT_URI,QueryUtils.StopList.Columns.PROJECTION,ObaContract.Stops.FAVORITE + "String_Node_Str" + Application.get().getCurrentRegion() == null ? "String_Node_Str" : "String_Node_Str" + QueryUtils.getRegionWhere(ObaContract.Stops.REGION_ID,Application.get().getCurrentRegion().getId()),null,ObaContract.Stops.USE_COUNT + "String_Node_Str");
}

Fixed version (ground truth):
@Override public Loader<Cursor> onCreateLoader(int id,Bundle args){
  return new CursorLoader(getActivity(),ObaContract.Stops.CONTENT_URI,QueryUtils.StopList.Columns.PROJECTION,ObaContract.Stops.FAVORITE + "String_Node_Str" + (Application.get().getCurrentRegion() == null ? "String_Node_Str" : "String_Node_Str" + QueryUtils.getRegionWhere(ObaContract.Stops.REGION_ID,Application.get().getCurrentRegion().getId())),null,ObaContract.Stops.USE_COUNT + "String_Node_Str");
}
Program: 81084
Project: 81084
Buggy source:
public void setBaseUrl(Context context,Uri.Builder builder){
  String serverName=Application.get().getCustomApiUrl();
  if (!TextUtils.isEmpty(serverName)) {
    builder.encodedAuthority(serverName);
    builder.scheme("String_Node_Str");
    if (BuildConfig.DEBUG) {
      Log.d(TAG,"String_Node_Str" + serverName + "String_Node_Str");
    }
  }
 else   if (mRegion != null) {
    if (BuildConfig.DEBUG) {
      Log.d(TAG,"String_Node_Str" + mRegion.getObaBaseUrl() + "String_Node_Str");
    }
    Uri base=Uri.parse(mRegion.getObaBaseUrl() + builder.build().getPath());
    builder.scheme(base.getScheme());
    builder.authority(base.getAuthority());
    builder.encodedPath(base.getEncodedPath());
  }
 else {
    String fallBack="String_Node_Str";
    Log.e(TAG,"String_Node_Str" + fallBack + "String_Node_Str");
    builder.scheme("String_Node_Str");
    builder.authority(fallBack);
  }
}

Fixed version (ground truth):
public void setBaseUrl(Context context,Uri.Builder builder){
  String serverName=Application.get().getCustomApiUrl();
  if (!TextUtils.isEmpty(serverName)) {
    if (BuildConfig.DEBUG) {
      Log.d(TAG,"String_Node_Str" + serverName + "String_Node_Str");
    }
    Uri base=Uri.parse("String_Node_Str" + serverName + builder.build().getPath());
    builder.authority(base.getAuthority());
    builder.scheme(base.getScheme());
    builder.encodedPath(base.getEncodedPath());
  }
 else   if (mRegion != null) {
    if (BuildConfig.DEBUG) {
      Log.d(TAG,"String_Node_Str" + mRegion.getObaBaseUrl() + "String_Node_Str");
    }
    Uri base=Uri.parse(mRegion.getObaBaseUrl() + builder.build().getPath());
    builder.scheme(base.getScheme());
    builder.authority(base.getAuthority());
    builder.encodedPath(base.getEncodedPath());
  }
 else {
    String fallBack="String_Node_Str";
    Log.e(TAG,"String_Node_Str" + fallBack + "String_Node_Str");
    builder.scheme("String_Node_Str");
    builder.authority(fallBack);
  }
}
Program: 81085
Project: 81085
Buggy source:
public void setBaseUrl(Context context,Uri.Builder builder){
  String serverName=Application.getCustomApiUrl();
  if (!TextUtils.isEmpty(serverName)) {
    builder.encodedAuthority(serverName);
    builder.scheme("String_Node_Str");
    if (BuildConfig.DEBUG) {
      Log.d(TAG,"String_Node_Str" + serverName + "String_Node_Str");
    }
  }
 else   if (mRegion != null) {
    if (BuildConfig.DEBUG) {
      Log.d(TAG,"String_Node_Str" + mRegion.getObaBaseUrl() + "String_Node_Str");
    }
    Uri base=Uri.parse(mRegion.getObaBaseUrl() + builder.build().getEncodedPath());
    builder.scheme(base.getScheme());
    builder.authority(base.getAuthority());
    builder.encodedPath(base.getEncodedPath());
  }
 else {
    String fallBack="String_Node_Str";
    Log.e(TAG,"String_Node_Str" + fallBack + "String_Node_Str");
    builder.scheme("String_Node_Str");
    builder.authority(fallBack);
  }
}

Fixed version (ground truth):
public void setBaseUrl(Context context,Uri.Builder builder){
  String serverName=Application.getCustomApiUrl();
  if (!TextUtils.isEmpty(serverName)) {
    builder.encodedAuthority(serverName);
    builder.scheme("String_Node_Str");
    if (BuildConfig.DEBUG) {
      Log.d(TAG,"String_Node_Str" + serverName + "String_Node_Str");
    }
  }
 else   if (mRegion != null) {
    if (BuildConfig.DEBUG) {
      Log.d(TAG,"String_Node_Str" + mRegion.getObaBaseUrl() + "String_Node_Str");
    }
    Uri base=Uri.parse(mRegion.getObaBaseUrl() + builder.build().getPath());
    builder.scheme(base.getScheme());
    builder.authority(base.getAuthority());
    builder.encodedPath(base.getEncodedPath());
  }
 else {
    String fallBack="String_Node_Str";
    Log.e(TAG,"String_Node_Str" + fallBack + "String_Node_Str");
    builder.scheme("String_Node_Str");
    builder.authority(fallBack);
  }
}
Program: 81086
Project: 81086
Buggy source:
public ObaRegionElement(long id,String name,boolean active,String obaBaseUrl,String siriBaseUrl,Bounds[] bounds,String lang,String contactEmail,boolean supportsObaDiscovery,boolean supportsObaRealtime,boolean supportsSiriRealtime){
  this.id=id;
  this.regionName=name;
  this.active=active;
  this.obaBaseUrl=obaBaseUrl;
  this.siriBaseUrl=siriBaseUrl;
  this.bounds=bounds;
  this.language=lang;
  this.contactEmail=contactEmail;
  this.supportsObaDiscovery=supportsObaDiscovery;
  this.supportsObaRealtime=supportsObaRealtime;
  this.supportsSiriRealtime=supportsSiriRealtime;
}

Fixed version (ground truth):
public ObaRegionElement(long id,String name,boolean active,String obaBaseUrl,String siriBaseUrl,Bounds[] bounds,String lang,String contactEmail,boolean supportsObaDiscoveryApis,boolean supportsObaRealtimeApis,boolean supportsSiriRealtimeApis){
  this.id=id;
  this.regionName=name;
  this.active=active;
  this.obaBaseUrl=obaBaseUrl;
  this.siriBaseUrl=siriBaseUrl;
  this.bounds=bounds;
  this.language=lang;
  this.contactEmail=contactEmail;
  this.supportsObaDiscoveryApis=supportsObaDiscoveryApis;
  this.supportsObaRealtimeApis=supportsObaRealtimeApis;
  this.supportsSiriRealtimeApis=supportsSiriRealtimeApis;
}
Program: 81087
Project: 81087
Buggy source:
/** 
 * Checks if the given region is usable by the app, based on what this app supports - Is the region active? - Does the region support the OBA Discovery APIs? - Does the region support the OBA Realtime APIs?
 * @param region region to be checked
 * @return true if the region is usable by this application, false if it is not
 */
public static boolean isRegionUsable(ObaRegion region){
  if (!region.getActive()) {
    if (BuildConfig.DEBUG) {
      Log.d(TAG,"String_Node_Str" + region.getName() + "String_Node_Str");
    }
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Checks if the given region is usable by the app, based on what this app supports - Is the region active? - Does the region support the OBA Discovery APIs? - Does the region support the OBA Realtime APIs?
 * @param region region to be checked
 * @return true if the region is usable by this application, false if it is not
 */
public static boolean isRegionUsable(ObaRegion region){
  if (!region.getActive()) {
    if (BuildConfig.DEBUG) {
      Log.d(TAG,"String_Node_Str" + region.getName() + "String_Node_Str");
    }
    return false;
  }
  if (!region.getSupportsObaDiscoveryApis()) {
    if (BuildConfig.DEBUG) {
      Log.d(TAG,"String_Node_Str" + region.getName() + "String_Node_Str");
    }
    return false;
  }
  if (!region.getSupportsObaRealtimeApis()) {
    if (BuildConfig.DEBUG) {
      Log.d(TAG,"String_Node_Str" + region.getName() + "String_Node_Str");
    }
    return false;
  }
  return true;
}
Program: 81088
Project: 81088
Buggy source:
public void setBaseUrl(Context context,Uri.Builder builder){
  SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(context);
  String serverName=preferences.getString("String_Node_Str",null);
  if (!TextUtils.isEmpty(serverName)) {
    builder.encodedAuthority(serverName);
    builder.scheme("String_Node_Str");
    if (BuildConfig.DEBUG) {
      Log.d(TAG,"String_Node_Str" + serverName + "String_Node_Str");
    }
  }
 else   if (mRegion != null) {
    Uri base=Uri.parse(mRegion.getObaBaseUrl());
    builder.scheme(base.getScheme());
    builder.encodedAuthority(base.getAuthority());
    if (BuildConfig.DEBUG) {
      Log.d(TAG,"String_Node_Str" + mRegion.getObaBaseUrl() + "String_Node_Str");
    }
  }
 else {
    String fallBack="String_Node_Str";
    Log.e(TAG,"String_Node_Str" + fallBack + "String_Node_Str");
    builder.scheme("String_Node_Str");
    builder.authority(fallBack);
  }
}

Fixed version (ground truth):
public void setBaseUrl(Context context,Uri.Builder builder){
  SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(context);
  String serverName=preferences.getString("String_Node_Str",null);
  if (!TextUtils.isEmpty(serverName)) {
    builder.encodedAuthority(serverName);
    builder.scheme("String_Node_Str");
    if (BuildConfig.DEBUG) {
      Log.d(TAG,"String_Node_Str" + serverName + "String_Node_Str");
    }
  }
 else   if (mRegion != null) {
    if (BuildConfig.DEBUG) {
      Log.d(TAG,"String_Node_Str" + mRegion.getObaBaseUrl() + "String_Node_Str");
    }
    Uri base=Uri.parse(mRegion.getObaBaseUrl());
    builder.scheme(base.getScheme());
    builder.authority(base.getAuthority());
    String tempPath=builder.build().getPath();
    builder.encodedPath(base.getPath() + tempPath);
    if (BuildConfig.DEBUG) {
      Log.d(TAG,"String_Node_Str" + builder.build().toString() + "String_Node_Str");
    }
  }
 else {
    String fallBack="String_Node_Str";
    Log.e(TAG,"String_Node_Str" + fallBack + "String_Node_Str");
    builder.scheme("String_Node_Str");
    builder.authority(fallBack);
  }
}
Program: 81089
Project: 81089
Buggy source:
/** 
 * Get the closest region from a list of regions and a given location This method also enforces the constraints in isRegionUsable() to ensure the returned region is actually usable by the app
 * @param regions list of regions
 * @param loc location 
 * @return the closest region to the given location from the list of regions
 */
public static ObaRegion getClosestRegion(ArrayList<ObaRegion> regions,Location loc){
  float minDist=Float.MAX_VALUE;
  ObaRegion closestRegion=null;
  float distToRegion;
  NumberFormat fmt=NumberFormat.getInstance();
  if (fmt instanceof DecimalFormat) {
    ((DecimalFormat)fmt).setMaximumFractionDigits(1);
  }
  double miles;
  if (BuildConfig.DEBUG) {
    Log.d(TAG,"String_Node_Str" + loc.getLatitude() + "String_Node_Str"+ loc.getLongitude());
  }
  for (  ObaRegion region : regions) {
    if (!isRegionUsable(region)) {
      if (BuildConfig.DEBUG) {
        Log.d(TAG,"String_Node_Str" + region.getName() + "String_Node_Str");
      }
      continue;
    }
    distToRegion=getDistanceAway(region,loc.getLatitude(),loc.getLongitude());
    miles=distToRegion * 0.000621371;
    if (BuildConfig.DEBUG) {
      Log.d(TAG,"String_Node_Str" + region.getName() + "String_Node_Str"+ fmt.format(miles)+ "String_Node_Str");
    }
    if (distToRegion < minDist) {
      closestRegion=region;
    }
  }
  return closestRegion;
}

Fixed version (ground truth):
/** 
 * Get the closest region from a list of regions and a given location This method also enforces the constraints in isRegionUsable() to ensure the returned region is actually usable by the app
 * @param regions list of regions
 * @param loc location 
 * @return the closest region to the given location from the list of regions
 */
public static ObaRegion getClosestRegion(ArrayList<ObaRegion> regions,Location loc){
  float minDist=Float.MAX_VALUE;
  ObaRegion closestRegion=null;
  float distToRegion;
  NumberFormat fmt=NumberFormat.getInstance();
  if (fmt instanceof DecimalFormat) {
    ((DecimalFormat)fmt).setMaximumFractionDigits(1);
  }
  double miles;
  if (BuildConfig.DEBUG) {
    Log.d(TAG,"String_Node_Str" + loc.getLatitude() + "String_Node_Str"+ loc.getLongitude());
  }
  for (  ObaRegion region : regions) {
    if (!isRegionUsable(region)) {
      if (BuildConfig.DEBUG) {
        Log.d(TAG,"String_Node_Str" + region.getName() + "String_Node_Str");
      }
      continue;
    }
    distToRegion=getDistanceAway(region,loc.getLatitude(),loc.getLongitude());
    miles=distToRegion * 0.000621371;
    if (BuildConfig.DEBUG) {
      Log.d(TAG,"String_Node_Str" + region.getName() + "String_Node_Str"+ fmt.format(miles)+ "String_Node_Str");
    }
    if (distToRegion < minDist) {
      closestRegion=region;
      minDist=distToRegion;
    }
  }
  return closestRegion;
}
Program: 81090
Project: 81090
Buggy source:
@Override public boolean onContextItemSelected(MenuItem item){
  AdapterContextMenuInfo info=(AdapterContextMenuInfo)item.getMenuInfo();
switch (item.getItemId()) {
case CONTEXT_MENU_DEFAULT:
    onListItemClick(getListView(),info.targetView,info.position,info.id);
  return true;
case CONTEXT_MENU_SHOW_ON_MAP:
showOnMap(getListView(),info.position);
return true;
case CONTEXT_MENU_CREATE_SHORTCUT:
StopData stopData=getStopData(getListView(),info.position);
final Intent shortcutIntent=UIHelp.makeShortcut(getActivity(),stopData.uiName,ArrivalsListActivity.makeIntent(getActivity(),stopData.id,stopData.name,stopData.dir));
shortcutIntent.setAction(MyListConstants.INSTALL_SHORTCUT);
getActivity().sendBroadcast(shortcutIntent);
return true;
default :
return super.onContextItemSelected(item);
}
}

Fixed version (ground truth):
@Override public boolean onContextItemSelected(MenuItem item){
  AdapterContextMenuInfo info=(AdapterContextMenuInfo)item.getMenuInfo();
switch (item.getItemId()) {
case CONTEXT_MENU_DEFAULT:
    onListItemClick(getListView(),info.targetView,info.position,info.id);
  return true;
case CONTEXT_MENU_SHOW_ON_MAP:
showOnMap(getListView(),info.position);
return true;
case CONTEXT_MENU_CREATE_SHORTCUT:
StopData stopData=getStopData(getListView(),info.position);
final Intent shortcutIntent=UIHelp.makeShortcut(getActivity(),stopData.uiName,ArrivalsListActivity.makeIntent(getActivity(),stopData.id,stopData.name,stopData.dir));
shortcutIntent.setAction(MyListConstants.INSTALL_SHORTCUT);
shortcutIntent.setFlags(0);
getActivity().sendBroadcast(shortcutIntent);
return true;
default :
return super.onContextItemSelected(item);
}
}
Program: 81091
Project: 81091
Buggy source:
@Override public ObaReportProblemWithTripResponse call(){
  return call(ObaReportProblemWithTripResponse.class);
}

Fixed version (ground truth):
@Override public ObaReportProblemWithTripResponse call(){
  return callPostHack(ObaReportProblemWithTripResponse.class);
}
Program: 81092
Project: 81092
Buggy source:
public ObaReportProblemWithTripRequest build(){
  return new ObaReportProblemWithTripRequest(buildUri());
}

Fixed version (ground truth):
public ObaReportProblemWithTripRequest build(){
  return new ObaReportProblemWithTripRequest(buildUri(),buildPostData());
}
Program: 81093
Project: 81093
Buggy source:
protected ObaReportProblemWithTripRequest(Uri uri){
  super(uri);
}

Fixed version (ground truth):
protected ObaReportProblemWithTripRequest(Uri uri,String postData){
  super(uri,postData);
}
Program: 81094
Project: 81094
Buggy source:
@Override public ObaReportProblemWithStopResponse call(){
  return call(ObaReportProblemWithStopResponse.class);
}

Fixed version (ground truth):
@Override public ObaReportProblemWithStopResponse call(){
  return callPostHack(ObaReportProblemWithStopResponse.class);
}
Program: 81095
Project: 81095
Buggy source:
/** 
 * Sets the optional user comment.
 * @param comment The user comment.
 */
public Builder setUserComment(String comment){
  mBuilder.appendQueryParameter("String_Node_Str",comment);
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the optional user comment.
 * @param comment The user comment.
 */
public Builder setUserComment(String comment){
  mPostData.appendQueryParameter("String_Node_Str",comment);
  return this;
}
Program: 81096
Project: 81096
Buggy source:
public ObaReportProblemWithStopRequest build(){
  return new ObaReportProblemWithStopRequest(buildUri());
}

Fixed version (ground truth):
public ObaReportProblemWithStopRequest build(){
  return new ObaReportProblemWithStopRequest(buildUri(),buildPostData());
}
Program: 81097
Project: 81097
Buggy source:
public Builder(Context context,String stopId){
  super(context,getPathWithId("String_Node_Str",stopId));
}

Fixed version (ground truth):
public Builder(Context context,String stopId){
  super(context,getPathWithId("String_Node_Str",stopId));
  mPostData.appendQueryParameter("String_Node_Str",stopId);
}
Program: 81098
Project: 81098
Buggy source:
/** 
 * Sets the optional problem code.
 * @param code The problem code.
 */
public Builder setCode(String code){
  mBuilder.appendQueryParameter("String_Node_Str",code);
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the optional problem code.
 * @param code The problem code.
 */
public Builder setCode(String code){
  mPostData.appendQueryParameter("String_Node_Str",code);
  String data=String.format("String_Node_Str",code);
  mPostData.appendQueryParameter("String_Node_Str",data);
  return this;
}
Program: 81099
Project: 81099
Buggy source:
/** 
 * Sets the optional user location.
 * @param lat The user's current location.
 * @param lon The user's current location.
 */
public Builder setUserLocation(double lat,double lon){
  mBuilder.appendQueryParameter("String_Node_Str",String.valueOf(lat));
  mBuilder.appendQueryParameter("String_Node_Str",String.valueOf(lon));
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the optional user location.
 * @param lat The user's current location.
 * @param lon The user's current location.
 */
public Builder setUserLocation(double lat,double lon){
  mPostData.appendQueryParameter("String_Node_Str",String.valueOf(lat));
  mPostData.appendQueryParameter("String_Node_Str",String.valueOf(lon));
  return this;
}
Program: 81100
Project: 81100
Buggy source:
/** 
 * Sets the optional user's location accuracy, in meters.
 * @param meters The user's location accuracy in meters.
 */
public Builder setUserLocationAccuracy(int meters){
  mBuilder.appendQueryParameter("String_Node_Str",String.valueOf(meters));
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the optional user's location accuracy, in meters.
 * @param meters The user's location accuracy in meters.
 */
public Builder setUserLocationAccuracy(int meters){
  mPostData.appendQueryParameter("String_Node_Str",String.valueOf(meters));
  return this;
}
Program: 81101
Project: 81101
Buggy source:
protected ObaReportProblemWithStopRequest(Uri uri){
  super(uri);
}

Fixed version (ground truth):
protected ObaReportProblemWithStopRequest(Uri uri,String postData){
  super(uri,postData);
}
Program: 81102
Project: 81102
Buggy source:
/** 
 * Sets the optional service date of the trip.
 * @param serviceDate The service date.
 */
public Builder setServiceDate(long serviceDate){
  mBuilder.appendQueryParameter("String_Node_Str",String.valueOf(serviceDate));
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the optional service date of the trip.
 * @param serviceDate The service date.
 */
public Builder setServiceDate(long serviceDate){
  mPostData.appendQueryParameter("String_Node_Str",String.valueOf(serviceDate));
  return this;
}
Program: 81103
Project: 81103
Buggy source:
public Builder(Context context,String tripId){
  super(context,getPathWithId("String_Node_Str",tripId));
}

Fixed version (ground truth):
public Builder(Context context,String tripId){
  super(context,getPathWithId("String_Node_Str",tripId));
  mPostData.appendQueryParameter("String_Node_Str",tripId);
}
Program: 81104
Project: 81104
Buggy source:
/** 
 * Sets the optional problem code.
 * @param code The problem code.
 */
public Builder setCode(String code){
  mBuilder.appendQueryParameter("String_Node_Str",code);
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the optional problem code.
 * @param code The problem code.
 */
public Builder setCode(String code){
  mPostData.appendQueryParameter("String_Node_Str",code);
  String data=String.format("String_Node_Str",code);
  mPostData.appendQueryParameter("String_Node_Str",data);
  return this;
}
Program: 81105
Project: 81105
Buggy source:
/** 
 * Sets the optional user location.
 * @param lat The user's current location.
 * @param lon The user's current location.
 */
public Builder setUserLocation(double lat,double lon){
  mBuilder.appendQueryParameter("String_Node_Str",String.valueOf(lat));
  mBuilder.appendQueryParameter("String_Node_Str",String.valueOf(lon));
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the optional user location.
 * @param lat The user's current location.
 * @param lon The user's current location.
 */
public Builder setUserLocation(double lat,double lon){
  mPostData.appendQueryParameter("String_Node_Str",String.valueOf(lat));
  mPostData.appendQueryParameter("String_Node_Str",String.valueOf(lon));
  return this;
}
Program: 81106
Project: 81106
Buggy source:
/** 
 * Sets true/false to indicate if the user is on the transit vehicle experiencing the problem.
 * @param onVehicle If the user is on the vehicle.
 */
public Builder setUserOnVehicle(boolean onVehicle){
  mBuilder.appendQueryParameter("String_Node_Str",String.valueOf(onVehicle));
  return this;
}

Fixed version (ground truth):
/** 
 * Sets true/false to indicate if the user is on the transit vehicle experiencing the problem.
 * @param onVehicle If the user is on the vehicle.
 */
public Builder setUserOnVehicle(boolean onVehicle){
  mPostData.appendQueryParameter("String_Node_Str",String.valueOf(onVehicle));
  return this;
}
Program: 81107
Project: 81107
Buggy source:
/** 
 * Sets the optional user comment.
 * @param comment The user comment.
 */
public Builder setUserComment(String comment){
  mBuilder.appendQueryParameter("String_Node_Str",comment);
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the optional user comment.
 * @param comment The user comment.
 */
public Builder setUserComment(String comment){
  mPostData.appendQueryParameter("String_Node_Str",comment);
  return this;
}
Program: 81108
Project: 81108
Buggy source:
/** 
 * Sets the optional vehicle actively serving the trip.
 * @param vehicleId The vehicle actively serving the trip.
 */
public Builder setVehicleId(String vehicleId){
  mBuilder.appendQueryParameter("String_Node_Str",vehicleId);
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the optional vehicle actively serving the trip.
 * @param vehicleId The vehicle actively serving the trip.
 */
public Builder setVehicleId(String vehicleId){
  mPostData.appendQueryParameter("String_Node_Str",vehicleId);
  return this;
}
Program: 81109
Project: 81109
Buggy source:
/** 
 * Set the vehicle number, as reported by the user.
 * @param vehicleNumber The vehicle as reported by the user.
 */
public Builder setUserVehicleNumber(String vehicleNumber){
  mBuilder.appendQueryParameter("String_Node_Str",vehicleNumber);
  return this;
}

Fixed version (ground truth):
/** 
 * Set the vehicle number, as reported by the user.
 * @param vehicleNumber The vehicle as reported by the user.
 */
public Builder setUserVehicleNumber(String vehicleNumber){
  mPostData.appendQueryParameter("String_Node_Str",vehicleNumber);
  return this;
}
Program: 81110
Project: 81110
Buggy source:
/** 
 * Sets the optional user's location accuracy, in meters.
 * @param meters The user's location accuracy in meters.
 */
public Builder setUserLocationAccuracy(int meters){
  mBuilder.appendQueryParameter("String_Node_Str",String.valueOf(meters));
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the optional user's location accuracy, in meters.
 * @param meters The user's location accuracy in meters.
 */
public Builder setUserLocationAccuracy(int meters){
  mPostData.appendQueryParameter("String_Node_Str",String.valueOf(meters));
  return this;
}
Program: 81111
Project: 81111
Buggy source:
/** 
 * Sets the optional stop ID indicating the stop where the user is experiencing the problem.
 * @param stopId The stop ID.
 */
public Builder setStopId(String stopId){
  mBuilder.appendQueryParameter("String_Node_Str",stopId);
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the optional stop ID indicating the stop where the user is experiencing the problem.
 * @param stopId The stop ID.
 */
public Builder setStopId(String stopId){
  mPostData.appendQueryParameter("String_Node_Str",stopId);
  return this;
}
Program: 81112
Project: 81112
Buggy source:
@Override public void onLoadFinished(Loader<ObaStopsForLocationResponse> loader,ObaStopsForLocationResponse response){
  Log.d(TAG,"String_Node_Str");
  mFragment.showProgress(false);
  if (response.getCode() != ObaApi.OBA_OK) {
    Activity act=mFragment.getActivity();
    Toast.makeText(act,act.getString(R.string.main_stop_errors),Toast.LENGTH_LONG);
    return;
  }
  if (response.getOutOfRange()) {
    mFragment.notifyOutOfRange();
    return;
  }
  List<ObaStop> stops=Arrays.asList(response.getStops());
  mFragment.showStops(stops,response);
}

Fixed version (ground truth):
@Override public void onLoadFinished(Loader<ObaStopsForLocationResponse> loader,ObaStopsForLocationResponse response){
  Log.d(TAG,"String_Node_Str");
  mFragment.showProgress(false);
  if (response.getCode() != ObaApi.OBA_OK) {
    Activity act=mFragment.getActivity();
    Toast.makeText(act,act.getString(R.string.main_stop_errors),Toast.LENGTH_LONG).show();
    return;
  }
  if (response.getOutOfRange()) {
    mFragment.notifyOutOfRange();
    return;
  }
  List<ObaStop> stops=Arrays.asList(response.getStops());
  mFragment.showStops(stops,response);
}
Program: 81114
Project: 81114
Buggy source:
@Override protected void initList(Cursor c){
  startManagingCursor(c);
  final String[] from={ObaContract.Routes.SHORTNAME,ObaContract.Routes.LONGNAME};
  final int[] to={R.id.short_name,R.id.long_name};
  SimpleCursorAdapter simpleAdapter=new SimpleCursorAdapter(this,R.layout.route_list_item,c,from,to);
  simpleAdapter.setViewBinder(mViewBinder);
  setListAdapter(simpleAdapter);
}

Fixed version (ground truth):
@Override protected void initList(Cursor c){
  startManagingCursor(c);
  final String[] from={ObaContract.Routes.SHORTNAME,ObaContract.Routes.LONGNAME};
  final int[] to={R.id.short_name,R.id.long_name};
  SimpleCursorAdapter simpleAdapter=new SimpleCursorAdapter(this,R.layout.route_list_item,c,from,to);
  setListAdapter(simpleAdapter);
}
Program: 81115
Project: 81115
Buggy source:
@Override protected void setData(View view,int position){
  TextView text1=(TextView)view.findViewById(R.id.short_name);
  TextView text2=(TextView)view.findViewById(R.id.long_name);
  ObaRoute route=mArray.get(position);
  final String shortName=route.getShortName();
  final String longName=route.getLongName();
  if (!TextUtils.isEmpty(shortName)) {
    text1.setText(shortName);
    text2.setText(longName);
  }
 else {
    text1.setText(longName);
    text2.setText("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override protected void setData(View view,int position){
  TextView shortNameText=(TextView)view.findViewById(R.id.short_name);
  TextView longNameText=(TextView)view.findViewById(R.id.long_name);
  ObaRoute route=mArray.get(position);
  String shortName=route.getShortName();
  String longName=route.getLongName();
  if (TextUtils.isEmpty(shortName)) {
    shortName=longName;
  }
  if (TextUtils.isEmpty(longName) || shortName.equals(longName)) {
    longName=route.getDescription();
  }
  shortNameText.setText(shortName);
  longNameText.setText(longName);
}