nus-yam/ex-repair huggingface dataset:
Program: 162096
Project: 162096
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  Log.v(TAG,"String_Node_Str" + intent.getAction());
  newView=new RemoteViews(context.getPackageName(),R.layout.widget_layout);
  appWidgetManager=AppWidgetManager.getInstance(context);
  if (intent.getAction() == null) {
    Log.v(TAG,"String_Node_Str");
    Bundle extras=intent.getExtras();
    if (extras != null) {
      int receivedWidgetId=extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,AppWidgetManager.INVALID_APPWIDGET_ID);
      new getJsonResponse(context,receivedWidgetId,false).execute();
    }
  }
 else   if (intent.getAction().equals("String_Node_Str")) {
    ComponentName thisAppWidget=new ComponentName(context.getPackageName(),TransLocWidgetProvider.class.getName());
    int[] appWidgetIds=appWidgetManager.getAppWidgetIds(thisAppWidget);
    for (int i=0; i < appWidgetIds.length; i++) {
      Log.v(TAG,"String_Node_Str" + appWidgetIds[i]);
      new getJsonResponse(context,appWidgetIds[i],true).execute();
    }
  }
 else {
    Log.v(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  Log.v(TAG,"String_Node_Str" + intent.getAction());
  newView=new RemoteViews(context.getPackageName(),R.layout.widget_layout);
  appWidgetManager=AppWidgetManager.getInstance(context);
  if (intent.getAction() == null) {
    Log.v(TAG,"String_Node_Str");
    Bundle extras=intent.getExtras();
    if (extras != null) {
      int receivedWidgetId=extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,AppWidgetManager.INVALID_APPWIDGET_ID);
      new getJsonResponse(context,receivedWidgetId,false).execute();
    }
  }
 else   if (intent.getAction().equals("String_Node_Str") || intent.getAction().equals("String_Node_Str")) {
    ComponentName thisAppWidget=new ComponentName(context.getPackageName(),TransLocWidgetProvider.class.getName());
    int[] appWidgetIds=appWidgetManager.getAppWidgetIds(thisAppWidget);
    for (int i=0; i < appWidgetIds.length; i++) {
      new getJsonResponse(context,appWidgetIds[i],true).execute();
    }
  }
 else {
    Log.v(TAG,"String_Node_Str");
  }
}
Program: 162098
Project: 162098
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  Log.v(TAG,"String_Node_Str" + intent.getAction());
  newView=new RemoteViews(context.getPackageName(),R.layout.widget_layout);
  appWidgetManager=AppWidgetManager.getInstance(context);
  if (intent.getAction() == null) {
    Log.v(TAG,"String_Node_Str");
    Bundle extras=intent.getExtras();
    if (extras != null) {
      int receivedWidgetId=extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,AppWidgetManager.INVALID_APPWIDGET_ID);
      new getJsonResponse(context,receivedWidgetId,false).execute();
    }
  }
 else   if (intent.getAction().equals("String_Node_Str")) {
    ComponentName thisAppWidget=new ComponentName(context.getPackageName(),TransLocWidgetProvider.class.getName());
    int[] appWidgetIds=appWidgetManager.getAppWidgetIds(thisAppWidget);
    for (int i=0; i < appWidgetIds.length; i++) {
      Log.v(TAG,"String_Node_Str" + appWidgetIds[i]);
      new getJsonResponse(context,appWidgetIds[i],true).execute();
    }
  }
 else {
    Log.v(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  Log.v(TAG,"String_Node_Str" + intent.getAction());
  newView=new RemoteViews(context.getPackageName(),R.layout.widget_layout);
  appWidgetManager=AppWidgetManager.getInstance(context);
  if (intent.getAction() == null) {
    Log.v(TAG,"String_Node_Str");
    Bundle extras=intent.getExtras();
    if (extras != null) {
      int receivedWidgetId=extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,AppWidgetManager.INVALID_APPWIDGET_ID);
      new getJsonResponse(context,receivedWidgetId,false).execute();
    }
  }
 else   if (intent.getAction().equals("String_Node_Str") || intent.getAction().equals("String_Node_Str")) {
    ComponentName thisAppWidget=new ComponentName(context.getPackageName(),TransLocWidgetProvider.class.getName());
    int[] appWidgetIds=appWidgetManager.getAppWidgetIds(thisAppWidget);
    for (int i=0; i < appWidgetIds.length; i++) {
      new getJsonResponse(context,appWidgetIds[i],true).execute();
    }
  }
 else {
    Log.v(TAG,"String_Node_Str");
  }
}
Program: 162104
Project: 162104
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  Log.v("String_Node_Str","String_Node_Str");
  if (intent.getAction() == null) {
    Bundle extras=intent.getExtras();
    if (extras != null) {
      Log.v("String_Node_Str","String_Node_Str");
      appWidgetManager=AppWidgetManager.getInstance(context);
      widgetId=extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,AppWidgetManager.INVALID_APPWIDGET_ID);
      Log.v("String_Node_Str","String_Node_Str" + widgetId);
      getJsonResponse task=new getJsonResponse(context);
      task.execute();
    }
  }
 else {
    super.onReceive(context,intent);
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  Log.v("String_Node_Str","String_Node_Str");
  if (intent.getAction() == null) {
    Bundle extras=intent.getExtras();
    Log.v("String_Node_Str","String_Node_Str");
    appWidgetManager=AppWidgetManager.getInstance(context);
    widgetId=extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,AppWidgetManager.INVALID_APPWIDGET_ID);
    Log.v("String_Node_Str","String_Node_Str" + widgetId);
    Log.v("String_Node_Str","String_Node_Str");
    getJsonResponse task=new getJsonResponse(context);
    task.execute();
  }
 else {
    super.onReceive(context,intent);
  }
}
Program: 162107
Project: 162107
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  Log.v("String_Node_Str","String_Node_Str");
  if (intent.getAction() == null) {
    Bundle extras=intent.getExtras();
    if (extras != null) {
      Log.v("String_Node_Str","String_Node_Str");
      appWidgetManager=AppWidgetManager.getInstance(context);
      widgetId=extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,AppWidgetManager.INVALID_APPWIDGET_ID);
      Log.v("String_Node_Str","String_Node_Str" + widgetId);
      getJsonResponse task=new getJsonResponse(context);
      task.execute();
    }
  }
 else {
    super.onReceive(context,intent);
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  Log.v("String_Node_Str","String_Node_Str");
  if (intent.getAction() == null) {
    Bundle extras=intent.getExtras();
    Log.v("String_Node_Str","String_Node_Str");
    appWidgetManager=AppWidgetManager.getInstance(context);
    widgetId=extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,AppWidgetManager.INVALID_APPWIDGET_ID);
    Log.v("String_Node_Str","String_Node_Str" + widgetId);
    Log.v("String_Node_Str","String_Node_Str");
    getJsonResponse task=new getJsonResponse(context);
    task.execute();
  }
 else {
    super.onReceive(context,intent);
  }
}
Program: 162109
Project: 162109
Buggy source:
@Override protected void onPreExecute(){
}

