nus-yam/ex-repair huggingface dataset:
Program: 81116
Project: 81116
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;
}
Program: 81118
Project: 81118
Buggy source:
private void setData(ViewGroup view,int position){
  TextView route=(TextView)view.findViewById(R.id.route);
  TextView destination=(TextView)view.findViewById(R.id.destination);
  TextView time=(TextView)view.findViewById(R.id.time);
  TextView status=(TextView)view.findViewById(R.id.status);
  TextView etaView=(TextView)view.findViewById(R.id.eta);
  final StopInfo stopInfo=mInfo.get(position);
  final ObaArrivalInfo arrivalInfo=stopInfo.getInfo();
  route.setText(arrivalInfo.getShortName());
  destination.setText(arrivalInfo.getHeadsign());
  status.setText(stopInfo.getStatusText());
  long eta=stopInfo.getEta();
  if (eta == 0) {
    etaView.setText(R.string.stop_info_eta_now);
  }
 else {
    etaView.setText(String.valueOf(eta));
  }
  int color=getResources().getColor(stopInfo.getColor());
  etaView.setTextColor(color);
  time.setText(DateUtils.formatDateTime(StopInfoActivity.this,stopInfo.getDisplayTime(),DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_NO_NOON | DateUtils.FORMAT_NO_MIDNIGHT));
  ContentValues values=mTripsForStop.getValues(arrivalInfo.getTripId());
  if (values != null) {
    String tripName=values.getAsString(ObaContract.Trips.NAME);
    TextView tripInfo=(TextView)view.findViewById(R.id.trip_info);
    if (tripName.length() == 0) {
      tripName=getString(R.string.trip_info_noname);
    }
    tripInfo.setText(tripName);
    tripInfo.setVisibility(View.VISIBLE);
  }
 else {
    View tripInfo=view.findViewById(R.id.trip_info);
    tripInfo.setVisibility(View.GONE);
  }
}

Fixed version (ground truth):
private void setData(ViewGroup view,int position){
  TextView route=(TextView)view.findViewById(R.id.route);
  TextView destination=(TextView)view.findViewById(R.id.destination);
  TextView time=(TextView)view.findViewById(R.id.time);
  TextView status=(TextView)view.findViewById(R.id.status);
  TextView etaView=(TextView)view.findViewById(R.id.eta);
  final StopInfo stopInfo=mInfo.get(position);
  final ObaArrivalInfo arrivalInfo=stopInfo.getInfo();
  route.setText(arrivalInfo.getShortName());
  destination.setText(MyTextUtils.toTitleCase(arrivalInfo.getHeadsign()));
  status.setText(stopInfo.getStatusText());
  long eta=stopInfo.getEta();
  if (eta == 0) {
    etaView.setText(R.string.stop_info_eta_now);
  }
 else {
    etaView.setText(String.valueOf(eta));
  }
  int color=getResources().getColor(stopInfo.getColor());
  etaView.setTextColor(color);
  time.setText(DateUtils.formatDateTime(StopInfoActivity.this,stopInfo.getDisplayTime(),DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_NO_NOON | DateUtils.FORMAT_NO_MIDNIGHT));
  ContentValues values=mTripsForStop.getValues(arrivalInfo.getTripId());
  if (values != null) {
    String tripName=values.getAsString(ObaContract.Trips.NAME);
    TextView tripInfo=(TextView)view.findViewById(R.id.trip_info);
    if (tripName.length() == 0) {
      tripName=getString(R.string.trip_info_noname);
    }
    tripInfo.setText(tripName);
    tripInfo.setVisibility(View.VISIBLE);
  }
 else {
    View tripInfo=view.findViewById(R.id.trip_info);
    tripInfo.setVisibility(View.GONE);
  }
}
Program: 81119
Project: 81119
Buggy source:
/** 
 * This should be used with compound drawables
 */
public void setView2(TextView nameView,String stopId,String stopName){
  ContentValues values=mMap.getValues(stopId);
  int icon=0;
  if (values != null) {
    Integer i=values.getAsInteger(ObaContract.Stops.FAVORITE);
    final boolean favorite=(i != null) && (i == 1);
    final String userName=values.getAsString(ObaContract.Stops.USER_NAME);
    nameView.setText(TextUtils.isEmpty(userName) ? stopName : userName);
    icon=favorite ? R.drawable.star_on : 0;
  }
 else {
    nameView.setText(stopName);
  }
  nameView.setCompoundDrawablesWithIntrinsicBounds(icon,0,0,0);
}

Fixed version (ground truth):
/** 
 * This should be used with compound drawables
 */
