nus-yam/ex-repair huggingface dataset:
Program: 153081
Project: 153081
Buggy source:
public void onClick(View v){
  FLog.d("String_Node_Str");
  Intent intent=new Intent();
  Catalog activity=(Catalog)getContext();
  try {
    FutabaThreadContent thread=item;
    if (!activity.mode.equals("String_Node_Str")) {
      thread.baseUrl=activity.baseUrl;
    }
    Calendar calendar=Calendar.getInstance();
    thread.lastAccessed=calendar.getTimeInMillis();
    HistoryManager man=new HistoryManager();
    man.Load();
    int maxHistoryNum=5;
    try {
      SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(activity);
      maxHistoryNum=Integer.parseInt(preferences.getString(activity.getString(R.string.historynum),"String_Node_Str"));
    }
 catch (    Exception e) {
      FLog.d("String_Node_Str",e);
    }
    man.addThread(thread,maxHistoryNum);
    man.Save();
  }
 catch (  Exception e) {
    FLog.d("String_Node_Str",e);
  }
  if (!activity.mode.equals("String_Node_Str")) {
    String baseUrl=activity.baseUrl;
    intent.putExtra("String_Node_Str",baseUrl);
    FLog.d("String_Node_Str");
  }
 else {
    String baseUrl=item.baseUrl;
    intent.putExtra("String_Node_Str",baseUrl);
    FLog.d("String_Node_Str");
  }
  intent.putExtra("String_Node_Str",threadNum);
  intent.setClassName(activity.getPackageName(),activity.getClass().getPackage().getName() + "String_Node_Str");
  activity.startActivity(intent);
}

Fixed version (ground truth):
public void onClick(View v){
  FLog.d("String_Node_Str");
  Intent intent=new Intent();
  Catalog activity=(Catalog)getContext();
  try {
    FutabaThreadContent thread=item;
    if (!activity.mode.equals("String_Node_Str")) {
      thread.baseUrl=activity.baseUrl;
    }
    Calendar calendar=Calendar.getInstance();
    thread.lastAccessed=calendar.getTimeInMillis();
    HistoryManager man=new HistoryManager();
    man.Load();
    int maxHistoryNum=5;
    try {
      SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(activity);
      maxHistoryNum=Integer.parseInt(preferences.getString(activity.getString(R.string.historynum),"String_Node_Str"));
    }
 catch (    Exception e) {
      FLog.d("String_Node_Str",e);
    }
    FLog.d("String_Node_Str" + maxHistoryNum);
    FLog.d("String_Node_Str" + thread.toString());
    man.addThread(thread,maxHistoryNum);
    man.Save();
  }
 catch (  Exception e) {
    FLog.d("String_Node_Str",e);
  }
  if (!activity.mode.equals("String_Node_Str")) {
    String baseUrl=activity.baseUrl;
    intent.putExtra("String_Node_Str",baseUrl);
    FLog.d("String_Node_Str");
  }
 else {
    String baseUrl=item.baseUrl;
    intent.putExtra("String_Node_Str",baseUrl);
    FLog.d("String_Node_Str");
  }
  intent.putExtra("String_Node_Str",threadNum);
  intent.setClassName(activity.getPackageName(),activity.getClass().getPackage().getName() + "String_Node_Str");
  activity.startActivity(intent);
}
Program: 153083
Project: 153083
Buggy source:
public static String createDigest(String source){
  FLog.d("String_Node_Str" + source + "String_Node_Str"+ isHTMLName(source));
  MessageDigest md;
  try {
    md=MessageDigest.getInstance("String_Node_Str");
  }
 catch (  Exception e) {
    FLog.d("String_Node_Str",e);
    return "String_Node_Str";
  }
  byte[] data=source.getBytes();
  md.update(data);
  byte[] digest=md.digest();
  StringBuilder sb=new StringBuilder();
  for (int i=0; i < digest.length; i++) {
    sb.append(Integer.toHexString(0xff & digest[i]));
  }
  if (FutabaCrypt.isHTMLName(source)) {
    return sb.toString() + "String_Node_Str";
  }
  return sb.toString();
}

Fixed version (ground truth):
public static String createDigest(String source){
  MessageDigest md;
  try {
    md=MessageDigest.getInstance("String_Node_Str");
  }
 catch (  Exception e) {
    FLog.d("String_Node_Str",e);
    return "String_Node_Str";
  }
  byte[] data=source.getBytes();
  md.update(data);
  byte[] digest=md.digest();
  StringBuilder sb=new StringBuilder();
  for (int i=0; i < digest.length; i++) {
    sb.append(Integer.toHexString(0xff & digest[i]));
  }
  if (FutabaCrypt.isHTMLName(source)) {
    return sb.toString() + "String_Node_Str";
  }
  return sb.toString();
}
Program: 153084
Project: 153084
Buggy source:
public void run(){
  adapter.items.clear();
  for (int i=0; i < statuses_ref.size(); ++i) {
    FLog.d(statuses_ref.get(i).toString());
    adapter.items.add(statuses_ref.get(i));
  }
  Toast.makeText(adapter.getContext(),toast_text_f,Toast.LENGTH_SHORT).show();
  setTitle(title);
  waitDialog.dismiss();
  adapter.notifyDataSetChanged();
  listView.invalidate();
  if (position != 0) {
    listView.setSelectionFromTop(Math.min(position,listView.getCount()),positionY);
  }
}

