nus-yam/ex-repair huggingface dataset:
Program: 43833
Project: 43833
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: 43834
Project: 43834
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: 43835
Project: 43835
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: 43836
Project: 43836
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: 43837
Project: 43837
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: 43838
Project: 43838
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: 43839
Project: 43839
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: 43841
Project: 43841
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: 43843
Project: 43843
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: 43844
Project: 43844
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: 43845
Project: 43845
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: 43846
Project: 43846
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: 43847
Project: 43847
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: 43848
Project: 43848
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: 43849
Project: 43849
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: 43850
Project: 43850
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: 43851
Project: 43851
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: 43852
Project: 43852
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: 43853
Project: 43853
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: 43854
Project: 43854
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: 43855
Project: 43855
Buggy source:
@Override public ObaReportProblemWithTripResponse call(){
  return call(ObaReportProblemWithTripResponse.class);
}

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

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

Fixed version (ground truth):
protected ObaReportProblemWithTripRequest(Uri uri,String postData){
  super(uri,postData);
}
Program: 43858
Project: 43858
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: 43859
Project: 43859
Buggy source:
@Override public ObaReportProblemWithStopResponse call(){
  return call(ObaReportProblemWithStopResponse.class);
}

Fixed version (ground truth):
@Override public ObaReportProblemWithStopResponse call(){
  return callPostHack(ObaReportProblemWithStopResponse.class);
}
Program: 43860
Project: 43860
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: 43861
Project: 43861
Buggy source:
public ObaReportProblemWithStopRequest build(){
  return new ObaReportProblemWithStopRequest(buildUri());
}

Fixed version (ground truth):
public ObaReportProblemWithStopRequest build(){
  return new ObaReportProblemWithStopRequest(buildUri(),buildPostData());
}
Program: 43862
Project: 43862
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: 43863
Project: 43863
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: 43864
Project: 43864
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: 43865
Project: 43865
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: 43866
Project: 43866
Buggy source:
protected ObaReportProblemWithStopRequest(Uri uri){
  super(uri);
}

Fixed version (ground truth):
protected ObaReportProblemWithStopRequest(Uri uri,String postData){
  super(uri,postData);
}
Program: 43867
Project: 43867
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: 43868
Project: 43868
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: 43869
Project: 43869
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: 43870
Project: 43870
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: 43871
Project: 43871
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: 43872
Project: 43872
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: 43873
Project: 43873
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: 43874
Project: 43874
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: 43875
Project: 43875
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: 43876
Project: 43876
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: 43877
Project: 43877
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: 43879
Project: 43879
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: 43880
Project: 43880
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);
}
Program: 43881
Project: 43881
Buggy source:
private void setHeader(ObaRouteResponse routeInfo,boolean addToDb){
  mRouteInfo=routeInfo;
  if (routeInfo.getCode() == ObaApi.OBA_OK) {
    TextView text1=(TextView)findViewById(R.id.short_name);
    TextView text2=(TextView)findViewById(R.id.long_name);
    TextView agencyText=(TextView)findViewById(R.id.agency);
    String url=mRouteInfo.getUrl();
    final String shortName=routeInfo.getShortName();
    final String longName=routeInfo.getLongName();
    if (!TextUtils.isEmpty(shortName)) {
      text1.setText(shortName);
      text2.setText(longName);
    }
 else {
      text1.setText(longName);
      text2.setText("String_Node_Str");
    }
    agencyText.setText(mRouteInfo.getAgency().getName());
    if (addToDb) {
      ContentValues values=new ContentValues();
      values.put(ObaContract.Routes.SHORTNAME,shortName);
      values.put(ObaContract.Routes.LONGNAME,longName);
      values.put(ObaContract.Routes.URL,url);
      ObaContract.Routes.insertOrUpdate(this,mRouteInfo.getId(),values,true);
    }
  }
 else {
    mEmptyText.setText(UIHelp.getRouteErrorString(routeInfo.getCode()));
  }
  mRouteInfoTask=null;
}

Fixed version (ground truth):
private void setHeader(ObaRouteResponse routeInfo,boolean addToDb){
  mRouteInfo=routeInfo;
  if (routeInfo.getCode() == ObaApi.OBA_OK) {
    TextView shortNameText=(TextView)findViewById(R.id.short_name);
    TextView longNameText=(TextView)findViewById(R.id.long_name);
    TextView agencyText=(TextView)findViewById(R.id.agency);
    String url=mRouteInfo.getUrl();
    String shortName=routeInfo.getShortName();
    String longName=routeInfo.getLongName();
    if (TextUtils.isEmpty(shortName)) {
      shortName=longName;
    }
    if (TextUtils.isEmpty(longName) || shortName.equals(longName)) {
      longName=routeInfo.getDescription();
    }
    shortNameText.setText(shortName);
    longNameText.setText(longName);
    agencyText.setText(mRouteInfo.getAgency().getName());
    if (addToDb) {
      ContentValues values=new ContentValues();
      values.put(ObaContract.Routes.SHORTNAME,shortName);
      values.put(ObaContract.Routes.LONGNAME,longName);
      values.put(ObaContract.Routes.URL,url);
      ObaContract.Routes.insertOrUpdate(this,mRouteInfo.getId(),values,true);
    }
  }
 else {
    mEmptyText.setText(UIHelp.getRouteErrorString(routeInfo.getCode()));
  }
  mRouteInfoTask=null;
}