public void setView2(TextView nameView,String stopId,String stopName){
  ContentValues values=mMap.getValues(stopId);
  int icon=0;
  if (values != null) {
    Integer i=values.getAsInteger(ObaContract.Stops.FAVORITE);
    final boolean favorite=(i != null) && (i == 1);
    final String userName=values.getAsString(ObaContract.Stops.USER_NAME);
    nameView.setText(TextUtils.isEmpty(userName) ? MyTextUtils.toTitleCase(stopName) : userName);
    icon=favorite ? R.drawable.star_on : 0;
  }
 else {
    nameView.setText(MyTextUtils.toTitleCase(stopName));
  }
  nameView.setCompoundDrawablesWithIntrinsicBounds(icon,0,0,0);
}
Program: 81120
Project: 81120
Buggy source:
private String getAppUid(){
  final TelephonyManager telephony=(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
  final String id=telephony.getDeviceId();
  try {
    MessageDigest digest=MessageDigest.getInstance("String_Node_Str");
    digest.update(id.getBytes());
    return getHex(digest.digest());
  }
 catch (  NoSuchAlgorithmException e) {
    return UUID.randomUUID().toString();
  }
}

Fixed version (ground truth):
private String getAppUid(){
  try {
    final TelephonyManager telephony=(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
    final String id=telephony.getDeviceId();
    MessageDigest digest=MessageDigest.getInstance("String_Node_Str");
    digest.update(id.getBytes());
    return getHex(digest.digest());
  }
 catch (  Exception e) {
    return UUID.randomUUID().toString();
  }
}
Program: 81121
Project: 81121
Buggy source:
private void startTask(){
  Log.d(TAG,"String_Node_Str" + mCurrentRequest);
  mTask=new AsyncTask(mCurrentRequest);
  mTask.execute();
}

Fixed version (ground truth):
private void startTask(){
  Log.d(TAG,"String_Node_Str" + mCurrentRequest);
  if (mCurrentRequest != null) {
    mTask=new MyTask();
    mTask.execute(mCurrentRequest);
  }
}
Program: 81122
Project: 81122
Buggy source:
@Override protected ObaResponse doInBackground(String... params){
  if (mInfo.getRouteId() != null) {
    return ObaApi.getStopsForRoute(mActivity,mInfo.getRouteId(),false);
  }
 else {
    return ObaApi.getStopsByLocation(mActivity,mInfo.getCenter(),0,mInfo.getLatSpan(),mInfo.getLonSpan(),null,0);
  }
}

Fixed version (ground truth):
@Override protected ResponseInfo doInBackground(RequestInfo... params){
  final RequestInfo info=params[0];
  ObaResponse response=null;
  if (info.getRouteId() != null) {
    response=ObaApi.getStopsForRoute(mActivity,info.getRouteId(),false);
  }
 else {
    response=ObaApi.getStopsByLocation(mActivity,info.getCenter(),0,info.getLatSpan(),info.getLonSpan(),null,0);
  }
  return new ResponseInfo(info,response);
}
Program: 81123
Project: 81123
Buggy source:
void setRefreshError(){
  TextView errorText=(TextView)mResponseError.findViewById(R.id.response_error_text);
  CharSequence relativeTime=DateUtils.getRelativeTimeSpanString(mResponseTime,System.currentTimeMillis(),DateUtils.MINUTE_IN_MILLIS,0);
  errorText.setText(getString(R.string.stop_info_old_data,relativeTime));
  mResponseError.setVisibility(View.VISIBLE);
  mEmptyText.setText(R.string.stop_info_nodata);
  ((BaseAdapter)getListAdapter()).notifyDataSetChanged();
  mLoadingProgress.hideLoading();
  setProgressBarIndeterminateVisibility(false);
}

Fixed version (ground truth):
void setRefreshError(){
  final long now=System.currentTimeMillis();
  if ((now - mResponseTime) >= 2 * DateUtils.MINUTE_IN_MILLIS) {
    TextView errorText=(TextView)mResponseError.findViewById(R.id.response_error_text);
    CharSequence relativeTime=DateUtils.getRelativeTimeSpanString(mResponseTime,now,DateUtils.MINUTE_IN_MILLIS,0);
    errorText.setText(getString(R.string.stop_info_old_data,relativeTime));
    mResponseError.setVisibility(View.VISIBLE);
    mEmptyText.setText(R.string.stop_info_nodata);
  }
 else {
    mResponseError.setVisibility(View.GONE);
  }
  StopInfoListAdapter adapter=(StopInfoListAdapter)getListView().getAdapter();
  adapter.setData(mResponse.getData().getArrivalsAndDepartures());
  mLoadingProgress.hideLoading();
  setProgressBarIndeterminateVisibility(false);
}
Program: 81124
Project: 81124
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.route_info);
  registerForContextMenu(getExpandableListView());
  Bundle bundle=getIntent().getExtras();
  mRouteId=bundle.getString(ROUTE_ID);
  setListAdapter(new SimpleExpandableListAdapter(this,new ArrayList<HashMap<String,String>>(),android.R.layout.simple_expandable_list_item_1,new String[]{"String_Node_Str"},new int[]{android.R.id.text1},new ArrayList<ArrayList<HashMap<String,String>>>(),0,null,new int[]{}));
  Object config=getLastNonConfigurationInstance();
  if (config != null) {
    Object[] results=(Object[])config;
    setHeader((ObaResponse)results[0],false);
    setStopsForRoute((StopsForRouteInfo)results[1]);
  }
 else {
    mRouteInfoTask=new GetRouteInfo().execute(mRouteId);
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.route_info);
  registerForContextMenu(getExpandableListView());
  final Intent intent=getIntent();
  final Bundle bundle=intent.getExtras();
  final Uri data=intent.getData();
  if (data != null) {
    mRouteId=data.getLastPathSegment();
  }
 else   if (bundle != null) {
    mRouteId=bundle.getString(ROUTE_ID);
  }
 else {
    Log.e(TAG,"String_Node_Str");
    finish();
    return;
  }
  setListAdapter(new SimpleExpandableListAdapter(this,new ArrayList<HashMap<String,String>>(),android.R.layout.simple_expandable_list_item_1,new String[]{"String_Node_Str"},new int[]{android.R.id.text1},new ArrayList<ArrayList<HashMap<String,String>>>(),0,null,new int[]{}));
  Object config=getLastNonConfigurationInstance();
  if (config != null) {
    Object[] results=(Object[])config;
    setHeader((ObaResponse)results[0],false);
    setStopsForRoute((StopsForRouteInfo)results[1]);
  }
 else {
    mRouteInfoTask=new GetRouteInfo().execute(mRouteId);
  }
}
Program: 81125
Project: 81125
Buggy source:
public static Intent makeIntent(Context context,String routeId){
  Intent myIntent=new Intent(context,RouteInfoActivity.class);
  myIntent.putExtra(ROUTE_ID,routeId);
  return myIntent;
}

Fixed version (ground truth):
public static Intent makeIntent(Context context,String routeId){
  Intent myIntent=new Intent(context,RouteInfoActivity.class);
  myIntent.setData(Uri.withAppendedPath(ObaContract.Routes.CONTENT_URI,routeId));
  return myIntent;
}
Program: 81126
Project: 81126
Buggy source:
public static Intent makeIntent(Context context,ObaStop stop){
  Intent myIntent=new Intent(context,StopInfoActivity.class);
  myIntent.putExtra(STOP_ID,stop.getId());
  myIntent.putExtra(STOP_NAME,stop.getName());
  myIntent.putExtra(STOP_DIRECTION,stop.getDirection());
  return myIntent;
}