Fixed version (ground truth):
public void run(){
  adapter.items.clear();
  for (int i=0; i < statuses_ref.size(); ++i) {
    adapter.items.add(statuses_ref.get(i));
  }
  Toast.makeText(adapter.getContext(),toast_text_f,Toast.LENGTH_SHORT).show();
  setTitle(title);
  waitDialog.dismiss();
  adapter.notifyDataSetChanged();
  listView.invalidate();
  if (position != 0) {
    listView.setSelectionFromTop(Math.min(position,listView.getCount()),positionY);
  }
}
Program: 153085
Project: 153085
Buggy source:
public void Load(){
  try {
    if (SDCard.existSeriarized(OPT_HISTORY)) {
      threads=(TreeMap<Integer,FutabaThreadContent>)SDCard.getSerialized(OPT_HISTORY).readObject();
    }
  }
 catch (  Exception e) {
    FLog.d("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void Load(){
  try {
    if (SDCard.existSeriarized(OPT_HISTORY)) {
      threads=(LinkedHashMap<Integer,FutabaThreadContent>)SDCard.getSerialized(OPT_HISTORY).readObject();
    }
  }
 catch (  Exception e) {
    FLog.d("String_Node_Str",e);
  }
}
Program: 153086
Project: 153086
Buggy source:
public void addThread(FutabaThreadContent thread,int maxHistoryNum){
  if (!threads.containsKey(thread.threadNum)) {
    threads.put(thread.threadNum,thread);
  }
 else {
    threads.put(thread.threadNum,thread);
  }
  FLog.d("String_Node_Str" + maxHistoryNum);
  if (threads.size() > maxHistoryNum) {
    threads.remove(threads.lastKey());
  }
}

Fixed version (ground truth):
public void addThread(FutabaThreadContent thread,int maxHistoryNum){
  if (!threads.containsKey(thread.threadNum)) {
    threads.put(thread.threadNum,thread);
  }
 else {
    threads.put(thread.threadNum,thread);
  }
  FLog.d("String_Node_Str" + maxHistoryNum);
  if (threads.size() > maxHistoryNum) {
    for (    Object key : threads.keySet()) {
      threads.remove(key);
      break;
    }
  }
}
Program: 153087
Project: 153087
Buggy source:
public void clear(){
  threads=new TreeMap<Integer,FutabaThreadContent>();
}

Fixed version (ground truth):
public void clear(){
  threads=new LinkedHashMap<Integer,FutabaThreadContent>();
}
Program: 153088
Project: 153088
Buggy source:
public static String getCacheDir(){
  String sdcard_dir=Environment.getExternalStorageDirectory().getPath();
  FLog.d("String_Node_Str" + sdcard_dir);
  String cacheDir=sdcard_dir + "String_Node_Str";
  File file=new File(cacheDir);
  file.mkdir();
  return cacheDir;
}

Fixed version (ground truth):
public static String getCacheDir(){
  String sdcard_dir=Environment.getExternalStorageDirectory().getPath();
  String cacheDir=sdcard_dir + "String_Node_Str";
  File file=new File(cacheDir);
  file.mkdir();
  return cacheDir;
}
Program: 153089
Project: 153089
Buggy source:
public void onClickGridViewBtn(View v){
  FLog.d("String_Node_Str");
  Intent intent=new Intent();
  ArrayList<String> thumbURLs=getThumbURLs();
  int pos=listView.getFirstVisiblePosition();
  int imagepos=0;
  for (int i=0; i <= pos; ++i) {
    FutabaStatus status=(FutabaStatus)adapter.items.get(i);
    if (status.imgURL != null && !status.imgURL.equals("String_Node_Str")) {
      imagepos++;
    }
  }
  intent.putExtra("String_Node_Str",imagepos);
  intent.putExtra("String_Node_Str",getImageURLs());
  intent.putExtra("String_Node_Str",thumbURLs);
  intent.setClassName(getPackageName(),getClass().getPackage().getName() + "String_Node_Str");
  startActivity(intent);
}

Fixed version (ground truth):
public void onClickGridViewBtn(View v){
  FLog.d("String_Node_Str");
  Intent intent=new Intent();
  ArrayList<String> thumbURLs=getThumbURLs();
  if (thumbURLs.size() == 0) {
    return;
  }
  int pos=listView.getFirstVisiblePosition();
  int imagepos=0;
  for (int i=0; i <= pos; ++i) {
    FutabaStatus status=(FutabaStatus)adapter.items.get(i);
    if (status.imgURL != null && !status.imgURL.equals("String_Node_Str")) {
      imagepos++;
    }
  }
  imagepos=Math.max(0,imagepos - 1);
  intent.putExtra("String_Node_Str",imagepos);
  intent.putExtra("String_Node_Str",getImageURLs());
  intent.putExtra("String_Node_Str",thumbURLs);
  intent.setClassName(getPackageName(),getClass().getPackage().getName() + "String_Node_Str");
  startActivity(intent);
}
Program: 153091
Project: 153091
Buggy source:
public void registerShiori(int position){
  try {
    if (position == 0) {
      Toast.makeText(this,"String_Node_Str",Toast.LENGTH_SHORT).show();
    }
 else {
      HistoryManager man=new HistoryManager();
      man.Load();
      FutabaThreadContent thread=new FutabaThreadContent();
      thread.pointAt=position;
      thread.threadNum=threadNum;
      FLog.d(thread.toString());
      man.updateThread(thread);
      man.Save();
      View view=listView.getChildAt(0);
      adapter.shioriPosition=position;
      adapter.setShioriStatus(view);
      adapter.notifyDataSetChanged();
      listView.invalidate();
      Toast.makeText(this,"String_Node_Str",Toast.LENGTH_SHORT).show();
    }
  }
 catch (  Exception e) {
    FLog.d("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void registerShiori(int position){
  try {
    if (position == 0) {
      Toast.makeText(this,"String_Node_Str",Toast.LENGTH_SHORT).show();
    }
 else {
      FutabaStatus item=(FutabaStatus)adapter.items.get(position);
      if (FutabaStatus.isBlank(item)) {
        position+=1;
        item=(FutabaStatus)adapter.items.get(position);
      }
      HistoryManager man=new HistoryManager();
      man.Load();
      FutabaThreadContent thread=new FutabaThreadContent();
      thread.pointAt=item.id;
      thread.threadNum=threadNum;
      FLog.d(thread.toString());
      man.updateThread(thread);
      man.Save();
      View view=listView.getChildAt(0);
      adapter.shioriPosition=item.id;
      adapter.setShioriStatus(view);
      adapter.notifyDataSetChanged();
      listView.invalidate();
      Toast.makeText(this,"String_Node_Str",Toast.LENGTH_SHORT).show();
    }
  }
 catch (  Exception e) {
    FLog.d("String_Node_Str",e);
  }
}
Program: 153094
Project: 153094
Buggy source:
public void modifyShiori(View view){
  if (currentPosition == fthread.adapter.shioriPosition) {
    fthread.removeShiori(currentPosition);
  }
 else {
    fthread.registerShiori(currentPosition);
  }
}

Fixed version (ground truth):
public void modifyShiori(View view){
  FutabaStatus item=(FutabaStatus)fthread.adapter.items.get(currentPosition);
  if (item.id == fthread.adapter.shioriPosition) {
    fthread.removeShiori(currentPosition);
  }
 else {
    fthread.registerShiori(currentPosition);
  }
}
Program: 153096
Project: 153096
Buggy source:
private void loading(){
  Intent intent=getIntent();
  baseUrl=(String)intent.getSerializableExtra("String_Node_Str");
  BBSName=(String)intent.getSerializableExtra("String_Node_Str");
  mode=(String)intent.getSerializableExtra("String_Node_Str");
  catalogURL=baseUrl + "String_Node_Str";
  setContentView(R.layout.futaba_catalog);
  listView=(ListView)findViewById(id.cataloglistview);
  adapter=new CatalogAdapter(this,R.layout.futaba_catalog_row,fthreads);
  listView.setAdapter(adapter);
  new Thread(new Runnable(){
    public void run(){
      handler2.post(new FutabaCatalogContentGetter());
    }
  }
).start();
}

Fixed version (ground truth):
private void loading(){
  Intent intent=getIntent();
  baseUrl=(String)intent.getSerializableExtra("String_Node_Str");
  BBSName=(String)intent.getSerializableExtra("String_Node_Str");
  mode=(String)intent.getSerializableExtra("String_Node_Str");
  catalogURL=baseUrl + "String_Node_Str";
  setContentView(R.layout.futaba_catalog);
  listView=(ListView)findViewById(id.cataloglistview);
  adapter=new CatalogAdapter(this,R.layout.futaba_catalog_row,fthreads);
  adapter.items.clear();
  listView.setAdapter(adapter);
  new Thread(new Runnable(){
    public void run(){
      handler2.post(new FutabaCatalogContentGetter());
    }
  }
).start();
}
Program: 153097
Project: 153097
Buggy source:
private void loading(){
  statuses=new ArrayList<FutabaStatus>();
  setContentView(R.layout.futaba_thread);
  listView=(ListView)findViewById(id.threadlistview);
  adapter=new FutabaThreadAdapter(this,R.layout.futaba_thread_row,statuses);
  listView.setAdapter(adapter);
  FutabaThreadContentGetter getterThread=new FutabaThreadContentGetter();
  getterThread.start();
}

Fixed version (ground truth):
private void loading(){
  statuses=new ArrayList<FutabaStatus>();
  setContentView(R.layout.futaba_thread);
  listView=(ListView)findViewById(id.threadlistview);
  adapter=new FutabaThreadAdapter(this,R.layout.futaba_thread_row,statuses);
  adapter.items.clear();
  listView.setAdapter(adapter);
  FutabaThreadContentGetter getterThread=new FutabaThreadContentGetter();
  getterThread.start();
}
Program: 153098
Project: 153098
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Intent intent=getIntent();
  baseURL=(String)intent.getSerializableExtra("String_Node_Str");
  threadNum=(String)intent.getSerializableExtra("String_Node_Str");
  threadURL=baseURL + threadNum;
  Log.d("String_Node_Str","String_Node_Str" + threadURL);
  setWait();
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Intent intent=getIntent();
  baseURL=(String)intent.getSerializableExtra("String_Node_Str");
  threadNum=(String)intent.getSerializableExtra("String_Node_Str");
  threadURL=baseURL + threadNum;
  Log.d("String_Node_Str","String_Node_Str" + threadURL);
  statuses=new ArrayList<FutabaStatus>();
  setContentView(R.layout.futaba_thread);
  listView=(ListView)findViewById(id.threadlistview);
  adapter=new FutabaThreadAdapter(this,R.layout.futaba_thread_row,statuses);
  listView.setAdapter(adapter);
  setWait();
}
Program: 153099
Project: 153099
Buggy source:
public void run(){
  Toast.makeText(adapter.getContext(),toast_text_f,Toast.LENGTH_SHORT).show();
  setTitle(title);
  waitDialog.dismiss();
  adapter.notifyDataSetChanged();
  listView.invalidate();
}

Fixed version (ground truth):
public void run(){
  Toast.makeText(adapter.getContext(),toast_text_f,Toast.LENGTH_SHORT).show();
  setTitle(title);
  waitDialog.dismiss();
  adapter.notifyDataSetChanged();
  listView.invalidate();
  if (position != 0) {
    listView.setSelectionFromTop(Math.min(position,listView.getCount()),positionY);
  }
}
Program: 153100
Project: 153100
Buggy source:
private void loading(){
  statuses=new ArrayList<FutabaStatus>();
  setContentView(R.layout.futaba_thread);
  listView=(ListView)findViewById(id.threadlistview);
  adapter=new FutabaThreadAdapter(this,R.layout.futaba_thread_row,statuses);
  listView.setAdapter(adapter);
  FutabaThreadContentGetter getterThread=new FutabaThreadContentGetter();
  getterThread.start();
}

Fixed version (ground truth):
private void loading(){
  FutabaThreadContentGetter getterThread=new FutabaThreadContentGetter();
  getterThread.start();
}
Program: 153101
Project: 153101
Buggy source:
public void onClickDeleteBtn(View v){
  final CharSequence[] items={"String_Node_Str","String_Node_Str"};
  AlertDialog.Builder dlg;
  dlg=new AlertDialog.Builder(Catalog.this);
  dlg.setTitle("String_Node_Str");
  dlg.setCancelable(true);
  dlg.setSingleChoiceItems(items,0,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int item){
      Catalog.this.delete_option=item;
    }
  }
);
  dlg.setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int id){
      Catalog.this.deleteThreads();
    }
  }
);
  dlg.setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int id){
    }
  }
);
  dlg.show();
}