Fixed version (ground truth):
@Override protected void onPreExecute(){
  Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
Program: 162110
Project: 162110
Buggy source:
@Override protected TransLocArrivalEstimates doInBackground(Void... voids){
  newView=new RemoteViews(context.getPackageName(),R.layout.widget_layout);
  SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(context);
  String url=prefs.getString("String_Node_Str" + widgetId,"String_Node_Str");
  if (url.equals("String_Node_Str"))   Log.e("String_Node_Str","String_Node_Str");
  Log.v("String_Node_Str",url);
  try {
    return new ObjectMapper().readValue(Utils.getJsonResponse(url),TransLocArrivalEstimates.class);
  }
 catch (  IOException e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
@Override protected TransLocArrivalEstimates doInBackground(Void... voids){
  newView=new RemoteViews(context.getPackageName(),R.layout.widget_layout);
  SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(context);
  String url=prefs.getString("String_Node_Str" + widgetId,"String_Node_Str");
  if (url.equals("String_Node_Str"))   Log.e("String_Node_Str","String_Node_Str");
  Log.v("String_Node_Str",url);
  try {
    return new ObjectMapper().readValue(Utils.getJsonResponse(url),TransLocArrivalEstimates.class);
  }
 catch (  IOException e) {
    e.printStackTrace();
    return null;
  }
catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}
Program: 162111
Project: 162111
Buggy source:
@Override public void onUpdate(Context context,AppWidgetManager appWidgetManager,int[] appWidgetIds){
  Log.v("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Override public void onUpdate(Context context,AppWidgetManager appWidgetManager,int[] appWidgetIds){
  Log.v("String_Node_Str","String_Node_Str");
  Log.v("String_Node_Str","String_Node_Str");
  if (widgetId != -1) {
    getJsonResponse task=new getJsonResponse(context);
    task.execute();
  }
 else {
  }
}
Program: 162112
Project: 162112
Buggy source:
protected static String getJsonResponse(String url){
  String response="String_Node_Str";
  Log.v("String_Node_Str",url);
  DefaultHttpClient client=new DefaultHttpClient();
  HttpGet httpGet=new HttpGet(url);
  try {
    HttpResponse execute=client.execute(httpGet);
    int statusCode=execute.getStatusLine().getStatusCode();
    if (statusCode != HttpStatus.SC_OK) {
      Log.e("String_Node_Str","String_Node_Str");
      throw new Exception();
    }
 else {
      InputStream content=execute.getEntity().getContent();
      BufferedReader buffer=new BufferedReader(new InputStreamReader(content));
      String s="String_Node_Str";
      while ((s=buffer.readLine()) != null) {
        response+=s;
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return response;
}

Fixed version (ground truth):
protected static String getJsonResponse(String url) throws Exception {
  String response="String_Node_Str";
  Log.v("String_Node_Str",url);
  DefaultHttpClient client=new DefaultHttpClient();
  HttpGet httpGet=new HttpGet(url);
  try {
    HttpResponse execute=client.execute(httpGet);
    int statusCode=execute.getStatusLine().getStatusCode();
    if (statusCode != HttpStatus.SC_OK) {
      Log.e("String_Node_Str","String_Node_Str");
      throw new Exception();
    }
 else {
      InputStream content=execute.getEntity().getContent();
      BufferedReader buffer=new BufferedReader(new InputStreamReader(content));
      String s="String_Node_Str";
      while ((s=buffer.readLine()) != null) {
        response+=s;
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  if (response == "String_Node_Str") {
    throw new Exception();
  }
 else {
    return response;
  }
}
Program: 162113
Project: 162113
Buggy source:
protected TransLocArrivalEstimates doInBackground(Void... voids){
  String url="String_Node_Str" + currentAgencyId + "String_Node_Str"+ currentRouteId+ "String_Node_Str"+ currentStopId;
  editor.putString("String_Node_Str" + mAppWidgetId,url).commit();
  Log.v("String_Node_Str","String_Node_Str" + url);
  try {
    return new ObjectMapper().readValue(Utils.getJsonResponse(url),TransLocArrivalEstimates.class);
  }
 catch (  IOException e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
protected TransLocArrivalEstimates doInBackground(Void... voids){
  String url="String_Node_Str" + currentAgencyId + "String_Node_Str"+ currentRouteId+ "String_Node_Str"+ currentStopId;
  editor.putString("String_Node_Str" + mAppWidgetId,url).commit();
  Log.v("String_Node_Str","String_Node_Str" + url);
  try {
    return new ObjectMapper().readValue(Utils.getJsonResponse(url),TransLocArrivalEstimates.class);
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}
Program: 162114
Project: 162114
Buggy source:
@Override protected void onPreExecute(){
}

Fixed version (ground truth):
@Override protected void onPreExecute(){
  Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
Program: 162115
Project: 162115
Buggy source:
@Override protected TransLocArrivalEstimates doInBackground(Void... voids){
  newView=new RemoteViews(context.getPackageName(),R.layout.widget_layout);
  SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(context);
  String url=prefs.getString("String_Node_Str" + widgetId,"String_Node_Str");
  if (url.equals("String_Node_Str"))   Log.e("String_Node_Str","String_Node_Str");
  Log.v("String_Node_Str",url);
  try {
    return new ObjectMapper().readValue(Utils.getJsonResponse(url),TransLocArrivalEstimates.class);
  }
 catch (  IOException e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
@Override protected TransLocArrivalEstimates doInBackground(Void... voids){
  newView=new RemoteViews(context.getPackageName(),R.layout.widget_layout);
  SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(context);
  String url=prefs.getString("String_Node_Str" + widgetId,"String_Node_Str");
  if (url.equals("String_Node_Str"))   Log.e("String_Node_Str","String_Node_Str");
  Log.v("String_Node_Str",url);
  try {
    return new ObjectMapper().readValue(Utils.getJsonResponse(url),TransLocArrivalEstimates.class);
  }
 catch (  IOException e) {
    e.printStackTrace();
    return null;
  }
catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}
Program: 162116
Project: 162116
Buggy source:
@Override public void onUpdate(Context context,AppWidgetManager appWidgetManager,int[] appWidgetIds){
  Log.v("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Override public void onUpdate(Context context,AppWidgetManager appWidgetManager,int[] appWidgetIds){
  Log.v("String_Node_Str","String_Node_Str");
  Log.v("String_Node_Str","String_Node_Str");
  if (widgetId != -1) {
    getJsonResponse task=new getJsonResponse(context);
    task.execute();
  }
 else {
  }
}
Program: 162117
Project: 162117
Buggy source:
protected static String getJsonResponse(String url){
  String response="String_Node_Str";
  Log.v("String_Node_Str",url);
  DefaultHttpClient client=new DefaultHttpClient();
  HttpGet httpGet=new HttpGet(url);
  try {
    HttpResponse execute=client.execute(httpGet);
    int statusCode=execute.getStatusLine().getStatusCode();
    if (statusCode != HttpStatus.SC_OK) {
      Log.e("String_Node_Str","String_Node_Str");
      throw new Exception();
    }
 else {
      InputStream content=execute.getEntity().getContent();
      BufferedReader buffer=new BufferedReader(new InputStreamReader(content));
      String s="String_Node_Str";
      while ((s=buffer.readLine()) != null) {
        response+=s;
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return response;
}

Fixed version (ground truth):
protected static String getJsonResponse(String url) throws Exception {
  String response="String_Node_Str";
  Log.v("String_Node_Str",url);
  DefaultHttpClient client=new DefaultHttpClient();
  HttpGet httpGet=new HttpGet(url);
  try {
    HttpResponse execute=client.execute(httpGet);
    int statusCode=execute.getStatusLine().getStatusCode();
    if (statusCode != HttpStatus.SC_OK) {
      Log.e("String_Node_Str","String_Node_Str");
      throw new Exception();
    }
 else {
      InputStream content=execute.getEntity().getContent();
      BufferedReader buffer=new BufferedReader(new InputStreamReader(content));
      String s="String_Node_Str";
      while ((s=buffer.readLine()) != null) {
        response+=s;
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  if (response == "String_Node_Str") {
    throw new Exception();
  }
 else {
    return response;
  }
}
Program: 162118
Project: 162118
Buggy source:
protected TransLocArrivalEstimates doInBackground(Void... voids){
  String url="String_Node_Str" + currentAgencyId + "String_Node_Str"+ currentRouteId+ "String_Node_Str"+ currentStopId;
  editor.putString("String_Node_Str" + mAppWidgetId,url).commit();
  Log.v("String_Node_Str","String_Node_Str" + url);
  try {
    return new ObjectMapper().readValue(Utils.getJsonResponse(url),TransLocArrivalEstimates.class);
  }
 catch (  IOException e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
protected TransLocArrivalEstimates doInBackground(Void... voids){
  String url="String_Node_Str" + currentAgencyId + "String_Node_Str"+ currentRouteId+ "String_Node_Str"+ currentStopId;
  editor.putString("String_Node_Str" + mAppWidgetId,url).commit();
  Log.v("String_Node_Str","String_Node_Str" + url);
  try {
    return new ObjectMapper().readValue(Utils.getJsonResponse(url),TransLocArrivalEstimates.class);
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}
Program: 162120
Project: 162120
Buggy source:
@Override public void onClick(View view){
  Utils.showAlertDialog(getBaseContext(),"String_Node_Str",getString(R.string.help_dialog));
}

Fixed version (ground truth):
@Override public void onClick(View view){
  Utils.showAlertDialog(WidgetConfigurationActivity.this,"String_Node_Str",getString(R.string.help_dialog));
}
Program: 162123
Project: 162123
Buggy source:
@Override public void onClick(View view){
  Utils.showAlertDialog(getBaseContext(),"String_Node_Str",getString(R.string.help_dialog));
}

Fixed version (ground truth):
@Override public void onClick(View view){
  Utils.showAlertDialog(WidgetConfigurationActivity.this,"String_Node_Str",getString(R.string.help_dialog));
}
Program: 162125
Project: 162125
Buggy source:
public void onItemSelected(AdapterView<?> parent,View view,int pos,long id){
  sSelectRoute.setEnabled(true);
  PopulateStopsTask task=new PopulateStopsTask();
  task.execute();
}

Fixed version (ground truth):
public void onItemSelected(AdapterView<?> parent,View view,int pos,long id){
  sSelectStop.setEnabled(true);
  PopulateStopsTask task=new PopulateStopsTask();
  task.execute();
}
Program: 162126
Project: 162126
Buggy source:
@Override protected void onPreExecute(){
  int position=sSelectRoute.getSelectedItemPosition();
  routeId=routeIdArray.get(position);
  Log.v("String_Node_Str","String_Node_Str" + routeId);
  routeLongNameArray.clear();
  routeIdArray.clear();
  routeShortNameArray.clear();
  stopIdArray.clear();
  stopNameArray.clear();
  stopShortNameArray.clear();
}

Fixed version (ground truth):
@Override protected void onPreExecute(){
  for (int i=0; i < routeIdArray.size(); i++) {
    Log.v("String_Node_Str",routeLongNameArray.get(i));
    Log.v("String_Node_Str",routeIdArray.get(i));
  }
  int position=sSelectRoute.getSelectedItemPosition();
  routeId=routeIdArray.get(position);
  Log.v("String_Node_Str","String_Node_Str" + routeId);
  stopIdArray.clear();
  stopNameArray.clear();
  stopShortNameArray.clear();
}
Program: 162127
Project: 162127
Buggy source:
@Override protected void onPostExecute(Void result){
  super.onPostExecute(result);
  ArrayAdapter<String> stopArrayAdapter=new ArrayAdapter<String>(getBaseContext(),android.R.layout.simple_list_item_1,stopNameArray);
  sSelectRoute.setAdapter(stopArrayAdapter);
}

Fixed version (ground truth):
@Override protected void onPostExecute(Void result){
  super.onPostExecute(result);
  ArrayAdapter<String> stopArrayAdapter=new ArrayAdapter<String>(getBaseContext(),android.R.layout.simple_list_item_1,stopNameArray);
  sSelectStop.setAdapter(stopArrayAdapter);
}
Program: 162128
Project: 162128
Buggy source:
public void onItemSelected(AdapterView<?> parent,View view,int pos,long id){
  sSelectRoute.setEnabled(true);
  PopulateStopsTask task=new PopulateStopsTask();
  task.execute();
}

Fixed version (ground truth):
public void onItemSelected(AdapterView<?> parent,View view,int pos,long id){
  sSelectStop.setEnabled(true);
  PopulateStopsTask task=new PopulateStopsTask();
  task.execute();
}
Program: 162129
Project: 162129
Buggy source:
@Override protected void onPreExecute(){
  int position=sSelectRoute.getSelectedItemPosition();
  routeId=routeIdArray.get(position);
  Log.v("String_Node_Str","String_Node_Str" + routeId);
  routeLongNameArray.clear();
  routeIdArray.clear();
  routeShortNameArray.clear();
  stopIdArray.clear();
  stopNameArray.clear();
  stopShortNameArray.clear();
}

Fixed version (ground truth):
@Override protected void onPreExecute(){
  for (int i=0; i < routeIdArray.size(); i++) {
    Log.v("String_Node_Str",routeLongNameArray.get(i));
    Log.v("String_Node_Str",routeIdArray.get(i));
  }
  int position=sSelectRoute.getSelectedItemPosition();
  routeId=routeIdArray.get(position);
  Log.v("String_Node_Str","String_Node_Str" + routeId);
  stopIdArray.clear();
  stopNameArray.clear();
  stopShortNameArray.clear();
}
Program: 162130
Project: 162130
Buggy source:
@Override protected void onPostExecute(Void result){
  super.onPostExecute(result);
  ArrayAdapter<String> stopArrayAdapter=new ArrayAdapter<String>(getBaseContext(),android.R.layout.simple_list_item_1,stopNameArray);
  sSelectRoute.setAdapter(stopArrayAdapter);
}

Fixed version (ground truth):
@Override protected void onPostExecute(Void result){
  super.onPostExecute(result);
  ArrayAdapter<String> stopArrayAdapter=new ArrayAdapter<String>(getBaseContext(),android.R.layout.simple_list_item_1,stopNameArray);
  sSelectStop.setAdapter(stopArrayAdapter);
}
Program: 162132
Project: 162132
Buggy source:
/** 
 * Creates a URL for a request to the VDisk API.
 * @param host the VDisk host (i.e., api server, content server, or web server).
 * @param apiVersion the API version to use. You should almost always use {@code VDiskAPI.VERSION} for this.
 * @param target the target path, staring with a '/'.
 * @param params any URL params in an array, with the even numbered elements the parameter names and odd numbered elements the values, e.g. <code>new String[] {"path", "/Public", "locale", "en"}</code>.
 * @return a full URL for making a request.
 */
public static String buildURL(String host,int apiVersion,String target,String[] params){
  if (!target.startsWith("String_Node_Str")) {
    target="String_Node_Str" + target;
  }
  try {
    target=URLEncoder.encode("String_Node_Str" + apiVersion + target,"String_Node_Str");
    target=target.replace("String_Node_Str","String_Node_Str");
    if (params != null && params.length > 0) {
      target+="String_Node_Str" + urlencode(params);
    }
    target=target.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
  }
 catch (  UnsupportedEncodingException uce) {
    return null;
  }
  if (!AbstractSession.NEED_HTTPS_UPLOAD) {
    return "String_Node_Str" + host + target;
  }
  return "String_Node_Str" + host + "String_Node_Str"+ target;
}

Fixed version (ground truth):
/** 
 * Creates a URL for a request to the VDisk API.
 * @param host the VDisk host (i.e., api server, content server, or web server).
 * @param apiVersion the API version to use. You should almost always use {@code VDiskAPI.VERSION} for this.
 * @param target the target path, staring with a '/'.
 * @param params any URL params in an array, with the even numbered elements the parameter names and odd numbered elements the values, e.g. <code>new String[] {"path", "/Public", "locale", "en"}</code>.
 * @return a full URL for making a request.
 */
public static String buildURL(String host,int apiVersion,String target,String[] params){
  if (!target.startsWith("String_Node_Str")) {
    target="String_Node_Str" + target;
  }
  try {
    if (apiVersion >= 1) {
      target=URLEncoder.encode("String_Node_Str" + apiVersion + target,"String_Node_Str");
    }
 else {
      target=URLEncoder.encode(target,"String_Node_Str");
    }
    target=target.replace("String_Node_Str","String_Node_Str");
    if (params != null && params.length > 0) {
      target+="String_Node_Str" + urlencode(params);
    }
    target=target.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
  }
 catch (  UnsupportedEncodingException uce) {
    return null;
  }
  if (!AbstractSession.NEED_HTTPS_UPLOAD) {
    return "String_Node_Str" + host + target;
  }
  return "String_Node_Str" + host + "String_Node_Str"+ target;
}
Program: 162135
Project: 162135
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.fragment_add_agency,container,false);
  setHasOptionsMenu(true);
  getActivity().setTitle("String_Node_Str");
  agencyListView=(ListView)rootView.findViewById(R.id.lvAgencyList);
  progressBar=(ProgressBar)getActivity().findViewById(R.id.pbLoading);
  agencyListView.setVisibility(View.INVISIBLE);
  progressBar.setVisibility(View.VISIBLE);
  TransLocClient client=ServiceGenerator.createService(TransLocClient.class,Utils.BASE_URL,TRANSLOC_API_KEY,null,AGENCY);
  client.agencies().observeOn(AndroidSchedulers.mainThread()).subscribe(this::populateAgencyListView,e -> {
    handleServiceErrors(getActivity(),AGENCY,e,progressBar);
  }
);
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.fragment_add_agency,container,false);
  setHasOptionsMenu(true);
  getActivity().setTitle("String_Node_Str");
  agencyListView=(ListView)rootView.findViewById(R.id.lvAgencyList);
  progressBar=(ProgressBar)getActivity().findViewById(R.id.pbLoading);
  agencyListView.setVisibility(View.INVISIBLE);
  progressBar.setVisibility(View.VISIBLE);
  TransLocClient client=ServiceGenerator.createService(TransLocClient.class,Utils.BASE_URL,TRANSLOC_API_KEY,null,AGENCY);
  agenciesSub=client.agencies().observeOn(AndroidSchedulers.mainThread()).subscribe(this::populateAgencyListView,e -> {
    handleServiceErrors(getActivity(),AGENCY,e,progressBar);
  }
);
  return rootView;
}
Program: 162136
Project: 162136
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.fragment_add_route,container,false);
  Bundle args=getArguments();
  if (args != null && args.containsKey("String_Node_Str")) {
    atw=(ArrivalTimeWidget)args.getSerializable("String_Node_Str");
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
  setHasOptionsMenu(true);
  getActivity().setTitle("String_Node_Str");
  routeListView=(ListView)rootView.findViewById(R.id.lvRouteList);
  progressBar=(ProgressBar)getActivity().findViewById(R.id.pbLoading);
  progressBar.setVisibility(View.VISIBLE);
  TransLocClient client=ServiceGenerator.createService(TransLocClient.class,Utils.BASE_URL,TRANSLOC_API_KEY,atw.getAgencyID(),ROUTE);
  client.routes(atw.getAgencyID()).observeOn(AndroidSchedulers.mainThread()).subscribe(this::populateRoutesListView,e -> handleServiceErrors(getActivity(),ROUTE,e,progressBar));
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.fragment_add_route,container,false);
  Bundle args=getArguments();
  if (args != null && args.containsKey("String_Node_Str")) {
    atw=(ArrivalTimeWidget)args.getSerializable("String_Node_Str");
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
  setHasOptionsMenu(true);
  getActivity().setTitle("String_Node_Str");
  routeListView=(ListView)rootView.findViewById(R.id.lvRouteList);
  progressBar=(ProgressBar)getActivity().findViewById(R.id.pbLoading);
  progressBar.setVisibility(View.VISIBLE);
  TransLocClient client=ServiceGenerator.createService(TransLocClient.class,Utils.BASE_URL,TRANSLOC_API_KEY,atw.getAgencyID(),ROUTE);
  routesSub=client.routes(atw.getAgencyID()).observeOn(AndroidSchedulers.mainThread()).subscribe(this::populateRoutesListView,e -> handleServiceErrors(getActivity(),ROUTE,e,progressBar));
  return rootView;
}
Program: 162137
Project: 162137
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.fragment_add_stop,container,false);
  Bundle args=getArguments();
  if (args != null && args.containsKey("String_Node_Str")) {
    atw=(ArrivalTimeWidget)args.getSerializable("String_Node_Str");
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
  setHasOptionsMenu(true);
  getActivity().setTitle("String_Node_Str");
  stopListView=(ListView)rootView.findViewById(R.id.lvStopList);
  progressBar=(ProgressBar)getActivity().findViewById(R.id.pbLoading);
  progressBar.setVisibility(View.VISIBLE);
  TransLocClient client=ServiceGenerator.createService(TransLocClient.class,Utils.BASE_URL,TRANSLOC_API_KEY,atw.getAgencyID(),STOP);
  client.stops(atw.getAgencyID()).observeOn(AndroidSchedulers.mainThread()).subscribe(this::populateStopsListView,e -> handleServiceErrors(getActivity(),STOP,e,progressBar));
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.fragment_add_stop,container,false);
  Bundle args=getArguments();
  if (args != null && args.containsKey("String_Node_Str")) {
    atw=(ArrivalTimeWidget)args.getSerializable("String_Node_Str");
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
  setHasOptionsMenu(true);
  getActivity().setTitle("String_Node_Str");
  stopListView=(ListView)rootView.findViewById(R.id.lvStopList);
  progressBar=(ProgressBar)getActivity().findViewById(R.id.pbLoading);
  progressBar.setVisibility(View.VISIBLE);
  TransLocClient client=ServiceGenerator.createService(TransLocClient.class,Utils.BASE_URL,TRANSLOC_API_KEY,atw.getAgencyID(),STOP);
  stopsSub=client.stops(atw.getAgencyID()).observeOn(AndroidSchedulers.mainThread()).subscribe(this::populateStopsListView,e -> handleServiceErrors(getActivity(),STOP,e,progressBar));
  return rootView;
}
Program: 162138
Project: 162138
Buggy source:
@Override public void onFragmentInteraction(String id){
  Toast.makeText(getApplicationContext(),id,Toast.LENGTH_LONG).show();
}

Fixed version (ground truth):
@Override public void onFragmentInteraction(ArrivalTimeWidget atw){
  Log.d(TAG,"String_Node_Str");
  TransLocClient client=ServiceGenerator.createService(TransLocClient.class,Utils.BASE_URL,getString(R.string.mashape_key),atw.getAgencyID(),ARRIVAL);
  client.arrivalEstimates(atw.getAgencyID(),atw.getRouteID(),atw.getStopID()).observeOn(AndroidSchedulers.mainThread()).subscribe(this::createWidget,e -> Log.e(TAG,"String_Node_Str",e));
}
Program: 162139
Project: 162139
Buggy source:
@Override public void onFragmentInteraction(String id){
  Toast.makeText(getApplicationContext(),"String_Node_Str" + id,Toast.LENGTH_LONG).show();
}

Fixed version (ground truth):
@Override public void onFragmentInteraction(ArrivalTimeWidget widget){
  Toast.makeText(getApplicationContext(),"String_Node_Str" + widget.toString(),Toast.LENGTH_LONG).show();
}
Program: 162140
Project: 162140
Buggy source:
@Override public void onListItemClick(ListView l,View v,int position,long id){
  super.onListItemClick(l,v,position,id);
  if (null != mListener) {
    ArrivalTimeWidget widget=(ArrivalTimeWidget)l.getItemAtPosition(position);
    if (widget == null)     throw new IllegalStateException();
 else {
      Log.d(TAG,widget.toString());
      mListener.onFragmentInteraction(widget.getArrivalTimesUrl());
    }
  }
}

Fixed version (ground truth):
@Override public void onListItemClick(ListView l,View v,int position,long id){
  super.onListItemClick(l,v,position,id);
  if (null != mListener) {
    ArrivalTimeWidget widget=(ArrivalTimeWidget)l.getItemAtPosition(position);
    if (widget == null)     throw new IllegalStateException();
 else {
      Log.d(TAG,widget.toString());
      mListener.onFragmentInteraction(widget);
    }
  }
}
Program: 162141
Project: 162141
Buggy source:
public void onFragmentInteraction(String id);

Fixed version (ground truth):
public void onFragmentInteraction(ArrivalTimeWidget widget);
Program: 162142
Project: 162142
Buggy source:
public T read(JsonReader in) throws IOException {
  JsonElement jsonElement=elementAdapter.read(in);
  if (jsonElement.isJsonObject()) {
    JsonObject jsonObject=jsonElement.getAsJsonObject();
    if (jsonObject.has("String_Node_Str") && (jsonObject.get("String_Node_Str").isJsonArray()) || jsonObject.get("String_Node_Str").isJsonArray()) {
switch (dataType) {
case AGENCY:
        Log.d(TAG,"String_Node_Str");
      jsonElement=jsonObject.get("String_Node_Str");
    break;
case ROUTE:
  Log.d(TAG,"String_Node_Str");
jsonElement=jsonObject.getAsJsonObject("String_Node_Str").getAsJsonArray(agencyId);
break;
case STOP:
Log.d(TAG,"String_Node_Str");
jsonElement=jsonObject.get("String_Node_Str");
break;
case ARRIVAL:
Log.d(TAG,"String_Node_Str");
jsonElement=jsonObject.getAsJsonArray("String_Node_Str").getAsJsonObject().getAsJsonArray("String_Node_Str");
break;
}
}
}
return delegate.fromJsonTree(jsonElement);
}

Fixed version (ground truth):
public T read(JsonReader in) throws IOException {
  JsonElement jsonElement=elementAdapter.read(in);
  if (jsonElement.isJsonObject()) {
    JsonObject jsonObject=jsonElement.getAsJsonObject();
    if (jsonObject.has("String_Node_Str") && (jsonObject.get("String_Node_Str").isJsonArray()) || jsonObject.get("String_Node_Str").isJsonArray()) {
switch (dataType) {
case AGENCY:
        Log.d(TAG,"String_Node_Str");
      jsonElement=jsonObject.get("String_Node_Str");
    break;
case ROUTE:
  Log.d(TAG,"String_Node_Str");
jsonElement=jsonObject.getAsJsonObject("String_Node_Str").getAsJsonArray(agencyId);
break;
case STOP:
Log.d(TAG,"String_Node_Str");
jsonElement=jsonObject.get("String_Node_Str");
break;
case ARRIVAL:
Log.d(TAG,"String_Node_Str");
jsonElement=jsonObject.getAsJsonArray("String_Node_Str").get(0).getAsJsonObject().getAsJsonArray("String_Node_Str");
break;
}
}
 else {
Log.e(TAG,"String_Node_Str");
}
}
return delegate.fromJsonTree(jsonElement);
}
Program: 162143
Project: 162143
Buggy source:
public <T>TypeAdapter<T> create(Gson gson,final TypeToken<T> type){
  final TypeAdapter<T> delegate=gson.getDelegateAdapter(this,type);
  final TypeAdapter<JsonElement> elementAdapter=gson.getAdapter(JsonElement.class);
  return new TypeAdapter<T>(){
    public void write(    JsonWriter out,    T value) throws IOException {
      delegate.write(out,value);
    }
    public T read(    JsonReader in) throws IOException {
      JsonElement jsonElement=elementAdapter.read(in);
      if (jsonElement.isJsonObject()) {
        JsonObject jsonObject=jsonElement.getAsJsonObject();
        if (jsonObject.has("String_Node_Str") && (jsonObject.get("String_Node_Str").isJsonArray()) || jsonObject.get("String_Node_Str").isJsonArray()) {
switch (dataType) {
case AGENCY:
            Log.d(TAG,"String_Node_Str");
          jsonElement=jsonObject.get("String_Node_Str");
        break;
case ROUTE:
      Log.d(TAG,"String_Node_Str");
    jsonElement=jsonObject.getAsJsonObject("String_Node_Str").getAsJsonArray(agencyId);
  break;
case STOP:
Log.d(TAG,"String_Node_Str");
jsonElement=jsonObject.get("String_Node_Str");
break;
case ARRIVAL:
Log.d(TAG,"String_Node_Str");
jsonElement=jsonObject.getAsJsonArray("String_Node_Str").getAsJsonObject().getAsJsonArray("String_Node_Str");
break;
}
}
}
return delegate.fromJsonTree(jsonElement);
}
}
.nullSafe();
}

Fixed version (ground truth):
public <T>TypeAdapter<T> create(Gson gson,final TypeToken<T> type){
  final TypeAdapter<T> delegate=gson.getDelegateAdapter(this,type);
  final TypeAdapter<JsonElement> elementAdapter=gson.getAdapter(JsonElement.class);
  return new TypeAdapter<T>(){
    public void write(    JsonWriter out,    T value) throws IOException {
      delegate.write(out,value);
    }
    public T read(    JsonReader in) throws IOException {
      JsonElement jsonElement=elementAdapter.read(in);
      if (jsonElement.isJsonObject()) {
        JsonObject jsonObject=jsonElement.getAsJsonObject();
        if (jsonObject.has("String_Node_Str") && (jsonObject.get("String_Node_Str").isJsonArray()) || jsonObject.get("String_Node_Str").isJsonArray()) {
switch (dataType) {
case AGENCY:
            Log.d(TAG,"String_Node_Str");
          jsonElement=jsonObject.get("String_Node_Str");
        break;
case ROUTE:
      Log.d(TAG,"String_Node_Str");
    jsonElement=jsonObject.getAsJsonObject("String_Node_Str").getAsJsonArray(agencyId);
  break;
case STOP:
Log.d(TAG,"String_Node_Str");
jsonElement=jsonObject.get("String_Node_Str");
break;
case ARRIVAL:
Log.d(TAG,"String_Node_Str");
jsonElement=jsonObject.getAsJsonArray("String_Node_Str").get(0).getAsJsonObject().getAsJsonArray("String_Node_Str");
break;
}
}
 else {
Log.e(TAG,"String_Node_Str");
}
}
return delegate.fromJsonTree(jsonElement);
}
}
.nullSafe();
}
Program: 162145
Project: 162145
Buggy source:
@Override public void onClick(DialogInterface dialog,int pos){
  currentStopId=currentRouteStopList.get(pos).stopId;
  stopName=currentRouteStopList.get(pos).name;
  sSelectStop.setText(stopName);
  bMakeWidget.setEnabled(true);
  Log.v("String_Node_Str","String_Node_Str");
  dialog.dismiss();
}

Fixed version (ground truth):
@Override public void onClick(DialogInterface dialog,int pos){
  currentStopId=currentRouteStopList.get(pos).stopId;
  stopName=currentRouteStopList.get(pos).name;
  sSelectStop.setText(stopName);
  bMakeWidget.setEnabled(true);
  dialog.dismiss();
}
Program: 162146
Project: 162146
Buggy source:
@Override protected void onPause(){
  super.onPause();
  if (dialog != null)   dialog.dismiss();
  dialog=null;
}

Fixed version (ground truth):
@Override protected void onPause(){
  super.onPause();
}
Program: 162147
Project: 162147
Buggy source:
@Override protected void onResume(){
  super.onResume();
  int textColor=settings.getInt("String_Node_Str",-1);
  int backgroundColor=settings.getInt("String_Node_Str",1996554497);
  editor.putInt("String_Node_Str" + mAppWidgetId,textColor).commit();
  editor.putInt("String_Node_Str" + mAppWidgetId,backgroundColor).commit();
  Log.v(TAG,Integer.toString(settings.getInt("String_Node_Str" + mAppWidgetId,-2)));
  Log.v(TAG,Integer.toString(settings.getInt("String_Node_Str" + mAppWidgetId,-2)));
  rlPreview.setBackgroundColor(backgroundColor);
  tvStopPreview.setTextColor(textColor);
  tvRoutePreview.setTextColor(textColor);
  tvRemainingTimePreview.setTextColor(textColor);
  tvMinsPreview.setTextColor(textColor);
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  int textColor=settings.getInt("String_Node_Str",-1);
  int backgroundColor=settings.getInt("String_Node_Str",1996554497);
  editor.putInt("String_Node_Str" + mAppWidgetId,textColor).commit();
  editor.putInt("String_Node_Str" + mAppWidgetId,backgroundColor).commit();
  rlPreview.setBackgroundColor(backgroundColor);
  tvStopPreview.setTextColor(textColor);
  tvRoutePreview.setTextColor(textColor);
  tvRemainingTimePreview.setTextColor(textColor);
  tvMinsPreview.setTextColor(textColor);
}
Program: 162148
Project: 162148
Buggy source:
private void doErrorMiscHandling(){
  bMakeWidget.setEnabled(false);
  if (dialog != null) {
    dialog.dismiss();
    dialog=null;
  }
}

Fixed version (ground truth):
private void doErrorMiscHandling(){
  bMakeWidget.setEnabled(false);
}
Program: 162149
Project: 162149
Buggy source:
@Override public void onClick(DialogInterface dialog,int pos){
  currentStopId=currentRouteStopList.get(pos).stopId;
  stopName=currentRouteStopList.get(pos).name;
  sSelectStop.setText(stopName);
  bMakeWidget.setEnabled(true);
  dialog.dismiss();
}

Fixed version (ground truth):
@Override public void onClick(DialogInterface dialog,int pos){
  currentStopId=currentRouteStopList.get(pos).stopId;
  stopName=currentRouteStopList.get(pos).name;
  sSelectStop.setText(stopName);
  bMakeWidget.setEnabled(true);
  Log.v("String_Node_Str","String_Node_Str");
  dialog.dismiss();
}
Program: 162150
Project: 162150
Buggy source:
private void doReset(int type){
  if (type <= 2) {
    sSelectStop.setText(R.string.select_stop);
    currentStopId=-1;
    stopName=null;
    sSelectStop.setEnabled(false);
  }
  if (type <= 1) {
    sSelectRoute.setText(R.string.select_route);
    currentRouteId=-1;
    routeShortName=null;
    routeLongName=null;
    sSelectRoute.setEnabled(false);
  }
  if (type == 0) {
    sSelectAgency.setText(R.string.select_agency);
    currentAgencyId=-1;
    bMakeWidget.setEnabled(false);
    new PopulateAgenciesTask().execute();
  }
}

Fixed version (ground truth):
private void doReset(int type){
  if (type <= 2) {
    sSelectStop.setText(R.string.select_stop);
    currentStopId=-1;
    stopName=null;
    sSelectStop.setEnabled(false);
    bMakeWidget.setEnabled(false);
  }
  if (type <= 1) {
    sSelectRoute.setText(R.string.select_route);
    currentRouteId=-1;
    routeShortName=null;
    routeLongName=null;
    sSelectRoute.setEnabled(false);
    bMakeWidget.setEnabled(false);
  }
  if (type == 0) {
    sSelectAgency.setText(R.string.select_agency);
    currentAgencyId=-1;
    bMakeWidget.setEnabled(false);
    new PopulateAgenciesTask().execute();
  }
}
Program: 162152
Project: 162152
Buggy source:
private void doReset(){
  new PopulateAgenciesTask().execute();
}

Fixed version (ground truth):
private void doReset(int type){
  if (type <= 2) {
    sSelectStop.setText(R.string.select_stop);
    currentStopId=-1;
    stopName=null;
    sSelectStop.setEnabled(false);
  }
  if (type <= 1) {
    sSelectRoute.setText(R.string.select_route);
    currentRouteId=-1;
    routeShortName=null;
    routeLongName=null;
    sSelectRoute.setEnabled(false);
  }
  if (type == 0) {
    sSelectAgency.setText(R.string.select_agency);
    currentAgencyId=-1;
    bMakeWidget.setEnabled(false);
    new PopulateAgenciesTask().execute();
  }
}
Program: 162153
Project: 162153
Buggy source:
@Override public void onClick(DialogInterface dialog,int pos){
  currentStopId=currentRouteStopList.get(pos).stopId;
  stopName=currentRouteStopList.get(pos).name;
  sSelectStop.setText(stopName);
  bMakeWidget.setEnabled(true);
  dialog.dismiss();
}

Fixed version (ground truth):
@Override public void onClick(DialogInterface dialog,int pos){
  currentStopId=currentRouteStopList.get(pos).stopId;
  stopName=currentRouteStopList.get(pos).name;
  sSelectStop.setText(stopName);
  bMakeWidget.setEnabled(true);
  Log.v("String_Node_Str","String_Node_Str");
  dialog.dismiss();
}
Program: 162154
Project: 162154
Buggy source:
private void doReset(int type){
  if (type <= 2) {
    sSelectStop.setText(R.string.select_stop);
    currentStopId=-1;
    stopName=null;
    sSelectStop.setEnabled(false);
  }
  if (type <= 1) {
    sSelectRoute.setText(R.string.select_route);
    currentRouteId=-1;
    routeShortName=null;
    routeLongName=null;
    sSelectRoute.setEnabled(false);
  }
  if (type == 0) {
    sSelectAgency.setText(R.string.select_agency);
    currentAgencyId=-1;
    bMakeWidget.setEnabled(false);
    new PopulateAgenciesTask().execute();
  }
}

Fixed version (ground truth):
private void doReset(int type){
  if (type <= 2) {
    sSelectStop.setText(R.string.select_stop);
    currentStopId=-1;
    stopName=null;
    sSelectStop.setEnabled(false);
    bMakeWidget.setEnabled(false);
  }
  if (type <= 1) {
    sSelectRoute.setText(R.string.select_route);
    currentRouteId=-1;
    routeShortName=null;
    routeLongName=null;
    sSelectRoute.setEnabled(false);
    bMakeWidget.setEnabled(false);
  }
  if (type == 0) {
    sSelectAgency.setText(R.string.select_agency);
    currentAgencyId=-1;
    bMakeWidget.setEnabled(false);
    new PopulateAgenciesTask().execute();
  }
}
Program: 162156
Project: 162156
Buggy source:
@Override public void onClick(DialogInterface dialog,int pos){
  currentStopId=currentRouteStopList.get(pos).stopId;
  stopName=currentRouteStopList.get(pos).name;
  sSelectStop.setText(stopName);
  bMakeWidget.setEnabled(true);
  Log.v("String_Node_Str","String_Node_Str");
  dialog.dismiss();
}

Fixed version (ground truth):
@Override public void onClick(DialogInterface dialog,int pos){
  currentStopId=currentRouteStopList.get(pos).stopId;
  stopName=currentRouteStopList.get(pos).name;
  sSelectStop.setText(stopName);
  bMakeWidget.setEnabled(true);
  dialog.dismiss();
}
Program: 162157
Project: 162157
Buggy source:
@Override protected void onPause(){
  super.onPause();
  if (dialog != null)   dialog.dismiss();
  dialog=null;
}

Fixed version (ground truth):
@Override protected void onPause(){
  super.onPause();
}
Program: 162158
Project: 162158
Buggy source:
@Override protected void onResume(){
  super.onResume();
  int textColor=settings.getInt("String_Node_Str",-1);
  int backgroundColor=settings.getInt("String_Node_Str",1996554497);
  editor.putInt("String_Node_Str" + mAppWidgetId,textColor).commit();
  editor.putInt("String_Node_Str" + mAppWidgetId,backgroundColor).commit();
  Log.v(TAG,Integer.toString(settings.getInt("String_Node_Str" + mAppWidgetId,-2)));
  Log.v(TAG,Integer.toString(settings.getInt("String_Node_Str" + mAppWidgetId,-2)));
  rlPreview.setBackgroundColor(backgroundColor);
  tvStopPreview.setTextColor(textColor);
  tvRoutePreview.setTextColor(textColor);
  tvRemainingTimePreview.setTextColor(textColor);
  tvMinsPreview.setTextColor(textColor);
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  int textColor=settings.getInt("String_Node_Str",-1);
  int backgroundColor=settings.getInt("String_Node_Str",1996554497);
  editor.putInt("String_Node_Str" + mAppWidgetId,textColor).commit();
  editor.putInt("String_Node_Str" + mAppWidgetId,backgroundColor).commit();
  rlPreview.setBackgroundColor(backgroundColor);
  tvStopPreview.setTextColor(textColor);
  tvRoutePreview.setTextColor(textColor);
  tvRemainingTimePreview.setTextColor(textColor);
  tvMinsPreview.setTextColor(textColor);
}
Program: 162159
Project: 162159
Buggy source:
private void doErrorMiscHandling(){
  bMakeWidget.setEnabled(false);
  if (dialog != null) {
    dialog.dismiss();
    dialog=null;
  }
}

Fixed version (ground truth):
private void doErrorMiscHandling(){
  bMakeWidget.setEnabled(false);
}
Program: 162161
Project: 162161
Buggy source:
private void doReset(){
  new PopulateAgenciesTask().execute();
}

Fixed version (ground truth):
private void doReset(int type){
  if (type <= 2) {
    sSelectStop.setText(R.string.select_stop);
    currentStopId=-1;
    stopName=null;
    sSelectStop.setEnabled(false);
  }
  if (type <= 1) {
    sSelectRoute.setText(R.string.select_route);
    currentRouteId=-1;
    routeShortName=null;
    routeLongName=null;
    sSelectRoute.setEnabled(false);
  }
  if (type == 0) {
    sSelectAgency.setText(R.string.select_agency);
    currentAgencyId=-1;
    bMakeWidget.setEnabled(false);
    new PopulateAgenciesTask().execute();
  }
}