Fixed version (ground truth):
public static Intent makeIntent(Context context,ObaStop stop){
  Intent myIntent=new Intent(context,StopInfoActivity.class);
  myIntent.setData(Uri.withAppendedPath(ObaContract.Stops.CONTENT_URI,stop.getId()));
  myIntent.putExtra(STOP_NAME,stop.getName());
  myIntent.putExtra(STOP_DIRECTION,stop.getDirection());
  return myIntent;
}
Program: 81127
Project: 81127
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
  setContentView(R.layout.stop_info);
  setListAdapter(new StopInfoListAdapter());
  Bundle bundle=getIntent().getExtras();
  mStopId=bundle.getString(STOP_ID);
  setHeader(bundle);
  UIHelp.setChildClickable(this,R.id.show_all,mShowAllClick);
  mRoutesFilter=ObaContract.StopRouteFilters.get(this,mStopId);
  mTripsForStop=getTripsForStop();
  Object response=getLastNonConfigurationInstance();
  if (response != null) {
    setResponse((ObaResponse)response,false);
  }
 else {
    getStopInfo(false);
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
  setContentView(R.layout.stop_info);
  setListAdapter(new StopInfoListAdapter());
  final Intent intent=getIntent();
  final Bundle bundle=intent.getExtras();
  final Uri data=intent.getData();
  if (data != null) {
    mStopId=data.getLastPathSegment();
  }
 else   if (bundle != null) {
    mStopId=bundle.getString(STOP_ID);
  }
 else {
    Log.e(TAG,"String_Node_Str");
    finish();
    return;
  }
  setHeader(bundle);
  UIHelp.setChildClickable(this,R.id.show_all,mShowAllClick);
  mRoutesFilter=ObaContract.StopRouteFilters.get(this,mStopId);
  mTripsForStop=getTripsForStop();
  Object response=getLastNonConfigurationInstance();
  if (response != null) {
    setResponse((ObaResponse)response,false);
  }
 else {
    getStopInfo(false);
  }
}
Program: 81128
Project: 81128
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.trip_info);
  final Bundle bundle=getIntent().getExtras();
  if (bundle == null) {
    Log.e(TAG,"String_Node_Str");
    finish();
    return;
  }
  if (!initFromBundle(bundle)) {
    Log.e(TAG,"String_Node_Str");
    finish();
    return;
  }
  boolean newTrip=!initFromDB();
  initForm(newTrip);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.trip_info);
  if (!initFromIntent(getIntent())) {
    Log.e(TAG,"String_Node_Str");
    finish();
    return;
  }
  boolean newTrip=!initFromDB();
  initForm(newTrip);
}
Program: 81129
Project: 81129
Buggy source:
public static void start(Context context,String tripId,String stopId,String routeId,String routeName,String stopName,long departureTime,String headsign){
  Intent myIntent=new Intent(context,TripInfoActivity.class);
  myIntent.putExtra(TRIP_ID,tripId);
  myIntent.putExtra(STOP_ID,stopId);
  myIntent.putExtra(ROUTE_ID,routeId);
  myIntent.putExtra(ROUTE_NAME,routeName);
  myIntent.putExtra(STOP_NAME,stopName);
  myIntent.putExtra(DEPARTURE_TIME,departureTime);
  myIntent.putExtra(HEADSIGN,headsign);
  context.startActivity(myIntent);
}

Fixed version (ground truth):
public static void start(Context context,String tripId,String stopId,String routeId,String routeName,String stopName,long departureTime,String headsign){
  Intent myIntent=new Intent(context,TripInfoActivity.class);
  myIntent.setData(ObaContract.Trips.buildUri(tripId,stopId));
  myIntent.putExtra(ROUTE_ID,routeId);
  myIntent.putExtra(ROUTE_NAME,routeName);
  myIntent.putExtra(STOP_NAME,stopName);
  myIntent.putExtra(DEPARTURE_TIME,departureTime);
  myIntent.putExtra(HEADSIGN,headsign);
  context.startActivity(myIntent);
}
Program: 81130
Project: 81130
Buggy source:
final void scheduleNext(TripsDbAdapter adapter,Cursor c){
  final int days=c.getInt(TripsDbAdapter.TRIP_COL_DAYS);
  if (days == 0) {
    adapter.deleteTrip(mTripId,mStopId);
  }
 else {
    final Intent tripService=new Intent(TripService.this,TripService.class);
    tripService.setAction(TripService.ACTION_SCHEDULE_TRIP);
    tripService.setData(buildTripUri(mTripId,mStopId));
    TripService.this.startService(tripService);
  }
}

Fixed version (ground truth):
final void scheduleNext(TripsDbAdapter adapter,Cursor c){
  final int days=c.getInt(TripsDbAdapter.TRIP_COL_DAYS);
  if (days == 0) {
    adapter.deleteTrip(mTripId,mStopId);
  }
 else {
    TripService ctx=TripService.this;
    Intent myIntent=new Intent(ACTION_POLL_TRIP,buildTripUri(mTripId,mStopId),ctx,AlarmReceiver.class);
    PendingIntent alarmIntent=PendingIntent.getBroadcast(ctx,0,myIntent,PendingIntent.FLAG_ONE_SHOT);
    AlarmManager alarm=(AlarmManager)ctx.getSystemService(Context.ALARM_SERVICE);
    long triggerTime=System.currentTimeMillis() + 60 * ONE_MINUTE;
    alarm.set(AlarmManager.RTC_WAKEUP,triggerTime,alarmIntent);
  }
}
Program: 81131
Project: 81131
Buggy source:
synchronized void clearNotification(){
  Log.d(TAG,"String_Node_Str" + getTaskId());
  mState=CLEARED;
}