Fixed version (ground truth):
public void onClickDeleteBtn(View v){
  final CharSequence[] items={"String_Node_Str","String_Node_Str","String_Node_Str"};
  AlertDialog.Builder dlg;
  dlg=new AlertDialog.Builder(Catalog.this);
  dlg.setTitle("String_Node_Str");
  dlg.setCancelable(true);
  dlg.setSingleChoiceItems(items,0,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int item){
      Catalog.this.delete_option=item;
    }
  }
);
  dlg.setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int id){
      Catalog.this.deleteThreads();
    }
  }
);
  dlg.setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int id){
    }
  }
);
  dlg.show();
}
Program: 153102
Project: 153102
Buggy source:
public void deleteThreads(){
  try {
    ListView listView=(ListView)findViewById(id.cataloglistview);
    Log.d("String_Node_Str","String_Node_Str" + delete_option);
    if (delete_option == DELETE_CHECKED) {
      for (int i=listView.getChildCount() - 1; i >= 0; --i) {
        View view=listView.getChildAt(i);
        CheckBox checkbox=(CheckBox)view.findViewById(R.id.checkbox);
        if (checkbox.isChecked()) {
          Log.d("String_Node_Str","String_Node_Str" + i);
          adapter.items.remove(i);
        }
      }
    }
 else     if (delete_option == DELETE_NONCHECKED) {
      for (int i=listView.getChildCount() - 1; i >= 0; --i) {
        View view=listView.getChildAt(i);
        CheckBox checkbox=(CheckBox)view.findViewById(R.id.checkbox);
        if (!checkbox.isChecked()) {
          Log.d("String_Node_Str","String_Node_Str" + i);
          adapter.items.remove(i);
        }
      }
    }
    HistoryManager man=new HistoryManager();
    man.set(adapter.items);
    man.Save();
    adapter.notifyDataSetChanged();
    listView.invalidateViews();
  }
 catch (  Exception e) {
    Log.i("String_Node_Str","String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void deleteThreads(){
  try {
    ListView listView=(ListView)findViewById(id.cataloglistview);
    Log.d("String_Node_Str","String_Node_Str" + listView.getCount());
    Log.d("String_Node_Str","String_Node_Str" + delete_option);
    int firstPosition=listView.getFirstVisiblePosition();
    if (delete_option == DELETE_CHECKED) {
      for (int i=listView.getChildCount() - 1; i >= 0; --i) {
        View view=listView.getChildAt(i);
        if (view != null) {
          CheckBox checkbox=(CheckBox)view.findViewById(R.id.checkbox);
          if (checkbox.isChecked()) {
            Log.d("String_Node_Str","String_Node_Str" + i);
            adapter.items.remove(i + firstPosition);
          }
        }
      }
    }
 else     if (delete_option == DELETE_NONCHECKED) {
      for (int i=listView.getChildCount() - 1; i >= 0; --i) {
        View view=listView.getChildAt(i);
        if (view != null) {
          CheckBox checkbox=(CheckBox)view.findViewById(R.id.checkbox);
          if (!checkbox.isChecked()) {
            Log.d("String_Node_Str","String_Node_Str" + i);
            adapter.items.remove(i + firstPosition);
          }
        }
      }
    }
 else     if (delete_option == DELETE_ALL) {
      adapter.items.clear();
    }
    HistoryManager man=new HistoryManager();
    man.set(adapter.items);
    man.Save();
    adapter.notifyDataSetChanged();
    listView.invalidateViews();
  }
 catch (  Exception e) {
    Log.i("String_Node_Str","String_Node_Str",e);
  }
}
Program: 153103
Project: 153103
Buggy source:
public void deleteThreads(){
  try {
    ListView listView=(ListView)findViewById(id.cataloglistview);
    Log.d("String_Node_Str","String_Node_Str" + listView.getCount());
    Log.d("String_Node_Str","String_Node_Str" + delete_option);
    if (delete_option == DELETE_ALL) {
      adapter.items.clear();
    }
 else {
      if (delete_option == DELETE_CHECKED) {
        for (int i=adapter.items.size() - 1; i >= 0; --i) {
          Log.d("String_Node_Str","String_Node_Str" + i + "String_Node_Str"+ adapter.items.get(i).isChecked);
          if (adapter.items.get(i).isChecked) {
            adapter.items.remove(i);
          }
        }
      }
 else {
        for (int i=adapter.items.size() - 1; i >= 0; --i) {
          if (!adapter.items.get(i).isChecked) {
            adapter.items.remove(i);
          }
        }
      }
    }
    HistoryManager man=new HistoryManager();
    man.set(adapter.items);
    man.Save();
    adapter.notifyDataSetChanged();
    listView.invalidateViews();
  }
 catch (  Exception e) {
    Log.i("String_Node_Str","String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void deleteThreads(){
  try {
    ListView listView=(ListView)findViewById(id.cataloglistview);
    Log.d("String_Node_Str","String_Node_Str" + listView.getCount());
    Log.d("String_Node_Str","String_Node_Str" + delete_option);
    if (delete_option == DELETE_ALL) {
      adapter.items.clear();
    }
 else {
      if (delete_option == DELETE_CHECKED) {
        for (int i=adapter.items.size() - 1; i >= 0; --i) {
          Log.d("String_Node_Str","String_Node_Str" + i + "String_Node_Str"+ adapter.items.get(i).isChecked);
          if (adapter.items.get(i).isChecked) {
            adapter.items.remove(i);
          }
 else {
            adapter.items.get(i).isChecked=false;
          }
        }
      }
 else {
        for (int i=adapter.items.size() - 1; i >= 0; --i) {
          if (!adapter.items.get(i).isChecked) {
            adapter.items.remove(i);
          }
 else {
            adapter.items.get(i).isChecked=false;
          }
        }
      }
    }
    HistoryManager man=new HistoryManager();
    man.set(adapter.items);
    man.Save();
    adapter.notifyDataSetChanged();
    listView.invalidateViews();
  }
 catch (  Exception e) {
    Log.i("String_Node_Str","String_Node_Str",e);
  }
}
Program: 153104
Project: 153104
Buggy source:
public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  Log.d("String_Node_Str","String_Node_Str" + pos + "String_Node_Str"+ isChecked);
  if (buttonView.isShown()) {
    items.get(pos).isChecked=isChecked;
  }
}

Fixed version (ground truth):
public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  Log.d("String_Node_Str","String_Node_Str" + buttonView.isShown());
  Log.d("String_Node_Str","String_Node_Str" + pos + "String_Node_Str"+ isChecked);
  if (buttonView.isShown()) {
    items.get(pos).isChecked=isChecked;
  }
}
Program: 153107
Project: 153107
Buggy source:
public void zoomImageToWindow(){
  if (bm.getWidth() < width && bm.getHeight() < height) {
    bx=bm.getWidth();
    by=bm.getHeight();
  }
 else {
    float scale=Math.min((float)width / (float)bm.getWidth(),(float)height / (float)bm.getHeight());
    Log.d("String_Node_Str","String_Node_Str" + scale);
    matrix.setScale(scale,scale);
    bx=bm.getWidth() * scale;
    by=bm.getHeight() * scale;
  }
  float[] values=new float[9];
  matrix.getValues(values);
  values[Matrix.MTRANS_X]=(width - bx) / 2;
  values[Matrix.MTRANS_Y]=(height - by) / 2;
  matrix.setValues(values);
}

Fixed version (ground truth):
public void zoomImageToWindow(){
  if (bm.getWidth() < width && bm.getHeight() < height) {
    matrix.setScale(1f,1f);
    bx=bm.getWidth();
    by=bm.getHeight();
  }
 else {
    float scale=Math.min((float)width / (float)bm.getWidth(),(float)height / (float)bm.getHeight());
    Log.d("String_Node_Str","String_Node_Str" + scale);
    matrix.setScale(scale,scale);
    bx=bm.getWidth() * scale;
    by=bm.getHeight() * scale;
  }
  float[] values=new float[9];
  matrix.getValues(values);
  values[Matrix.MTRANS_X]=(width - bx) / 2;
  values[Matrix.MTRANS_Y]=(height - by) / 2;
  matrix.setValues(values);
}
Program: 153108
Project: 153108
Buggy source:
public void parse(){
  try {
    Pattern BBSPattern=Pattern.compile("String_Node_Str",Pattern.DOTALL);
    String allData="String_Node_Str";
    try {
      SDCard.saveFromURL(FutabaCrypt.createDigest(urlStr),new URL(urlStr),true);
      allData=SDCard.loadTextCache(FutabaCrypt.createDigest(urlStr));
    }
 catch (    Exception e) {
      Log.d("String_Node_Str","String_Node_Str");
      network_ok=false;
      if (SDCard.cacheExist(FutabaCrypt.createDigest(urlStr))) {
        Log.d("String_Node_Str","String_Node_Str");
        allData=SDCard.loadTextCache(FutabaCrypt.createDigest(urlStr));
      }
 else {
        cache_ok=false;
      }
    }
    Matcher mcBBS=BBSPattern.matcher(allData);
    while (mcBBS.find()) {
      FutabaBBS bbs=new FutabaBBS();
      bbs.url=mcBBS.group(1);
      bbs.name=mcBBS.group(2);
      BBSs.add(bbs);
    }
  }
 catch (  Exception e) {
    Log.i("String_Node_Str","String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void parse(){
  try {
    Pattern BBSPattern=Pattern.compile("String_Node_Str",Pattern.DOTALL);
    String allData="String_Node_Str";
    try {
      SDCard.saveFromURL(FutabaCrypt.createDigest(urlStr),new URL(urlStr),true);
      allData=SDCard.loadTextCache(FutabaCrypt.createDigest(urlStr));
      network_ok=true;
    }
 catch (    Exception e) {
      Log.d("String_Node_Str","String_Node_Str");
      network_ok=false;
      if (SDCard.cacheExist(FutabaCrypt.createDigest(urlStr))) {
        Log.d("String_Node_Str","String_Node_Str");
        allData=SDCard.loadTextCache(FutabaCrypt.createDigest(urlStr));
      }
 else {
        cache_ok=false;
      }
    }
    Matcher mcBBS=BBSPattern.matcher(allData);
    while (mcBBS.find()) {
      FutabaBBS bbs=new FutabaBBS();
      bbs.url=mcBBS.group(1);
      bbs.name=mcBBS.group(2);
      BBSs.add(bbs);
    }
  }
 catch (  Exception e) {
    Log.i("String_Node_Str","String_Node_Str",e);
  }
}
Program: 153111
Project: 153111
Buggy source:
public static void setImage(String url){
  String urlHash=FutabaCrypt.createDigest(url);
  try {
    SDCard.saveFromURL(urlHash,new URL(url),true);
  }
 catch (  Exception e) {
    Log.i("String_Node_Str","String_Node_Str",e);
  }
}

Fixed version (ground truth):
public static boolean setImage(String url){
  String urlHash=FutabaCrypt.createDigest(url);
  try {
    SDCard.saveFromURL(urlHash,new URL(url),true);
    return true;
  }
 catch (  Exception e) {
    Log.d("String_Node_Str","String_Node_Str",e);
  }
  return false;
}
Program: 153112
Project: 153112
Buggy source:
@Override protected Bitmap doInBackground(String... urls){
  Bitmap bm=null;
  try {
    Log.d("String_Node_Str","String_Node_Str" + urls[0]);
    bm=ImageCache.getImage(urls[0]);
    if (bm == null) {
      ImageCache.setImage(urls[0]);
      bm=ImageCache.getImage(urls[0]);
    }
  }
 catch (  Exception e) {
    Log.i("String_Node_Str","String_Node_Str",e);
  }
  return bm;
}

Fixed version (ground truth):
@Override protected Bitmap doInBackground(String... urls){
  Bitmap bm=null;
  try {
    Log.d("String_Node_Str","String_Node_Str" + urls[0]);
    bm=ImageCache.getImage(urls[0]);
    if (bm == null) {
      boolean network_result=ImageCache.setImage(urls[0]);
      if (!network_result) {
        Toast.makeText(getContext(),"String_Node_Str" + "String_Node_Str",Toast.LENGTH_SHORT).show();
      }
      bm=ImageCache.getImage(urls[0]);
    }
  }
 catch (  Exception e) {
    Log.i("String_Node_Str","String_Node_Str",e);
  }
  return bm;
}
Program: 153113
Project: 153113
Buggy source:
@Override protected Bitmap doInBackground(String... urls){
  Bitmap bm=ImageCache.getImage(urls[0]);
  Log.d("String_Node_Str","String_Node_Str");
  while (bm == null) {
    try {
      HttpGet httpRequest=new HttpGet(new URI(urls[0]));
      HttpClient httpclient=new DefaultHttpClient();
      HttpResponse response=(HttpResponse)httpclient.execute(httpRequest);
      HttpEntity entity=response.getEntity();
      BufferedHttpEntity bufHttpEntity=new BufferedHttpEntity(entity);
      InputStream is=bufHttpEntity.getContent();
      if (is != null) {
        Log.d("String_Node_Str","String_Node_Str");
      }
      bm=BitmapFactory.decodeStream(is);
      if (bm == null) {
        Log.d("String_Node_Str","String_Node_Str");
      }
 else {
        Log.d("String_Node_Str",String.valueOf(bm.getWidth()) + "String_Node_Str" + String.valueOf(bm.getHeight()));
      }
      float s_x=Math.max(1.0f,(float)bm.getWidth() / (float)width);
      float s_y=Math.max(1.0f,(float)bm.getHeight() / (float)height);
      float scale=Math.max(s_x,s_y);
      int new_x=(int)(bm.getWidth() / scale);
      int new_y=(int)(bm.getHeight() / scale);
      bm=Bitmap.createScaledBitmap(bm,new_x,new_y,true);
      ImageCache.setImage(urls[0],bm);
    }
 catch (    Exception e) {
      Log.i("String_Node_Str","String_Node_Str",e);
      Log.d("String_Node_Str","String_Node_Str" + urls[0]);
      try {
        Thread.sleep(1 * 1000);
      }
 catch (      Exception e2) {
        Log.i("String_Node_Str","String_Node_Str",e2);
      }
    }
  }
  return bm;
}

Fixed version (ground truth):
@Override protected Bitmap doInBackground(String... urls){
  Bitmap bm=ImageCache.getImage(urls[0]);
  Log.d("String_Node_Str","String_Node_Str");
  if (bm == null) {
synchronized (FutabaAdapter.lock) {
      try {
        URL imgURL=new URL(urls[0]);
        InputStream is=imgURL.openStream();
        bm=BitmapFactory.decodeStream(is);
        if (bm == null) {
          return null;
        }
        float s_x=Math.max(1.0f,(float)bm.getWidth() / (float)width);
        float s_y=Math.max(1.0f,(float)bm.getHeight() / (float)height);
        float scale=Math.max(s_x,s_y);
        int new_x=(int)(bm.getWidth() / scale);
        int new_y=(int)(bm.getHeight() / scale);
        bm=Bitmap.createScaledBitmap(bm,new_x,new_y,true);
        ImageCache.setImage(urls[0],bm);
      }
 catch (      Exception e) {
        Log.i("String_Node_Str","String_Node_Str",e);
        Log.d("String_Node_Str","String_Node_Str" + urls[0]);
        try {
          Thread.sleep(1 * 1000);
        }
 catch (        Exception e2) {
          Log.i("String_Node_Str","String_Node_Str",e2);
        }
      }
    }
  }
  return bm;
}
Program: 153114
Project: 153114
Buggy source:
@Override protected void onPostExecute(Bitmap result){
  Log.d("String_Node_Str","String_Node_Str" + tag + "String_Node_Str"+ image.getTag().toString());
  if (tag.equals(image.getTag())) {
    image.setImageBitmap(result);
    if (true) {
      image.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          Log.d("String_Node_Str","String_Node_Str");
          Intent intent=new Intent();
          fthread activity=(fthread)getContext();
          intent.putExtra("String_Node_Str",activity.getImageURLs());
          intent.putExtra("String_Node_Str",tag);
          intent.setClassName(activity.getPackageName(),activity.getClass().getPackage().getName() + "String_Node_Str");
          activity.startActivity(intent);
        }
      }
);
    }
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(Bitmap result){
  Log.d("String_Node_Str","String_Node_Str" + tag + "String_Node_Str"+ image.getTag().toString());
  if (tag.equals(image.getTag())) {
    if (result == null) {
      TextView screenName=(TextView)image.findViewById(R.id.toptext);
      if (screenName != null) {
        screenName.setText("String_Node_Str");
      }
      return;
    }
    image.setImageBitmap(result);
    if (true) {
      image.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          Log.d("String_Node_Str","String_Node_Str");
          Intent intent=new Intent();
          fthread activity=(fthread)getContext();
          intent.putExtra("String_Node_Str",activity.getImageURLs());
          intent.putExtra("String_Node_Str",tag);
          intent.setClassName(activity.getPackageName(),activity.getClass().getPackage().getName() + "String_Node_Str");
          activity.startActivity(intent);
        }
      }
);
    }
  }
}
Program: 153117
Project: 153117
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Intent intent=getIntent();
  String threadURL="String_Node_Str" + (String)intent.getSerializableExtra("String_Node_Str");
  Log.d("String_Node_Str","String_Node_Str" + threadURL);
  statuses=new ArrayList<FutabaStatus>();
  FutabaThreadParser parser=new FutabaThreadParser(threadURL);
  parser.parse();
  statuses=parser.getStatuses();
  Log.d("String_Node_Str","String_Node_Str");
  adapter=new FutabaAdapter(this,R.layout.futaba_row,statuses);
  setListAdapter(adapter);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  try {
    Intent intent=getIntent();
    String threadURL="String_Node_Str" + (String)intent.getSerializableExtra("String_Node_Str");
    Log.d("String_Node_Str","String_Node_Str" + threadURL);
    statuses=new ArrayList<FutabaStatus>();
    FutabaThreadParser parser=new FutabaThreadParser(threadURL);
    parser.parse();
    statuses=parser.getStatuses();
    Log.d("String_Node_Str","String_Node_Str");
    adapter=new FutabaAdapter(this,R.layout.futaba_row,statuses);
    setListAdapter(adapter);
  }
 catch (  Exception e) {
    Log.i("String_Node_Str","String_Node_Str",e);
  }
}
Program: 153118
Project: 153118
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  View view=convertView;
  FutabaThread item=(FutabaThread)items.get(position);
  final String threadNum=item.getThreadNum();
  if (view == null) {
    view=inflater.inflate(R.layout.futaba_catalog_row,null);
    view.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        Log.d("String_Node_Str","String_Node_Str");
        Intent intent=new Intent();
        Activity activity=(Activity)getContext();
        intent.putExtra("String_Node_Str",threadNum);
        intent.setClassName(activity.getPackageName(),activity.getClass().getPackage().getName() + "String_Node_Str");
        activity.startActivity(intent);
      }
    }
);
  }
  Bitmap bm=null;
  ImageView iv=(ImageView)view.findViewById(R.id.image);
  iv.setImageBitmap(bm);
  if (item != null) {
    TextView text=(TextView)view.findViewById(R.id.bottomtext);
    try {
      if (item.getImgURL() != null) {
        iv.setTag(item.getImgURL());
        ImageGetTask task=new ImageGetTask(iv);
        task.execute(item.getImgURL());
      }
 else {
      }
    }
 catch (    Exception e) {
      Log.d("String_Node_Str",e.toString());
    }
    if (text != null) {
      text.setText(item.getText());
    }
  }
  return view;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  View view=convertView;
  FutabaThread item=(FutabaThread)items.get(position);
  final String threadNum=item.getThreadNum();
  if (view == null) {
    view=inflater.inflate(R.layout.futaba_catalog_row,null);
  }
  if (true) {
    view.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        Log.d("String_Node_Str","String_Node_Str");
        Intent intent=new Intent();
        Activity activity=(Activity)getContext();
        intent.putExtra("String_Node_Str",threadNum);
        intent.setClassName(activity.getPackageName(),activity.getClass().getPackage().getName() + "String_Node_Str");
        activity.startActivity(intent);
      }
    }
);
  }
  Bitmap bm=null;
  ImageView iv=(ImageView)view.findViewById(R.id.image);
  iv.setImageBitmap(bm);
  if (item != null) {
    TextView text=(TextView)view.findViewById(R.id.bottomtext);
    try {
      if (item.getImgURL() != null) {
        iv.setTag(item.getImgURL());
        ImageGetTask task=new ImageGetTask(iv);
        task.execute(item.getImgURL());
      }
 else {
      }
    }
 catch (    Exception e) {
      Log.d("String_Node_Str",e.toString());
    }
    if (text != null) {
      text.setText(item.getText());
    }
  }
  return view;
}
Program: 153119
Project: 153119
Buggy source:
@Override protected void onPostExecute(Bitmap result){
  Log.d("String_Node_Str","String_Node_Str" + tag + "String_Node_Str"+ image.getTag().toString());
  if (tag.equals(image.getTag())) {
    image.doDraw();
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(Bitmap result){
  Log.d("String_Node_Str","String_Node_Str" + tag + "String_Node_Str"+ image.getTag().toString());
  if (tag.equals(image.getTag())) {
    if (image) {
      image.doDraw();
    }
  }
}
Program: 153120
Project: 153120
Buggy source:
@Override protected Bitmap doInBackground(URLs... urls){
  URL imgURL=urls[0];
  Bitmap bm=ImageCache.getImage(imgURL);
  if (bm == null) {
    InputStream is=imgURL.openStream();
    Bitmap bm=BitmapFactory.decodeStream(is);
    float s_x=Math.max(1.0f,(float)bm.getWidth() / (float)Math.min(width,height));
    float s_y=Math.max(1.0f,(float)bm.getHeight() / (float)Math.min(width,height));
    float scale=Math.max(s_x,s_y);
    int new_x=(int)(bm.getWidth() / scale);
    int new_y=(int)(bm.getHeight() / scale);
    bm=Bitmap.createScaledBitmap(bm,new_x,new_y,false);
    ImageCache.setImage(imgURL,bm);
  }
  return bm;
}

Fixed version (ground truth):
@Override protected Bitmap doInBackground(String... urls){
  Bitmap bm=ImageCache.getImage(urls[0]);
  if (bm == null) {
    try {
      URL imgURL=new URL(urls[0]);
      InputStream is=imgURL.openStream();
      bm=BitmapFactory.decodeStream(is);
      float s_x=Math.max(1.0f,(float)bm.getWidth() / (float)Math.min(width,height));
      float s_y=Math.max(1.0f,(float)bm.getHeight() / (float)Math.min(width,height));
      float scale=Math.max(s_x,s_y);
      int new_x=(int)(bm.getWidth() / scale);
      int new_y=(int)(bm.getHeight() / scale);
      bm=Bitmap.createScaledBitmap(bm,new_x,new_y,false);
      ImageCache.setImage(urls[0],bm);
    }
 catch (    Exception e) {
      Log.d("String_Node_Str",e.toString());
    }
  }
  return bm;
}
Program: 153121
Project: 153121
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  View view=convertView;
  if (view == null) {
    view=inflater.inflate(R.layout.futaba_row,null);
  }
  FutabaStatus item=(FutabaStatus)items.get(position);
  if (item != null) {
    TextView screenName=(TextView)view.findViewById(R.id.toptext);
    screenName.setTypeface(Typeface.DEFAULT_BOLD);
    TextView text=(TextView)view.findViewById(R.id.bottomtext);
    if (screenName != null) {
      screenName.setText("String_Node_Str");
    }
    try {
      URL imgURL=new URL(item.getImgURL());
      if (item.getImgURL() != "String_Node_Str") {
        ImageView iv=(ImageView)view.findViewById(R.id.image);
        GetImageTask task=new GetImageTask(iv);
        task.execute(imgURL);
        screenName.setText("String_Node_Str");
      }
 else {
      }
    }
 catch (    Exception e) {
      Log.d("String_Node_Str",e.toString());
    }
    if (text != null) {
      text.setText(item.getText());
    }
  }
  return view;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  View view=convertView;
  if (view == null) {
    view=inflater.inflate(R.layout.futaba_row,null);
  }
  FutabaStatus item=(FutabaStatus)items.get(position);
  if (item != null) {
    TextView screenName=(TextView)view.findViewById(R.id.toptext);
    screenName.setTypeface(Typeface.DEFAULT_BOLD);
    TextView text=(TextView)view.findViewById(R.id.bottomtext);
    if (screenName != null) {
      screenName.setText("String_Node_Str");
    }
    try {
      if (item.getImgURL() != "String_Node_Str") {
        ImageView iv=(ImageView)view.findViewById(R.id.image);
        ImageGetTask task=new ImageGetTask(iv);
        task.execute(item.getImgURL());
        screenName.setText("String_Node_Str");
      }
 else {
      }
    }
 catch (    Exception e) {
      Log.d("String_Node_Str",e.toString());
    }
    if (text != null) {
      text.setText(item.getText());
    }
  }
  return view;
}
Program: 153122
Project: 153122
Buggy source:
public FutabaCatalogParser(String urlStr){
  this.urlStr=urlStr;
  title="String_Node_Str";
  statuses=new ArrayList<FutabaThread>();
}

Fixed version (ground truth):
public FutabaCatalogParser(String urlStr){
  this.urlStr=urlStr;
  title="String_Node_Str";
  fthreads=new ArrayList<FutabaThread>();
}
Program: 153124
Project: 153124
Buggy source:
public void setMonitoredResource(Resource<?> monitoredResource){
  this.monitoredResource=monitoredResource;
  loaded=monitoredResource.isLoaded();
  unloaded=!loaded;
}

Fixed version (ground truth):
public void setMonitoredResource(Resource<?> monitoredResource){
  this.monitoredResource=monitoredResource;
  loaded=monitoredResource.isLoaded();
  wasLoaded=false;
  wasUnloaded=false;
}
Program: 153125
Project: 153125
Buggy source:
/** 
 * Returns true whenever the Resource was loaded.
 */
public boolean wasUnloaded(){
  return unloaded;
}

Fixed version (ground truth):
/** 
 * Returns true whenever the Resource was loaded.
 */
public boolean wasUnloaded(){
  return wasUnloaded;
}
Program: 153126
Project: 153126
Buggy source:
/** 
 * Returns true whenever the Resource was loaded.
 */
public boolean wasLoaded(){
  return loaded;
}

Fixed version (ground truth):
/** 
 * Returns true whenever the Resource was loaded.
 */
public boolean wasLoaded(){
  return wasLoaded;
}
Program: 153127
Project: 153127
Buggy source:
/** 
 * Call to update the monitor by checking the Resource latest status and to know if it was loaded or unloaded.
 */
public void checkChanges(){
  loaded=!loaded && monitoredResource.isLoaded();
  unloaded=!unloaded && !monitoredResource.isLoaded();
}

Fixed version (ground truth):
/** 
 * Call to update the monitor by checking the Resource latest status and to know if it was loaded or unloaded.
 */
public void checkChanges(){
  wasLoaded=!loaded && monitoredResource.isLoaded();
  wasUnloaded=loaded && !monitoredResource.isLoaded();
  loaded=monitoredResource.isLoaded();
}
Program: 153128
Project: 153128
Buggy source:
@Test public void shouldDetectWhenResourceWasLoadedOnlyOnce(){
  MockResource resource=new MockResource(new MockDataLoader("String_Node_Str"));
  ResourceStatusMonitor resourceStatusMonitor=new ResourceStatusMonitor(resource);
  resource.load();
  resourceStatusMonitor.checkChanges();
  resourceStatusMonitor.checkChanges();
  assertThat(resourceStatusMonitor.wasLoaded(),IsEqual.equalTo(false));
}

Fixed version (ground truth):
@Test public void shouldDetectWhenResourceWasLoadedOnlyOnce(){
  MockResource resource=new MockResource(new MockDataLoader("String_Node_Str"));
  ResourceStatusMonitor resourceStatusMonitor=new ResourceStatusMonitor(resource);
  resource.load();
  resourceStatusMonitor.checkChanges();
  resourceStatusMonitor.checkChanges();
  assertThat(resourceStatusMonitor.wasLoaded(),IsEqual.equalTo(false));
  resourceStatusMonitor.checkChanges();
  assertThat(resourceStatusMonitor.wasLoaded(),IsEqual.equalTo(false));
}
Program: 153129
Project: 153129
Buggy source:
@Test public void shouldDetectWhenResourceWasUnloadedOnlyOnce(){
  MockResource resource=new MockResource(new MockDataLoader("String_Node_Str"));
  resource.load();
  ResourceStatusMonitor resourceStatusMonitor=new ResourceStatusMonitor(resource);
  resource.unload();
  resourceStatusMonitor.checkChanges();
  resourceStatusMonitor.checkChanges();
  assertThat(resourceStatusMonitor.wasUnloaded(),IsEqual.equalTo(false));
}

Fixed version (ground truth):
@Test public void shouldDetectWhenResourceWasUnloadedOnlyOnce(){
  MockResource resource=new MockResource(new MockDataLoader("String_Node_Str"));
  resource.load();
  ResourceStatusMonitor resourceStatusMonitor=new ResourceStatusMonitor(resource);
  resource.unload();
  resourceStatusMonitor.checkChanges();
  resourceStatusMonitor.checkChanges();
  assertThat(resourceStatusMonitor.wasUnloaded(),IsEqual.equalTo(false));
  resourceStatusMonitor.checkChanges();
  assertThat(resourceStatusMonitor.wasUnloaded(),IsEqual.equalTo(false));
}
Program: 153130
Project: 153130
Buggy source:
@Override public void unloadAll(){
  for (int i=0; i < resources.size(); i++)   resources.get(i).unload();
}

Fixed version (ground truth):
@Override public void unloadAll(){
  for (  Resource resource : resources)   resource.unload();
}
Program: 153135
Project: 153135
Buggy source:
/** 
 * Method to get an array of recorded body weights within a date range Used for graphing purposes
 * @param (String from) - start of date range
 * @param (String to) - end of date range
 * @return - list of weights from biometrics
 */
public double[] returnWeightRange(String from,String to){
}

Fixed version (ground truth):
/** 
 * Method to get an array of recorded body weights within a date range Used for graphing purposes
 * @param (String from) - start of date range
 * @param (String to) - end of date range
 * @return - list of weights from biometrics
 */
public double[] returnWeightRange(String from,String to){
  LinkedList<Biometric> resultList=getBIOsFromTo(from,to);
  double[] weights=new double[resultList.size()];
  for (int i=0; i < resultList.size(); i++) {
    weights[i]=resultList.get(i).getWeight();
  }
  return weights;
}
Program: 153139
Project: 153139
Buggy source:
/** 
 * Method to convert date from MMDDYY to MM/DD/YY
 * @return - date (MM/DD/YY)
 */
public String toDate(){
  String newDate="String_Node_Str";
  newDate+=date.charAt(0) + date.charAt(1) + "String_Node_Str";
  newDate+=date.charAt(2) + date.charAt(3) + "String_Node_Str";
  newDate+=date.charAt(4) + date.charAt(5);
  return newDate;
}

Fixed version (ground truth):
/** 
 * Method to convert date from MMDDYY to MM/DD/YYYY
 * @return - date (MM/DD/YYYY)
 */
public String toDate(){
  String newDate="String_Node_Str";
  newDate+=date.substring(0,2) + "String_Node_Str";
  newDate+=date.substring(2,4) + "String_Node_Str";
  newDate+=date.substring(4,8);
  return newDate;
}
Program: 153140
Project: 153140
Buggy source:
/** 
 * Method to autotag info stored in Biometrics
 * @return - true if autotag was successful, false otherwise
 */
public boolean autoTag(){
  if (tags.add(Double.toString(weight)) && tags.add(Double.toString(bodyFat)) && tags.add(Double.toString(heartRate))&& tags.add(Double.toString(bMI))&& tags.add(date)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Method to autotag info stored in Biometrics
 * @return - true if autotag was successful, false otherwise
 */
public boolean autoTag(){
  if (tags.add(Double.toString(weight)) && tags.add(Double.toString(bodyFat)) && tags.add(Double.toString(heartRate))&& tags.add(Double.toString(bMI))&& tags.add(date.toDate())) {
    return true;
  }
  return false;
}