Fixed version (ground truth):
synchronized void clearNotification(){
  Log.d(TAG,"String_Node_Str" + getTaskId());
  mNotification=null;
  mState=DONE;
}
Program: 81132
Project: 81132
Buggy source:
final boolean doPoll(Cursor c){
  final String tripId=mTripId;
  final String stopId=mStopId;
  final long reminderMS=(1 + c.getInt(TripsDbAdapter.TRIP_COL_REMINDER)) * ONE_MINUTE;
  final long departMS=c.getInt(TripsDbAdapter.TRIP_COL_DEPARTURE) * ONE_MINUTE;
  mState=NOT_FOUND;
  while (mState != CLEARED) {
    Log.d(TAG,"String_Node_Str" + getTaskId());
    ObaResponse response=ObaApi.getArrivalsDeparturesForStop(stopId);
    final long now=System.currentTimeMillis();
    if (response.getCode() == ObaApi.OBA_OK) {
      final ObaArray arrivals=response.getData().getArrivalsAndDepartures();
      final int length=arrivals.length();
      for (int i=0; i < length; ++i) {
        ObaArrivalInfo info=arrivals.getArrivalInfo(i);
        if (tripId.equals(info.getTripId())) {
synchronized (this) {
            if (mState == NOT_FOUND) {
              Log.d(TAG,"String_Node_Str" + getTaskId());
              mState=FOUND;
            }
            long time=info.getPredictedArrivalTime();
            if (time == 0) {
              time=info.getScheduledArrivalTime();
            }
            if (mState == FOUND) {
              if ((time - reminderMS) < now) {
                doNotification(time - now,c);
                mState=NOTIFIED;
              }
 else               if (time < now) {
                mState=CLEARED;
                break;
              }
            }
 else             if (mState == NOTIFIED) {
              final long timeDiff=time - now;
              if (timeDiff <= 0) {
                cancelNotification();
                mState=CLEARED;
                break;
              }
 else {
                doNotification(timeDiff,c);
              }
            }
          }
        }
      }
    }
    if (mState == NOT_FOUND && ((departMS + LOOKAHEAD_DURATION_MS) > now)) {
      Log.d(TAG,"String_Node_Str" + getTaskId());
      break;
    }
    try {
      Thread.sleep(30 * 1000);
    }
 catch (    InterruptedException e) {
    }
  }
  return mState == CLEARED;
}

Fixed version (ground truth):
final void doPoll(Cursor c){
  final String stopId=mStopId;
  final long reminderMS=(1 + c.getInt(TripsDbAdapter.TRIP_COL_REMINDER)) * ONE_MINUTE;
  final long departMS=c.getInt(TripsDbAdapter.TRIP_COL_DEPARTURE) * ONE_MINUTE;
  mState=NOT_FOUND;
  while (mState != DONE) {
    Log.d(TAG,"String_Node_Str" + getTaskId());
    ObaResponse response=ObaApi.getArrivalsDeparturesForStop(stopId);
synchronized (this) {
      if (mState == DONE) {
        break;
      }
      final long now=System.currentTimeMillis();
      if (response.getCode() == ObaApi.OBA_OK) {
        if (checkArrivals(response,c,reminderMS,now)) {
          break;
        }
      }
      if (mState == NOT_FOUND && ((departMS + LOOKAHEAD_DURATION_MS) > now)) {
        Log.d(TAG,"String_Node_Str" + getTaskId());
        mState=DONE;
        break;
      }
    }
    try {
      Thread.sleep(30 * 1000);
    }
 catch (    InterruptedException e) {
    }
  }
}
Program: 81133
Project: 81133
Buggy source:
final void doNotification(long timeDiff,Cursor c){
  final Context ctx=TripService.this;
  Log.d(TAG,"String_Node_Str" + getTaskId());
  if (mNotification == null) {
    mNotification=new Notification(R.drawable.stat_trip,null,System.currentTimeMillis());
    mNotification.defaults|=Notification.DEFAULT_SOUND | Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE;
    Intent deleteIntent=new Intent(ctx,TripService.class);
    deleteIntent.setAction(ACTION_CANCEL_POLL);
    deleteIntent.setData(buildTripUri(mTripId,mStopId));
    mNotification.deleteIntent=PendingIntent.getService(ctx,0,deleteIntent,PendingIntent.FLAG_ONE_SHOT);
    Intent stopActivity=new Intent(ctx,StopInfoActivity.class);
    stopActivity.putExtra(StopInfoActivity.STOP_ID,mStopId);
    mNotificationIntent=PendingIntent.getActivity(ctx,0,stopActivity,PendingIntent.FLAG_ONE_SHOT);
  }
 else {
    mNotification.defaults=0;
  }
  final String title=getResources().getString(R.string.app_name);
  mNotification.setLatestEventInfo(ctx,title,getNotifyText(c,timeDiff),mNotificationIntent);
  NotificationManager nm=(NotificationManager)getSystemService(NOTIFICATION_SERVICE);
  nm.notify(NOTIFY_ID,mNotification);
}

Fixed version (ground truth):
final void doNotification(long timeDiff,Cursor c){
  final Context ctx=TripService.this;
  if (mNotification == null) {
    Log.d(TAG,"String_Node_Str" + getTaskId());
    mNotification=new Notification(R.drawable.stat_trip,null,System.currentTimeMillis());
    mNotification.defaults|=Notification.DEFAULT_SOUND | Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE;
    Intent deleteIntent=new Intent(ctx,TripService.class);
    deleteIntent.setAction(ACTION_CANCEL_POLL);
    deleteIntent.setData(buildTripUri(mTripId,mStopId));
    mNotification.deleteIntent=PendingIntent.getService(ctx,0,deleteIntent,PendingIntent.FLAG_ONE_SHOT);
    Intent stopActivity=new Intent(ctx,StopInfoActivity.class);
    stopActivity.putExtra(StopInfoActivity.STOP_ID,mStopId);
    mNotificationIntent=PendingIntent.getActivity(ctx,0,stopActivity,PendingIntent.FLAG_ONE_SHOT);
  }
 else {
    Log.d(TAG,"String_Node_Str" + getTaskId());
    mNotification.defaults=0;
  }
  final String title=getResources().getString(R.string.app_name);
  mNotification.setLatestEventInfo(ctx,title,getNotifyText(c,timeDiff),mNotificationIntent);
  NotificationManager nm=(NotificationManager)getSystemService(NOTIFICATION_SERVICE);
  nm.notify(NOTIFY_ID,mNotification);
}
Program: 81134
Project: 81134
Buggy source:
final String getNotifyText(Cursor c,long timeDiff){
  final String routeName=RoutesDbAdapter.getRouteShortName(this,c.getString(TripsDbAdapter.TRIP_COL_ROUTEID));
  final Resources res=getResources();
  if (timeDiff < ONE_MINUTE) {
    final String fmt=res.getString(R.string.trip_stat_lessthanone);
    return String.format(fmt,routeName);
  }
 else   if (timeDiff < ONE_MINUTE * 2) {
    final String fmt=res.getString(R.string.trip_stat_one);
    return String.format(fmt,routeName);
  }
 else {
    final String fmt=res.getString(R.string.trip_stat);
    return String.format(fmt,routeName,(int)(timeDiff / ONE_MINUTE));
  }
}

Fixed version (ground truth):
final String getNotifyText(Cursor c,long timeDiff){
  final String routeName=RoutesDbAdapter.getRouteShortName(this,c.getString(TripsDbAdapter.TRIP_COL_ROUTEID));
  final Resources res=getResources();
  if (timeDiff <= 0) {
    final String fmt=res.getString(R.string.trip_stat_gone);
    return String.format(fmt,routeName);
  }
 else   if (timeDiff < ONE_MINUTE) {
    final String fmt=res.getString(R.string.trip_stat_lessthanone);
    return String.format(fmt,routeName);
  }
 else   if (timeDiff < ONE_MINUTE * 2) {
    final String fmt=res.getString(R.string.trip_stat_one);
    return String.format(fmt,routeName);
  }
 else {
    final String fmt=res.getString(R.string.trip_stat);
    return String.format(fmt,routeName,(int)(timeDiff / ONE_MINUTE));
  }
}
Program: 81135
Project: 81135
Buggy source:
@Override public void onPause(){
  mTimer.cancel();
  super.onPause();
}

Fixed version (ground truth):
@Override public void onPause(){
  mTimer.cancel();
  mTimer=null;
  super.onPause();
}
Program: 81136
Project: 81136
Buggy source:
@Override public void onResume(){
  mTimer.schedule(new TimerTask(){
    @Override public void run(){
      mRefreshHandler.post(mRefresh);
    }
  }
,RefreshPeriod,RefreshPeriod);
  super.onResume();
}

Fixed version (ground truth):
@Override public void onResume(){
  if (mTimer == null) {
    mTimer=new Timer();
  }
  mTimer.schedule(new TimerTask(){
    @Override public void run(){
      mRefreshHandler.post(mRefresh);
    }
  }
,RefreshPeriod,RefreshPeriod);
  super.onResume();
}
Program: 81137
Project: 81137
Buggy source:
/** 
 * Returns whether the specified class is either within one of the specified packages or within a subpackage of one of the packages
 * @param clazz       The class
 * @param packageList The list of packages
 * @return True if it is within the list of specified packages
 */
public static boolean isClassBelowPackage(@Nonnull Class<?> clazz,@Nonnull List<?> packageList){
  requireNonNull(clazz,ERROR_CLAZZ_NULL);
  requireNonNull(packageList,"String_Node_Str");
  String classPackage=clazz.getPackage().getName();
  for (  Object packageName : packageList) {
    if (packageName != null) {
      if (classPackage.startsWith(packageName.toString())) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns whether the specified class is either within one of the specified packages or within a subpackage of one of the packages
 * @param clazz       The class
 * @param packageList The list of packages
 * @return True if it is within the list of specified packages
 */
public static boolean isClassBelowPackage(@Nonnull Class<?> clazz,@Nonnull List<?> packageList){
  requireNonNull(clazz,ERROR_CLAZZ_NULL);
  requireNonNull(packageList,"String_Node_Str");
  String classPackage=clazz.getPackage().getName();
  for (  Object packageName : packageList) {
    if (packageName != null && classPackage.startsWith(packageName.toString())) {
      return true;
    }
  }
  return false;
}
Program: 81138
Project: 81138
Buggy source:
public static String getLogicalPropertyName(String className,String trailingName){
  if (!isBlank(className) && !isBlank(trailingName)) {
    if (className.length() == trailingName.length() + 1 && className.endsWith(trailingName)) {
      return className.substring(0,1).toLowerCase();
    }
  }
  return getLogicalName(getPropertyName(className),trailingName);
}

Fixed version (ground truth):
public static String getLogicalPropertyName(String className,String trailingName){
  if (!isBlank(className) && !isBlank(trailingName) && className.length() == trailingName.length() + 1 && className.endsWith(trailingName)) {
    return className.substring(0,1).toLowerCase();
  }
  return getLogicalName(getPropertyName(className),trailingName);
}
Program: 81139
Project: 81139
Buggy source:
@PostConstruct private void initialize(){
  this.application=requireNonNull(application,"String_Node_Str");
  application.getEventRouter().addEventListener(ApplicationEvent.NEW_INSTANCE.getName(),new RunnableWithArgs(){
    @Override public void run(    @Nullable Object... args){
      Object instance=args[1];
      injectConfiguration(instance);
    }
  }
);
}

Fixed version (ground truth):
@PostConstruct private void initialize(){
  requireNonNull(application,"String_Node_Str");
  application.getEventRouter().addEventListener(ApplicationEvent.NEW_INSTANCE.getName(),new RunnableWithArgs(){
    @Override public void run(    @Nullable Object... args){
      Object instance=args[1];
      injectConfiguration(instance);
    }
  }
);
}
Program: 81140
Project: 81140
Buggy source:
@Nonnull protected Map<String,Object> copyAndConfigureArguments(@Nonnull Map<String,Object> args,@Nonnull MVCGroupConfiguration configuration,@Nonnull String mvcId){
  Map<String,Object> argsCopy=CollectionUtils.<String,Object>map().e("String_Node_Str",getApplication()).e("String_Node_Str",configuration.getMvcType()).e("String_Node_Str",mvcId).e("String_Node_Str",configuration);
  if (args.containsKey(KEY_PARENT_GROUP)) {
    if (args.get(KEY_PARENT_GROUP) instanceof MVCGroup) {
      MVCGroup parentGroup=(MVCGroup)args.get(KEY_PARENT_GROUP);
      for (      Map.Entry<String,Object> e : parentGroup.getMembers().entrySet()) {
        args.put("String_Node_Str" + capitalize(e.getKey()),e.getValue());
      }
    }
  }
  argsCopy.putAll(args);
  return argsCopy;
}

Fixed version (ground truth):
@Nonnull protected Map<String,Object> copyAndConfigureArguments(@Nonnull Map<String,Object> args,@Nonnull MVCGroupConfiguration configuration,@Nonnull String mvcId){
  Map<String,Object> argsCopy=CollectionUtils.<String,Object>map().e("String_Node_Str",getApplication()).e("String_Node_Str",configuration.getMvcType()).e("String_Node_Str",mvcId).e("String_Node_Str",configuration);
  if (args.containsKey(KEY_PARENT_GROUP) && args.get(KEY_PARENT_GROUP) instanceof MVCGroup) {
    MVCGroup parentGroup=(MVCGroup)args.get(KEY_PARENT_GROUP);
    for (    Map.Entry<String,Object> e : parentGroup.getMembers().entrySet()) {
      args.put("String_Node_Str" + capitalize(e.getKey()),e.getValue());
    }
  }
  argsCopy.putAll(args);
  return argsCopy;
}
Program: 81141
Project: 81141
Buggy source:
/** 
 * Creates a copy of a FieldNode with a new name and, optionally, a new type.
 * @param newName The name for the new field node.
 * @param newType The new type of the field.  If null, the old FieldNode's type will be used.
 * @param f       The FieldNode to copy.
 * @return The new FieldNode.
 */
private FieldNode createFieldNodeCopy(String newName,ClassNode newType,FieldNode f){
  if (newType == null)   newType=f.getType();
  newType=newType.getPlainNodeReference();
  return new FieldNode(newName,f.getModifiers(),newType,f.getOwner(),f.getInitialValueExpression());
}

Fixed version (ground truth):
/** 
 * Creates a copy of a FieldNode with a new name and, optionally, a new type.
 * @param newName The name for the new field node.
 * @param newType The new type of the field.  If null, the old FieldNode's type will be used.
 * @param f       The FieldNode to copy.
 * @return The new FieldNode.
 */
private FieldNode createFieldNodeCopy(String newName,ClassNode newType,FieldNode f){
  if (newType == null) {
    newType=f.getType();
  }
  newType=newType.getPlainNodeReference();
  return new FieldNode(newName,f.getModifiers(),newType,f.getOwner(),f.getInitialValueExpression());
}
Program: 81143
Project: 81143
Buggy source:
/** 
 * Creates a setter method and adds it to the declaring class.  The setter has the form: <p> void <setter>(<type> fieldName)
 * @param declaringClass The class to which the method is added
 * @param propertyNode   The property node being accessed by this setter
 * @param setterName     The name of the setter method
 * @param setterBlock    The code body of the method
 */
protected void createSetterMethod(ClassNode declaringClass,PropertyNode propertyNode,String setterName,Statement setterBlock,List<AnnotationNode> annotations){
  Parameter[] setterParameterTypes={new Parameter(propertyNode.getType(),"String_Node_Str")};
  int mod=propertyNode.getModifiers() | Opcodes.ACC_FINAL;
  MethodNode setter=new MethodNode(setterName,mod,ClassHelper.VOID_TYPE,setterParameterTypes,ClassNode.EMPTY_ARRAY,setterBlock);
  if (annotations != null)   setter.addAnnotations(annotations);
  setter.setSynthetic(true);
  declaringClass.addMethod(setter);
}

Fixed version (ground truth):
/** 
 * Creates a setter method and adds it to the declaring class.  The setter has the form: <p> void <setter>(<type> fieldName)
 * @param declaringClass The class to which the method is added
 * @param propertyNode   The property node being accessed by this setter
 * @param setterName     The name of the setter method
 * @param setterBlock    The code body of the method
 */
protected void createSetterMethod(ClassNode declaringClass,PropertyNode propertyNode,String setterName,Statement setterBlock,List<AnnotationNode> annotations){
  Parameter[] setterParameterTypes={new Parameter(propertyNode.getType(),"String_Node_Str")};
  int mod=propertyNode.getModifiers() | Opcodes.ACC_FINAL;
  MethodNode setter=new MethodNode(setterName,mod,ClassHelper.VOID_TYPE,setterParameterTypes,ClassNode.EMPTY_ARRAY,setterBlock);
  if (annotations != null) {
    setter.addAnnotations(annotations);
  }
  setter.setSynthetic(true);
  declaringClass.addMethod(setter);
}
Program: 81144
Project: 81144
Buggy source:
/** 
 * Creates a getter method and adds it to the declaring class.
 * @param declaringClass The class to which the method is added
 * @param propertyNode   The property node being accessed by this getter
 * @param getterName     The name of the getter method
 * @param getterBlock    The code body of the method
 */
protected void createGetterMethod(ClassNode declaringClass,PropertyNode propertyNode,String getterName,Statement getterBlock,List<AnnotationNode> annotations){
  int mod=propertyNode.getModifiers() | Opcodes.ACC_FINAL;
  MethodNode getter=new MethodNode(getterName,mod,propertyNode.getType(),Parameter.EMPTY_ARRAY,ClassNode.EMPTY_ARRAY,getterBlock);
  if (annotations != null)   getter.addAnnotations(annotations);
  getter.setSynthetic(true);
  declaringClass.addMethod(getter);
}

Fixed version (ground truth):
/** 
 * Creates a getter method and adds it to the declaring class.
 * @param declaringClass The class to which the method is added
 * @param propertyNode   The property node being accessed by this getter
 * @param getterName     The name of the getter method
 * @param getterBlock    The code body of the method
 */
protected void createGetterMethod(ClassNode declaringClass,PropertyNode propertyNode,String getterName,Statement getterBlock,List<AnnotationNode> annotations){
  int mod=propertyNode.getModifiers() | Opcodes.ACC_FINAL;
  MethodNode getter=new MethodNode(getterName,mod,propertyNode.getType(),Parameter.EMPTY_ARRAY,ClassNode.EMPTY_ARRAY,getterBlock);
  if (annotations != null) {
    getter.addAnnotations(annotations);
  }
  getter.setSynthetic(true);
  declaringClass.addMethod(getter);
}
Program: 81146
Project: 81146
Buggy source:
public void handleClose(@Nonnull Window widget){
  if (getApplication().getPhase() == ApplicationPhase.SHUTDOWN) {
    return;
  }
  List<Window> visibleWindows=new ArrayList<>();
  for (  Window window : getWindows()) {
    if (window.isShowing()) {
      visibleWindows.add(window);
    }
  }
  if (isAutoShutdown() && visibleWindows.size() <= 1 && visibleWindows.contains(widget)) {
    if (!getApplication().shutdown())     show(widget);
  }
}

Fixed version (ground truth):
public void handleClose(@Nonnull Window widget){
  if (getApplication().getPhase() == ApplicationPhase.SHUTDOWN) {
    return;
  }
  List<Window> visibleWindows=new ArrayList<>();
  for (  Window window : getWindows()) {
    if (window.isShowing()) {
      visibleWindows.add(window);
    }
  }
  if (isAutoShutdown() && visibleWindows.size() <= 1 && visibleWindows.contains(widget) && !getApplication().shutdown()) {
    show(widget);
  }
}
Program: 81147
Project: 81147
Buggy source:
public void handleClose(@Nonnull Window widget){
  if (getApplication().getPhase() == ApplicationPhase.SHUTDOWN) {
    return;
  }
  int visibleWindows=getWindows().size();
  if (visibleWindows <= 1 && isAutoShutdown()) {
    if (!getApplication().shutdown())     show(widget);
  }
}

Fixed version (ground truth):
public void handleClose(@Nonnull Window widget){
  if (getApplication().getPhase() == ApplicationPhase.SHUTDOWN) {
    return;
  }
  int visibleWindows=getWindows().size();
  if (visibleWindows <= 1 && isAutoShutdown() && !getApplication().shutdown()) {
    show(widget);
  }
}
Program: 81148
Project: 81148
Buggy source:
public void handleClose(@Nonnull Window widget){
  if (getApplication().getPhase() == ApplicationPhase.SHUTDOWN) {
    return;
  }
  int visibleWindows=0;
  for (  Window window : getWindows()) {
    if (window.isShowing()) {
      visibleWindows++;
    }
  }
  if (visibleWindows <= 1 && isAutoShutdown()) {
    if (!getApplication().shutdown())     show(widget);
  }
}

Fixed version (ground truth):
public void handleClose(@Nonnull Window widget){
  if (getApplication().getPhase() == ApplicationPhase.SHUTDOWN) {
    return;
  }
  int visibleWindows=0;
  for (  Window window : getWindows()) {
    if (window.isShowing()) {
      visibleWindows++;
    }
  }
  if (visibleWindows <= 1 && isAutoShutdown() && !getApplication().shutdown()) {
    show(widget);
  }
}
Program: 81149
Project: 81149
Buggy source:
@SuppressWarnings("String_Node_Str") private void handleAsString(String str){
  try {
    super.setValueInternal(isBlank(str) ? null : Enum.valueOf(enumType,str));
  }
 catch (  Exception e) {
    throw illegalValue(str,enumType,e);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void handleAsString(String str){
  if (isBlank(str)) {
    super.setValueInternal(null);
    return;
  }
  try {
    super.setValueInternal(isBlank(str) ? null : Enum.valueOf(enumType,str));
  }
 catch (  Exception e) {
    throw illegalValue(str,enumType,e);
  }
}
Program: 81150
Project: 81150
Buggy source:
private void handleAsString(String str){
  if (isBlank(str)) {
    throw illegalValue(str,File.class);
  }
  super.setValueInternal(new File(str));
}

Fixed version (ground truth):
private void handleAsString(String str){
  if (isBlank(str)) {
    super.setValueInternal(null);
    return;
  }
  super.setValueInternal(new File(str));
}
Program: 81151
Project: 81151
Buggy source:
private void handleAsString(String str){
  try {
    super.setValueInternal(new URI(str));
  }
 catch (  URISyntaxException e) {
    throw illegalValue(str,URI.class,e);
  }
}

Fixed version (ground truth):
private void handleAsString(String str){
  if (isBlank(str)) {
    super.setValueInternal(null);
    return;
  }
  try {
    super.setValueInternal(new URI(str));
  }
 catch (  URISyntaxException e) {
    throw illegalValue(str,URI.class,e);
  }
}
Program: 81152
Project: 81152
Buggy source:
private void handleAsString(String str){
  try {
    super.setValueInternal(new URL(str));
  }
 catch (  MalformedURLException e) {
    throw illegalValue(str,URL.class,e);
  }
}

Fixed version (ground truth):
private void handleAsString(String str){
  if (isBlank(str)) {
    super.setValueInternal(null);
    return;
  }
  try {
    super.setValueInternal(new URL(str));
  }
 catch (  MalformedURLException e) {
    throw illegalValue(str,URL.class,e);
  }
}
Program: 81153
Project: 81153
Buggy source:
protected void doSetConfigProperties(String name,GriffonService service){
  if (LOG.isInfoEnabled()) {
    LOG.info("String_Node_Str" + name + "String_Node_Str");
  }
  name=name.substring(0,name.length() - TRAILING.length());
  ConfigObject config=(ConfigObject)ConfigUtils.getConfigValue(getApp().getConfig(),"String_Node_Str" + name);
  InvokerHelper.setProperties(service,config);
}

Fixed version (ground truth):
protected void doSetConfigProperties(String name,GriffonService service){
  if (LOG.isInfoEnabled()) {
    LOG.info("String_Node_Str" + name + "String_Node_Str");
  }
  name=name.substring(0,name.length() - TRAILING.length());
  ConfigObject config=(ConfigObject)ConfigUtils.getConfigValue(getApp().getConfig(),"String_Node_Str" + name);
  if (config != null && !config.isEmpty())   InvokerHelper.setProperties(service,config);
}
Program: 81155
Project: 81155
Buggy source:
public static ClassExpression classx(Class clazz){
  return classx(ClassHelper.makeWithoutCaching(clazz));
}

Fixed version (ground truth):
public static ClassExpression classx(Class clazz){
  return classx(ClassHelper.makeWithoutCaching(clazz).getPlainNodeReference());
}
Program: 81158
Project: 81158
Buggy source:
/** 
 * <p>Work out if the specified property is readable and static. Java introspection does not recognize this concept of static properties but Groovy does. We also consider public static fields as static properties with no getters/setters</p>
 * @param clazz The class to check for static property
 * @param propertyName The property name
 * @return true if the property with name propertyName has a static getter method
 */
public static boolean isStaticProperty(Class<?> clazz,String propertyName){
  Method getter=findDeclaredMethod(clazz,getGetterName(propertyName),null);
  if (getter != null) {
    return isPublicStatic(getter);
  }
 else {
    try {
      Field f=clazz.getDeclaredField(propertyName);
      if (f != null) {
        return isPublicStatic(f);
      }
    }
 catch (    NoSuchFieldException e) {
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * <p>Work out if the specified property is readable and static. Java introspection does not recognize this concept of static properties but Groovy does. We also consider public static fields as static properties with no getters/setters</p>
 * @param clazz The class to check for static property
 * @param propertyName The property name
 * @return true if the property with name propertyName has a static getter method
 */
public static boolean isStaticProperty(Class<?> clazz,String propertyName){
  Method getter=findDeclaredMethod(clazz,getGetterName(propertyName),null);
  if (getter != null) {
    return isPublicStatic(getter);
  }
 else {
    try {
      Field f=clazz.getDeclaredField(propertyName);
      if (f != null) {
        return isPublicStatic(f);
      }
    }
 catch (    NoSuchFieldException ignore) {
    }
  }
  return false;
}
Program: 81159
Project: 81159
Buggy source:
/** 
 * <p>Get a static property value, which has a public static getter or is just a public static field.</p>
 * @param clazz The class to check for static property
 * @param name The property name
 * @return The value if there is one, or null if unset OR there is no such property
 */
public static Object getStaticPropertyValue(Class<?> clazz,String name){
  Method getter=findDeclaredMethod(clazz,getGetterName(name),null);
  try {
    if (getter != null) {
      return getter.invoke(null,(Object[])null);
    }
 else {
      Field f=clazz.getDeclaredField(name);
      if (f != null) {
        return f.get(null);
      }
    }
  }
 catch (  Exception e) {
  }
  return null;
}

Fixed version (ground truth):
/** 
 * <p>Get a static property value, which has a public static getter or is just a public static field.</p>
 * @param clazz The class to check for static property
 * @param name The property name
 * @return The value if there is one, or null if unset OR there is no such property
 */
public static Object getStaticPropertyValue(Class<?> clazz,String name){
  Method getter=findDeclaredMethod(clazz,getGetterName(name),null);
  try {
    if (getter != null) {
      return getter.invoke(null,(Object[])null);
    }
 else {
      Field f=clazz.getDeclaredField(name);
      if (f != null) {
        return f.get(null);
      }
    }
  }
 catch (  Exception ignore) {
  }
  return null;
}
Program: 81161
Project: 81161
Buggy source:
public void setMetaClass(MetaClass metaClass){
  _metaClass=metaClass;
  GroovySystem.getMetaClassRegistry().setMetaClass(getClass(),metaClass);
}

Fixed version (ground truth):
public void setMetaClass(MetaClass metaClass){
  metaClass=metaClass;
  GroovySystem.getMetaClassRegistry().setMetaClass(getClass(),metaClass);
}
Program: 81162
Project: 81162
Buggy source:
public MetaClass getMetaClass(){
  if (_metaClass == null) {
    Class clazz=getClass();
    _metaClass=GroovySystem.getMetaClassRegistry().getMetaClass(clazz);
    if (!(_metaClass instanceof ExpandoMetaClass) || !(_metaClass instanceof UberInterceptorMetaClass)) {
      _metaClass=new ExpandoMetaClass(clazz,true,true);
      log.debug("String_Node_Str" + _metaClass);
      _metaClass.initialize();
      GroovySystem.getMetaClassRegistry().setMetaClass(clazz,_metaClass);
    }
  }
  return _metaClass;
}

Fixed version (ground truth):
public MetaClass getMetaClass(){
  if (metaClass == null) {
    Class clazz=getClass();
    metaClass=GroovySystem.getMetaClassRegistry().getMetaClass(clazz);
    if (!(metaClass instanceof ExpandoMetaClass) || !(metaClass instanceof UberInterceptorMetaClass)) {
      metaClass=new ExpandoMetaClass(clazz,true,true);
      log.debug("String_Node_Str" + metaClass);
      metaClass.initialize();
      GroovySystem.getMetaClassRegistry().setMetaClass(clazz,metaClass);
    }
  }
  return metaClass;
}
Program: 81163
Project: 81163
Buggy source:
/** 
 * Handles the bulk of the processing, mostly delegating to other methods.
 * @param nodes  the ast nodes
 * @param source the source unit for the nodes
 */
public void visit(ASTNode[] nodes,SourceUnit source){
  if (!(nodes[0] instanceof AnnotationNode) || !(nodes[1] instanceof ClassNode)) {
    throw new RuntimeException("String_Node_Str");
  }
  addEventRouterToClass(source,(ClassNode)nodes[1]);
}

Fixed version (ground truth):
/** 
 * Handles the bulk of the processing, mostly delegating to other methods.
 * @param nodes  the ast nodes
 * @param source the source unit for the nodes
 */
public void visit(ASTNode[] nodes,SourceUnit source){
  checkNodesForAnnotationAndType(nodes[0],nodes[1]);
  addEventRouterToClass(source,(ClassNode)nodes[1]);
}
Program: 81164
Project: 81164
Buggy source:
/** 
 * Handles the bulk of the processing, mostly delegating to other methods.
 * @param nodes  the ast nodes
 * @param source the source unit for the nodes
 */
public void visit(ASTNode[] nodes,SourceUnit source){
  if (!(nodes[0] instanceof AnnotationNode) || !(nodes[1] instanceof ClassNode)) {
    throw new RuntimeException("String_Node_Str");
  }
  ClassNode classNode=(ClassNode)nodes[1];
  if (!classNode.implementsInterface(MVC_HANDLER_TYPE)) {
    apply(classNode);
  }
}

Fixed version (ground truth):
/** 
 * Handles the bulk of the processing, mostly delegating to other methods.
 * @param nodes  the ast nodes
 * @param source the source unit for the nodes
 */
public void visit(ASTNode[] nodes,SourceUnit source){
  checkNodesForAnnotationAndType(nodes[0],nodes[1]);
  ClassNode classNode=(ClassNode)nodes[1];
  if (!classNode.implementsInterface(MVC_HANDLER_TYPE)) {
    apply(classNode);
  }
}