nus-yam/ex-repair huggingface dataset:
Program: 37743
Project: 37743
Buggy source:
public void filter(String string){
  if (sT9Search == null)   return;
  if (TextUtils.isEmpty(string)) {
    apps=getRecentApps();
    mAppsAdapter=new AppsAdapter(apps);
    setAdapter(mAppsAdapter);
    mAppsAdapter.notifyDataSetChanged();
    return;
  }
  T9SearchResult result=sT9Search.search(string);
  if (result != null) {
    apps=sT9Search.search(string).getResults();
    mAppsAdapter=new AppsAdapter(apps);
    setAdapter(mAppsAdapter);
    mAppsAdapter.notifyDataSetChanged();
  }
}

Fixed version (ground truth):
public void filter(String string){
  mFilterStr=string;
  if (sT9Search == null)   return;
  if (TextUtils.isEmpty(string)) {
    apps=getRecentApps();
    mAppsAdapter=new AppsAdapter(apps);
    setAdapter(mAppsAdapter);
    mAppsAdapter.notifyDataSetChanged();
    return;
  }
  T9SearchResult result=sT9Search.search(string);
  if (result != null) {
    apps=sT9Search.search(string).getResults();
    mAppsAdapter=new AppsAdapter(apps);
    setAdapter(mAppsAdapter);
    mAppsAdapter.notifyDataSetChanged();
  }
}
Program: 37744
Project: 37744
Buggy source:
public ArrayList<ApplicationItem> getRecentApps(){
  List<RecentTaskInfo> recentTasks=mActivityManager.getRecentTasks(9,ActivityManager.RECENT_IGNORE_UNAVAILABLE | ActivityManager.RECENT_WITH_EXCLUDED);
  ArrayList<ApplicationItem> recents=new ArrayList<ApplicationItem>();
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str" + recentTasks);
  }
  if (recentTasks != null) {
    for (    RecentTaskInfo recentInfo : recentTasks) {
      try {
        if (DEBUG) {
          Log.d(TAG,"String_Node_Str" + recentInfo.baseIntent.getComponent().getPackageName());
        }
        ApplicationInfo info=mPackageManager.getApplicationInfo(recentInfo.baseIntent.getComponent().getPackageName(),0);
        boolean added=false;
        for (        ApplicationItem tmp : recents) {
          if (tmp.packageName.equals(info.packageName))           added=true;
        }
        if (!added) {
          ApplicationItem item=new ApplicationItem();
          item.name=info.loadLabel(mPackageManager).toString();
          item.packageName=info.packageName;
          item.drawable=info.loadIcon(mPackageManager);
          recents.add(item);
        }
      }
 catch (      NameNotFoundException e) {
        Log.e(TAG,"String_Node_Str",e);
      }
    }
  }
  return recents;
}

Fixed version (ground truth):
public ArrayList<ApplicationItem> getRecentApps(){
  List<RecentTaskInfo> recentTasks=mActivityManager.getRecentTasks(9,ActivityManager.RECENT_IGNORE_UNAVAILABLE | ActivityManager.RECENT_WITH_EXCLUDED);
  ArrayList<ApplicationItem> recents=new ArrayList<ApplicationItem>();
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str" + recentTasks);
  }
  if (recentTasks != null) {
    for (    RecentTaskInfo recentInfo : recentTasks) {
      try {
        if (DEBUG) {
          Log.d(TAG,"String_Node_Str" + recentInfo.baseIntent.getComponent().getPackageName());
        }
        ApplicationInfo info=mPackageManager.getApplicationInfo(recentInfo.baseIntent.getComponent().getPackageName(),0);
        if (mPackageManager.getLaunchIntentForPackage(info.packageName) == null)         continue;
        boolean added=false;
        for (        ApplicationItem tmp : recents) {
          if (tmp.packageName.equals(info.packageName))           added=true;
        }
        if (!added) {
          ApplicationItem item=new ApplicationItem();
          item.name=info.loadLabel(mPackageManager).toString();
          item.packageName=info.packageName;
          item.drawable=info.loadIcon(mPackageManager);
          recents.add(item);
        }
      }
 catch (      NameNotFoundException e) {
        Log.e(TAG,"String_Node_Str",e);
      }
    }
  }
  return recents;
}
Program: 37745
Project: 37745
Buggy source:
public T9SearchResult search(String number){
  mNameResults.clear();
  number=removeNonDigits(number);
  int pos=0;
  boolean newQuery=mPrevInput == null || number.length() <= mPrevInput.length();
  for (  ApplicationItem item : (newQuery ? mApps : mAllResults)) {
    item.nameMatchId=-1;
    pos=item.pinyinNum.indexOf(number);
    if (pos != -1) {
      int last_space=item.pinyinNum.lastIndexOf("String_Node_Str",pos);
      if (last_space == -1) {
        last_space=0;
      }
      item.nameMatchId=pos - last_space;
      mNameResults.add(item);
    }
  }
  mAllResults.clear();
  mPrevInput=number;
  if (mNameResults.size() > 0) {
    mAllResults.addAll(mNameResults);
    return new T9SearchResult(new ArrayList<ApplicationItem>(mAllResults),mContext);
  }
  return null;
}

Fixed version (ground truth):
public T9SearchResult search(String number){
  mNameResults.clear();
  int pos=0;
  boolean newQuery=mPrevInput == null || number.length() <= mPrevInput.length();
  for (  ApplicationItem item : (newQuery ? mApps : mAllResults)) {
    pos=item.pinyinNum.indexOf(number);
    if (pos != -1) {
      mNameResults.add(item);
    }
    pos=item.fullpinyinNum.indexOf(number);
    if (pos != -1) {
      mNameResults.add(item);
    }
  }
  mAllResults.clear();
  mPrevInput=number;
  if (mNameResults.size() > 0) {
    mAllResults.addAll(mNameResults);
    return new T9SearchResult(new ArrayList<ApplicationItem>(mAllResults),mContext);
  }
  return null;
}
Program: 37746
Project: 37746
Buggy source:
private void getAll(){
  if (sT9Map == null)   initT9Map();
  mApplications=new ArrayList<ApplicationInfo>();
  mApplications.addAll(mPackageManager.getInstalledApplications(0));
  for (  ApplicationInfo appinfo : mApplications) {
    if (mPackageManager.getLaunchIntentForPackage(appinfo.packageName) == null)     continue;
    ApplicationItem appitem=new ApplicationItem();
    appitem.name=appinfo.loadLabel(mPackageManager).toString();
    appitem.pinyinNum=ToPinYinUtils.getPinyinNum(appitem.name);
    appitem.packageName=appinfo.packageName;
    appitem.drawable=appinfo.loadIcon(mPackageManager);
    mApps.add(appitem);
  }
}

Fixed version (ground truth):
private void getAll(){
  if (sT9Map == null)   initT9Map();
  mApplications=new ArrayList<ApplicationInfo>();
  mApplications.addAll(mPackageManager.getInstalledApplications(0));
  for (  ApplicationInfo appinfo : mApplications) {
    if (mPackageManager.getLaunchIntentForPackage(appinfo.packageName) == null)     continue;
    ApplicationItem appitem=new ApplicationItem();
    appitem.name=appinfo.loadLabel(mPackageManager).toString();
    appitem.pinyinNum=ToPinYinUtils.getPinyinNum(appitem.name,false);
    appitem.fullpinyinNum=ToPinYinUtils.getPinyinNum(appitem.name,true);
    appitem.packageName=appinfo.packageName;
    appitem.drawable=appinfo.loadIcon(mPackageManager);
    mApps.add(appitem);
  }
}
Program: 37747
Project: 37747
Buggy source:
@SuppressLint("String_Node_Str") public static String getPinyinNum(String name){
  try {
    if (name != null && name.length() != 0) {
      int len=name.length();
      StringBuilder sb=new StringBuilder();
      for (int i=0; i < len; i++) {
        String tmp=name.substring(i);
        char c=tmp.charAt(0);
        if (c <= '9' && c >= '0') {
          sb.append(c);
        }
 else {
          sb.append(getOneNumFromAlpha(ToPinYinUtils.getPinYin(tmp).toLowerCase().charAt(0)));
        }
      }
      return sb.toString();
    }
  }
 catch (  BadHanyuPinyinOutputFormatCombination e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") public static String getPinyinNum(String name,boolean full){
  try {
    if (name != null && name.length() != 0) {
      int len=name.length();
      StringBuilder sb=new StringBuilder();
      for (int i=0; i < len; i++) {
        String tmp=name.substring(i);
        char c=tmp.charAt(0);
        if (c <= '9' && c >= '0') {
          sb.append(c);
        }
 else {
          if (full) {
            String pinyin=ToPinYinUtils.getPinYin(tmp).toLowerCase();
            for (int j=0; j < pinyin.length(); j++) {
              sb.append(getOneNumFromAlpha(pinyin.charAt(j)));
            }
          }
 else {
            sb.append(getOneNumFromAlpha(ToPinYinUtils.getPinYin(tmp).toLowerCase().charAt(0)));
          }
        }
      }
      return sb.toString();
    }
  }
 catch (  BadHanyuPinyinOutputFormatCombination e) {
    e.printStackTrace();
  }
  return null;
}
Program: 37748
Project: 37748
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  addPreferencesFromResource(R.xml.preference);
  prefs=getPreferenceScreen().getSharedPreferences();
  updateJsonData();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  addPreferencesFromResource(R.xml.preference);
  prefs=getPreferenceScreen().getSharedPreferences();
  updateX2oolsPrefs();
}
Program: 37749
Project: 37749
Buggy source:
@Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,String key){
  if (key.equals(KEY_WECHAT_SCAN)) {
    Intent intent=new Intent(ACTION_WECHAT_SCAN_CHANGED);
    intent.putExtra(KEY_WECHAT_SCAN,sharedPreferences.getBoolean(KEY_WECHAT_SCAN,false));
    sendBroadcast(intent);
  }
  updateJsonData();
}

Fixed version (ground truth):
@Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,String key){
  if (key.equals(KEY_WECHAT_SCAN)) {
    Intent intent=new Intent(ACTION_WECHAT_SCAN_CHANGED);
    intent.putExtra(KEY_WECHAT_SCAN,sharedPreferences.getBoolean(KEY_WECHAT_SCAN,false));
    sendBroadcast(intent);
  }
  updateX2oolsPrefs();
}
Program: 37750
Project: 37750
Buggy source:
/** 
 * This is the main loop run by each Being of Middle-Earth who wants to gaze into a Palantir.
 */
public void run(){
  for (int i=0; i < mMaxPalantirSessions; ++i) {
    System.out.println(Thread.currentThread().getName() + "String_Node_Str");
    mFairnessChecker.addNewThread(Thread.currentThread().getName());
    Palantir palantir=mPalantirManager.acquirePalantir();
    if (!mFairnessChecker.checkOrder(Thread.currentThread().getName()))     System.out.println(Thread.currentThread().getName() + "String_Node_Str");
    long activeThreads=mActiveThreads.getAndIncrement();
    if (mMaxActiveThreads < activeThreads) {
      System.out.println("String_Node_Str" + activeThreads);
      throw new RuntimeException();
    }
    System.out.println(Thread.currentThread().getName() + "String_Node_Str");
    palantir.gaze();
    System.out.println(Thread.currentThread().getName() + "String_Node_Str");
    mPalantirManager.releasePalantir(palantir);
    System.out.println(Thread.currentThread().getName() + "String_Node_Str");
    mActiveThreads.decrementAndGet();
  }
}

Fixed version (ground truth):
/** 
 * This is the main loop run by each Being of Middle-Earth who wants to gaze into a Palantir.
 */
public void run(){
  for (int i=0; i < mMaxPalantirSessions; ++i) {
    System.out.println(Thread.currentThread().getName() + "String_Node_Str");
    mFairnessChecker.addNewThread(Thread.currentThread().getName());
    Palantir palantir=mPalantirManager.acquirePalantir();
    if (!mFairnessChecker.checkOrder(Thread.currentThread().getName()))     System.out.println(Thread.currentThread().getName() + "String_Node_Str");
    long activeThreads=mActiveThreads.getAndIncrement();
    if (mMaxActiveThreads < activeThreads) {
      System.out.println("String_Node_Str" + activeThreads);
      throw new RuntimeException();
    }
    System.out.println(Thread.currentThread().getName() + "String_Node_Str");
    palantir.gaze();
    mActiveThreads.decrementAndGet();
    System.out.println(Thread.currentThread().getName() + "String_Node_Str");
    mPalantirManager.releasePalantir(palantir);
    System.out.println(Thread.currentThread().getName() + "String_Node_Str");
  }
}
Program: 37751
Project: 37751
Buggy source:
/** 
 * @brief Atomically increments by one the current value
 * @returns the previous value
 */
public long getAndIncrement(){
  long value=0;
  return value;
}

Fixed version (ground truth):
/** 
 * @brief Atomically increments by one the current value
 * @returns the previous value
 */
public long getAndIncrement(){
  long value;
  return value;
}
Program: 37752
Project: 37752
Buggy source:
/** 
 * @brief Atomically increments by one the current value
 * @returns the updated value
 */
public long incrementAndGet(){
  long value=0;
  return value;
}

Fixed version (ground truth):
/** 
 * @brief Atomically increments by one the current value
 * @returns the updated value
 */
public long incrementAndGet(){
  long value;
  return value;
}
Program: 37753
Project: 37753
Buggy source:
/** 
 * Creates a new SimpleAtomicLong with the given initial value.
 */
public SimpleAtomicLong(long initialValue){
  long value=0;
}

Fixed version (ground truth):
/** 
 * Creates a new SimpleAtomicLong with the given initial value.
 */
public SimpleAtomicLong(long initialValue){
}
Program: 37754
Project: 37754
Buggy source:
/** 
 * @brief Gets the current value.
 * @returns The current value
 */
public long get(){
  long value=0;
  return value;
}

Fixed version (ground truth):
/** 
 * @brief Gets the current value.
 * @returns The current value
 */
public long get(){
  long value;
  return value;
}
Program: 37755
Project: 37755
Buggy source:
/** 
 * @brief Atomically decrements by one the current value
 * @returns the updated value
 */
public long decrementAndGet(){
  long value=0;
  return value;
}

Fixed version (ground truth):
/** 
 * @brief Atomically decrements by one the current value
 * @returns the updated value
 */
public long decrementAndGet(){
  long value;
  return value;
}
Program: 37756
Project: 37756
Buggy source:
/** 
 * @brief Atomically decrements by one the current value
 * @returns the previous value
 */
public long getAndDecrement(){
  long value=0;
  return value;
}

Fixed version (ground truth):
/** 
 * @brief Atomically decrements by one the current value
 * @returns the previous value
 */
public long getAndDecrement(){
  long value;
  return value;
}
Program: 37757
Project: 37757
Buggy source:
/** 
 * Returns the tuple descriptor (schema) of the specified table
 * @param tableid The id of the table, as specified by the DbFile.getId()function passed to addTable
 * @throws NoSuchElementException if the table doesn't exist
 */
public TupleDesc getTupleDesc(int tableid) throws NoSuchElementException {
  Table match=this.IdHash.get(tableid);
  if (match == null) {
    throw NoSuchElementException;
  }
 else {
    DbFile file=match.getDbFile();
    return file.getTupleDesc();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the tuple descriptor (schema) of the specified table
 * @param tableid The id of the table, as specified by the DbFile.getId()function passed to addTable
 * @throws NoSuchElementException if the table doesn't exist
 */
public TupleDesc getTupleDesc(int tableid) throws NoSuchElementException {
  Table match=this.IdHash.get(tableid);
  if (match == null) {
    throw new NoSuchElementException();
  }
 else {
    DbFile file=match.getDbFile();
    return file.getTupleDesc();
  }
}
Program: 37758
Project: 37758
Buggy source:
/** 
 * Constructor. Creates a new, empty catalog.
 */
public Catalog(){
  this.NameHash=new HashMap<String,Integer>();
  this.IdHash=new HashMap<String,Integer>();
}

Fixed version (ground truth):
/** 
 * Constructor. Creates a new, empty catalog.
 */
public Catalog(){
  this.NameHash=new HashMap<String,Table>();
  this.IdHash=new HashMap<Integer,Table>();
}
Program: 37759
Project: 37759
Buggy source:
/** 
 * Return the id of the table with a specified name,
 * @throws NoSuchElementException if the table doesn't exist
 */
public Integer getTableId(String name) throws NoSuchElementException {
  Table match=this.NameHash.get(name);
  if (match == null) {
    throw NoSuchElementException;
  }
 else {
    DbFile file=match.getDbFile();
    return Integer(file.getId());
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * Return the id of the table with a specified name,
 * @throws NoSuchElementException if the table doesn't exist
 */
public Integer getTableId(String name) throws NoSuchElementException {
  Table match=this.NameHash.get(name);
  if (match == null) {
    throw new NoSuchElementException();
  }
 else {
    DbFile file=match.getDbFile();
    return file.getId();
  }
}
Program: 37760
Project: 37760
Buggy source:
public String getPrimaryKey(int tableid){
  Table match=this.IdHash.get(tableid);
  if (match == null) {
    throw NoSuchElementException;
  }
 else {
    return match.getPkeyField();
  }
  return null;
}

Fixed version (ground truth):
public String getPrimaryKey(int tableid){
  Table match=this.IdHash.get(tableid);
  if (match == null) {
    throw new NoSuchElementException();
  }
 else {
    return match.getPkeyField();
  }
}
Program: 37761
Project: 37761
Buggy source:
/** 
 * Returns the DbFile that can be used to read the contents of the specified table.
 * @param tableid The id of the table, as specified by the DbFile.getId()function passed to addTable
 */
public DbFile getDatabaseFile(int tableid) throws NoSuchElementException {
  Table match=this.IdHash.get(tableid);
  if (match == null) {
    throw NoSuchElementException;
  }
 else {
    return match.getDbFile();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the DbFile that can be used to read the contents of the specified table.
 * @param tableid The id of the table, as specified by the DbFile.getId()function passed to addTable
 */
public DbFile getDatabaseFile(int tableid) throws NoSuchElementException {
  Table match=this.IdHash.get(tableid);
  if (match == null) {
    throw new NoSuchElementException();
  }
 else {
    return match.getDbFile();
  }
}
Program: 37762
Project: 37762
Buggy source:
public Long saveCarInfo(Car car){
  Car savedCar=readCarInfo();
  if (savedCar != null) {
    savedCar=updateCar(car,savedCar);
  }
 else {
    Long wheelSavedId=saveWheel(savedCar.getWheel1());
    wheelSavedId=saveWheel(savedCar.getWheel2());
    wheelSavedId=saveWheel(savedCar.getWheel3());
    wheelSavedId=saveWheel(savedCar.getWheel4());
    savedCar=car;
  }
  return savedCar.save();
}

Fixed version (ground truth):
public Long saveCarInfo(Car car){
  Car savedCar=readCarInfo();
  if (savedCar != null) {
    savedCar=updateCar(car,savedCar);
  }
 else {
    savedCar=car;
    Long wheelSavedId=saveWheel(savedCar.getWheel1());
    wheelSavedId=saveWheel(savedCar.getWheel2());
    wheelSavedId=saveWheel(savedCar.getWheel3());
    wheelSavedId=saveWheel(savedCar.getWheel4());
  }
  return savedCar.save();
}
Program: 37763
Project: 37763
Buggy source:
public void cardReaded(Car car){
  wheel1.setText(Integer.toString(car.getWheel1().getRadius()));
  wheel2.setText(Integer.toString(car.getWheel2().getRadius()));
  wheel3.setText(Integer.toString(car.getWheel3().getRadius()));
  wheel4.setText(Integer.toString(car.getWheel4().getRadius()));
  description.setText(car.getDescription());
}

Fixed version (ground truth):
public void cardReaded(Car car){
  if (car != null) {
    wheel1.setText(Integer.toString(car.getWheel1().getRadius()));
    wheel2.setText(Integer.toString(car.getWheel2().getRadius()));
    wheel3.setText(Integer.toString(car.getWheel3().getRadius()));
    wheel4.setText(Integer.toString(car.getWheel4().getRadius()));
    description.setText(car.getDescription());
  }
}
Program: 37764
Project: 37764
Buggy source:
/** 
 * Determines if the cell satisfies the per species minimum interatomic distance constraints. Precondition: the perSpeciedMID option has been used
 */
public boolean satisfiesPerSpeciesMIDs(List<Triplet<Element,Element,Double>> mids){
  for (  Triplet<Element,Element,Double> mid : mids) {
    Element a=mid.getFirst();
    Element b=mid.getSecond();
    Double minid=mid.getThird();
    for (int i=0; i < getNumSites(); i++) {
      List<Site> sitesInSphere=getAtomsInSphereSorted(getSite(i).getCoords(),minid);
      if (sitesInSphere.size() == 1) {
        continue;
      }
 else {
        sitesInSphere.remove(0);
        for (        Site s : sitesInSphere) {
          Boolean passed=!(((getSite(i).getElement() == a) && (s.getElement() == b)) || ((getSite(i).getElement() == b) && (s.getElement() == a)));
          if (passed == false) {
            return false;
          }
        }
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Determines if the cell satisfies the per species minimum interatomic distance constraints. Precondition: the perSpeciedMID option has been used
 */
public boolean satisfiesPerSpeciesMIDs(List<Triplet<Element,Element,Double>> mids){
  for (  Triplet<Element,Element,Double> mid : mids) {
    Element a=mid.getFirst();
    Element b=mid.getSecond();
    Double minid=mid.getThird();
    for (int i=0; i < getNumSites(); i++) {
      List<Site> sitesInSphere=getAtomsInSphereSorted(getSite(i).getCoords(),minid);
      if (sitesInSphere.size() <= 1) {
        continue;
      }
 else {
        sitesInSphere.remove(0);
        for (        Site s : sitesInSphere) {
          Boolean passed=!(((getSite(i).getElement() == a) && (s.getElement() == b)) || ((getSite(i).getElement() == b) && (s.getElement() == a)));
          if (passed == false) {
            return false;
          }
        }
      }
    }
  }
  return true;
}
Program: 37765
Project: 37765
Buggy source:
public boolean satisfiesPerSpeciesMIDs(List<Triplet<Element,Element,Double>> mids){
  for (  Triplet<Element,Element,Double> mid : mids) {
    Element a=mid.getFirst();
    Element b=mid.getSecond();
    Double minid=mid.getThird();
    for (int i=0; i < getNumSites(); i++) {
      List<Site> sitesInSphere=getAtomsInSphereSorted(getSite(i).getCoords(),minid);
      boolean sphereHasA=false;
      boolean sphereHasB=false;
      for (      Site s : sitesInSphere) {
        if (!sphereHasA && s.getElement().equals(a)) {
          sphereHasA=true;
          continue;
        }
        if (s.getElement().equals(b))         sphereHasB=true;
      }
      if (sphereHasA && sphereHasB)       return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Determines if the cell satisfies the per species minimum interatomic distance constraints. Precondition: the perSpeciedMID option has been used
 */
public boolean satisfiesPerSpeciesMIDs(List<Triplet<Element,Element,Double>> mids){
  for (  Triplet<Element,Element,Double> mid : mids) {
    Element a=mid.getFirst();
    Element b=mid.getSecond();
    Double minid=mid.getThird();
    for (int i=0; i < getNumSites(); i++) {
      List<Site> sitesInSphere=getAtomsInSphereSorted(getSite(i).getCoords(),minid);
      if (sitesInSphere.size() == 1) {
        continue;
      }
 else {
        sitesInSphere.remove(0);
        for (        Site s : sitesInSphere) {
          Boolean passed=!(((getSite(i).getElement() == a) && (s.getElement() == b)) || ((getSite(i).getElement() == b) && (s.getElement() == a)));
          if (passed == false) {
            return false;
          }
        }
      }
    }
  }
  return true;
}
Program: 37766
Project: 37766
Buggy source:
public static void main(String args[]){
  List<Triplet<Element,Element,Double>> perSpeciesMIDs=new ArrayList<Triplet<Element,Element,Double>>();
  perSpeciesMIDs.add(new Triplet<Element,Element,Double>(Element.getElemFromSymbol("String_Node_Str"),Element.getElemFromSymbol("String_Node_Str"),0.02));
  Cell c=VaspOut.getPOSCAR("String_Node_Str");
  System.out.println(c.satisfiesPerSpeciesMIDs(perSpeciesMIDs));
}

Fixed version (ground truth):
public static void main(String args[]){
  List<Triplet<Element,Element,Double>> perSpeciesMIDs=new ArrayList<Triplet<Element,Element,Double>>();
  perSpeciesMIDs.add(new Triplet<Element,Element,Double>(Element.getElemFromSymbol("String_Node_Str"),Element.getElemFromSymbol("String_Node_Str"),1.13));
  perSpeciesMIDs.add(new Triplet<Element,Element,Double>(Element.getElemFromSymbol("String_Node_Str"),Element.getElemFromSymbol("String_Node_Str"),1.51));
  perSpeciesMIDs.add(new Triplet<Element,Element,Double>(Element.getElemFromSymbol("String_Node_Str"),Element.getElemFromSymbol("String_Node_Str"),1.84));
  Cell c=VaspOut.getPOSCAR("String_Node_Str");
  System.out.println(c.satisfiesPerSpeciesMIDs(perSpeciesMIDs));
}
Program: 37769
Project: 37769
Buggy source:
private Cell removeWhiteSpace(Cell oldCell){
  double[] bounds=super.getAtomBox(oldCell);
  List<Vect> newBasis=new ArrayList<Vect>();
  newBasis.add(oldCell.getLatticeVectors().get(0));
  newBasis.add(oldCell.getLatticeVectors().get(1));
  double c=bounds[1] - bounds[0];
  newBasis.add(new Vect(0.0,0.0,c));
  List<Site> newSites=new ArrayList<Site>();
  for (  Site s : oldCell.getSites())   newSites.add(new Site(s.getElement(),s.getCoords().plus(new Vect(0.0,0.0,bounds[0]))));
  return new Cell(newBasis,newSites,oldCell.getLabel());
}

Fixed version (ground truth):
public Cell removeWhiteSpace(Cell oldCell){
  double[] bounds=super.getAtomBox(oldCell);
  double zlen=bounds[1] - bounds[0];
  List<Vect> newBasis=new ArrayList<Vect>();
  newBasis.add(oldCell.getLatticeVectors().get(0));
  newBasis.add(oldCell.getLatticeVectors().get(1));
  double c=bounds[1] - bounds[0] + substrateDistance;
  newBasis.add(new Vect(0.0,0.0,c));
  List<Site> newSites=new ArrayList<Site>();
  for (  Site s : oldCell.getSites())   newSites.add(new Site(s.getElement(),s.getCoords().subtract(new Vect(0.0,0.0,bounds[0] - substrateDistance / 2))));
  return new Cell(newBasis,newSites,oldCell.getLabel());
}
Program: 37770
Project: 37770
Buggy source:
@Override public void padOrg(){
  Cell oldCell=org.getCell();
  oldCell.rotatedIntoPrincDirs();
  oldCell=removeWhiteSpace(oldCell);
  List<Vect> newBasis=new ArrayList<Vect>();
  newBasis.add(oldCell.getLatticeVectors().get(0));
  newBasis.add(oldCell.getLatticeVectors().get(1));
  double c=oldCell.getCellLengths()[2] + substrate.getCellLengths()[2] + substrateDistance;
  newBasis.add(new Vect(0.0,0.0,c));
  List<Site> newSites=new ArrayList<Site>();
  for (  Site s : substrate.getSites())   newSites.add(s);
  for (  Site s : oldCell.getSites())   newSites.add(new Site(s.getElement(),s.getCoords().plus(new Vect(0.0,0.0,substrate.getCellLengths()[2] + substrateDistance))));
  Cell newCell=new Cell(newBasis,newSites,oldCell.getLabel());
  org.setCell(newCell,false);
  super.padOrg();
}

Fixed version (ground truth):
@Override public void padOrg(){
  Cell oldCell=org.getCell();
  oldCell.rotatedIntoPrincDirs();
  oldCell=removeWhiteSpace(oldCell);
  List<Vect> newBasis=new ArrayList<Vect>();
  newBasis.add(oldCell.getLatticeVectors().get(0));
  newBasis.add(oldCell.getLatticeVectors().get(1));
  double c=oldCell.getCellLengths()[2] + substrate.getCellLengths()[2];
  newBasis.add(new Vect(0.0,0.0,c));
  List<Site> newSites=new ArrayList<Site>();
  for (  Site s : substrate.getSites())   newSites.add(s);
  for (  Site s : oldCell.getSites())   newSites.add(new Site(s.getElement(),s.getCoords().subtract(new Vect(0.0,0.0,substrate.getCellLengths()[2] + substrateDistance * 2))));
  Cell newCell=new Cell(newBasis,newSites,oldCell.getLabel());
  org.setCell(newCell,false);
}
Program: 37771
Project: 37771
Buggy source:
public SubstrateObjFcn(List<String> subArray,Organism o){
  super(subArray,o);
  substrateDistance=Double.parseDouble(objFcnArgs.get(0));
  substrate=GAParameters.getParams().getSubstrate();
  substrate.rotatedIntoPrincDirs();
  substrate=removeWhiteSpace(substrate);
}

Fixed version (ground truth):
public SubstrateObjFcn(List<String> subArray,Organism o){
  super(subArray,o);
  substrateDistance=Double.parseDouble(objFcnArgs.get(0));
  substrate=VaspOut.getPOSCAR("String_Node_Str");
  substrate.rotatedIntoPrincDirs();
  substrate=removeWhiteSpace(substrate);
}
Program: 37772
Project: 37772
Buggy source:
public static void main(String[] args){
  Vect bob=new Vect(1.0,1.0,1.0);
  Vect e1=new Vect(3.0,0.0,0.0);
  Vect e2=new Vect(0.0,3.0,0.0);
  Vect e3=new Vect(0.0,0.0,3.0);
  List<Vect> basis=new ArrayList<Vect>();
  basis.add(e1);
  basis.add(e2);
  basis.add(e3);
  Vect shift=new Vect(-2.0,-1.0,-2.0);
  bob=bob.plusWRT(shift,basis);
  System.out.println(bob);
  List<Double> components=bob.getComponentsWRTBasis(basis);
  System.out.println(components.get(0) + "String_Node_Str" + components.get(1)+ "String_Node_Str"+ components.get(2));
  System.out.println(e1.cross(e2));
  System.out.println(Vect.pointsAreCollinear(e1,e2,e3,0.0001));
}

Fixed version (ground truth):
public static void main(String[] args){
  Cell oldCell=VaspOut.getPOSCAR("String_Node_Str");
  Cell substrate=VaspOut.getPOSCAR("String_Node_Str");
  List<Vect> newBasis=new ArrayList<Vect>();
  newBasis.add(substrate.getLatticeVectors().get(0));
  newBasis.add(substrate.getLatticeVectors().get(1));
  newBasis.add(oldCell.getLatticeVectors().get(2));
  List<Site> newSites=new ArrayList<Site>();
  for (  Site site : oldCell.getSites()) {
    Vect v=site.getCoords().changeBasis(newBasis);
    newSites.add(new Site(site.getElement(),v));
  }
  Cell newCell=new Cell(newBasis,newSites,oldCell.getLabel());
  VaspIn.writePoscar(newCell,"String_Node_Str",true);
  VaspIn.writePoscar(oldCell,"String_Node_Str",true);
}
Program: 37773
Project: 37773
Buggy source:
public void changeBasis(List<Vect> basis){
  this.basis=basis;
  frac=getComponentsWRTBasis(basis);
  setCartCoordToMatchFracCoord();
}

Fixed version (ground truth):
public Vect changeBasis(List<Vect> basis){
  return new Vect(this.frac,basis);
}
Program: 37774
Project: 37774
Buggy source:
private List<Double> getComponentsWRTBasis(List<Vect> basis){
  int dim=getDimension();
  if (basis.size() != dim)   throw new RuntimeException("String_Node_Str");
  List<Double> cartComps=getCartesianComponents();
  Matrix X=new Matrix(dim,1);
  for (int i=0; i < dim; i++)   X.set(i,0,cartComps.get(i));
  Matrix B=new Matrix(dim,dim);
  for (int i=0; i < dim; i++)   for (int j=0; j < dim; j++)   B.set(i,j,basis.get(j).getCartesianComponents().get(i));
  if (Math.abs(B.det()) < Constants.epsilon)   throw new IllegalArgumentException("String_Node_Str");
  Matrix A=B.inverse().times(X);
  List<Double> result=new ArrayList<Double>();
  for (int i=0; i < dim; i++)   result.add(A.get(i,0));
  return result;
}

Fixed version (ground truth):
public List<Double> getComponentsWRTBasis(List<Vect> basis){
  int dim=getDimension();
  if (basis.size() != dim)   throw new RuntimeException("String_Node_Str");
  List<Double> cartComps=getCartesianComponents();
  Matrix X=new Matrix(dim,1);
  for (int i=0; i < dim; i++)   X.set(i,0,cartComps.get(i));
  Matrix B=new Matrix(dim,dim);
  for (int i=0; i < dim; i++)   for (int j=0; j < dim; j++)   B.set(i,j,basis.get(j).getCartesianComponents().get(i));
  if (Math.abs(B.det()) < Constants.epsilon)   throw new IllegalArgumentException("String_Node_Str");
  Matrix A=B.inverse().times(X);
  List<Double> result=new ArrayList<Double>();
  for (int i=0; i < dim; i++)   result.add(A.get(i,0));
  return result;
}
Program: 37775
Project: 37775
Buggy source:
public static void main(String args[]){
  Cell a=Cell.parseCif(new File("String_Node_Str"));
  System.out.println(a.toString());
  for (int i=0; i < a.getNumSites(); i++) {
    System.out.println(a.getSite(i).toString());
    List<Site> sitesList=a.getAtomsInSphereSorted(a.getSite(i).getCoords(),.1);
    if (sitesList.size() > 1) {
      System.out.println("String_Node_Str" + sitesList.size());
    }
  }
}

Fixed version (ground truth):
public static void main(String args[]){
  Cell a=VaspOut.getPOSCAR("String_Node_Str");
  System.out.println(a.toString());
  System.out.println(a.getHeight());
}
Program: 37776
Project: 37776
Buggy source:
private void unpadOrg(){
  Cell oldCell=org.getCell();
  double mid=GAParameters.getParams().getMinInteratomicDistance();
  double minx=Double.MAX_VALUE;
  double miny=Double.MAX_VALUE;
  double minz=Double.MAX_VALUE;
  double maxx=Double.MIN_VALUE;
  double maxy=Double.MIN_VALUE;
  double maxz=Double.MIN_VALUE;
  for (  Site s : oldCell.getSites()) {
    List<Double> cartComps=s.getCoords().getCartesianComponents();
    minx=Math.min(minx,cartComps.get(0));
    miny=Math.min(miny,cartComps.get(1));
    minz=Math.min(minz,cartComps.get(2));
    maxx=Math.max(maxx,cartComps.get(0));
    maxy=Math.max(maxy,cartComps.get(1));
    maxz=Math.max(maxz,cartComps.get(2));
  }
  double xlen=maxx - minx;
  double ylen=maxy - miny;
  double zlen=maxz - minz;
  List<Site> newSites=new ArrayList<Site>();
  Vect minv=new Vect(minx - mid / 2,miny - mid / 2,minz - mid / 2);
  for (  Site s : oldCell.getSites())   newSites.add(new Site(s.getElement(),s.getCoords().subtract(minv)));
  List<Vect> newBasis=new ArrayList<Vect>();
  newBasis.add(new Vect(xlen + mid,0.0,0.0));
  newBasis.add(new Vect(0.0,ylen + mid,0.0));
  newBasis.add(new Vect(0.0,0.0,zlen + mid));
  Cell newCell=new Cell(newBasis,newSites,oldCell.getLabel());
  org.setCell(newCell,false);
}

Fixed version (ground truth):
private void unpadOrg(){
  Cell oldCell=org.getCell();
  if (oldCell == null)   return;
  double mid=GAParameters.getParams().getMinInteratomicDistance();
  double minx=Double.MAX_VALUE;
  double miny=Double.MAX_VALUE;
  double minz=Double.MAX_VALUE;
  double maxx=Double.MIN_VALUE;
  double maxy=Double.MIN_VALUE;
  double maxz=Double.MIN_VALUE;
  for (  Site s : oldCell.getSites()) {
    List<Double> cartComps=s.getCoords().getCartesianComponents();
    minx=Math.min(minx,cartComps.get(0));
    miny=Math.min(miny,cartComps.get(1));
    minz=Math.min(minz,cartComps.get(2));
    maxx=Math.max(maxx,cartComps.get(0));
    maxy=Math.max(maxy,cartComps.get(1));
    maxz=Math.max(maxz,cartComps.get(2));
  }
  double xlen=maxx - minx;
  double ylen=maxy - miny;
  double zlen=maxz - minz;
  List<Site> newSites=new ArrayList<Site>();
  Vect minv=new Vect(minx - mid / 2,miny - mid / 2,minz - mid / 2);
  for (  Site s : oldCell.getSites())   newSites.add(new Site(s.getElement(),s.getCoords().subtract(minv)));
  List<Vect> newBasis=new ArrayList<Vect>();
  newBasis.add(new Vect(xlen + mid,0.0,0.0));
  newBasis.add(new Vect(0.0,ylen + mid,0.0));
  newBasis.add(new Vect(0.0,0.0,zlen + mid));
  Cell newCell=new Cell(newBasis,newSites,oldCell.getLabel());
  org.setCell(newCell,false);
}
Program: 37779
Project: 37779
Buggy source:
public static List<Vect> makeRandomLattice(){
  GAParameters params=GAParameters.getParams();
  if (params.getMaxLatticeAngleDegrees() == -1 || params.getMinLatticeAngleDegrees() == -1 || params.getMaxLatticeLength() == -1 || params.getMinLatticeLength() == -1)   GAParameters.usage("String_Node_Str",true);
  double maxll=params.getMaxLatticeLength();
  double minll=params.getMinLatticeLength();
  double maxla=params.getMaxLatticeAngleDegrees();
  double minla=params.getMinLatticeAngleDegrees();
  Random rand=params.getRandom();
  double la=rand.nextDouble() * (maxll - minll) + minll;
  double lb=rand.nextDouble() * (maxll - minll) + minll;
  double lc=rand.nextDouble() * (maxll - minll) + minll;
  double adeg, bdeg, gdeg;
  do {
    adeg=(rand.nextDouble() * (maxla - minla) + minla);
    bdeg=(rand.nextDouble() * (maxla - minla) + minla);
    gdeg=(rand.nextDouble() * (maxla - minla) + minla);
  }
 while (!GAUtils.satisfiesTriangleInequality(adeg,bdeg,gdeg) || adeg + bdeg + gdeg >= 360);
  return (new Cell(la,lb,lc,adeg,bdeg,gdeg,null,null)).getLatticeVectors();
}

Fixed version (ground truth):
public static List<Vect> makeRandomLattice(){
  GAParameters params=GAParameters.getParams();
  if (params.getMaxLatticeAngleDegrees() == -1 || params.getMinLatticeAngleDegrees() == -1 || params.getMaxLatticeLength() == -1 || params.getMinLatticeLength() == -1)   GAParameters.usage("String_Node_Str",true);
  double maxll=params.getMaxLatticeLength();
  double minll=params.getMinLatticeLength();
  double maxla=params.getMaxLatticeAngleDegrees();
  double minla=params.getMinLatticeAngleDegrees();
  double maxch=params.getMaxCellHeight();
  Random rand=params.getRandom();
  double adeg, bdeg, gdeg;
  do {
    adeg=(rand.nextDouble() * (maxla - minla) + minla);
    bdeg=(rand.nextDouble() * (maxla - minla) + minla);
    gdeg=(rand.nextDouble() * (maxla - minla) + minla);
  }
 while (!GAUtils.satisfiesTriangleInequality(adeg,bdeg,gdeg) || adeg + bdeg + gdeg >= 360);
  double la=rand.nextDouble() * (maxll - minll) + minll;
  double lb=rand.nextDouble() * (maxll - minll) + minll;
  double maxZll=Math.min(maxll,2 * maxch);
  double lc=rand.nextDouble() * (maxZll - minll) + minll;
  return (new Cell(la,lb,lc,adeg,bdeg,gdeg,null,null)).getLatticeVectors();
}
Program: 37781
Project: 37781
Buggy source:
private void unpadOrg(){
  Cell oldCell=org.getCell();
  double mid=GAParameters.getParams().getMinInteratomicDistance();
  double minz=Double.MAX_VALUE;
  double maxz=Double.MIN_VALUE;
  for (  Site s : oldCell.getSites()) {
    List<Double> cartComps=s.getCoords().getCartesianComponents();
    minz=Math.min(minz,cartComps.get(2));
    maxz=Math.max(maxz,cartComps.get(2));
  }
  double zlen=maxz - minz;
  List<Site> newSites=new ArrayList<Site>();
  Vect minv=new Vect(0.0,0.0,minz - mid / 2);
  for (  Site s : oldCell.getSites())   newSites.add(new Site(s.getElement(),s.getCoords().subtract(minv)));
  List<Vect> newBasis=new ArrayList<Vect>();
  newBasis.add(oldCell.getLatticeVectors().get(0));
  newBasis.add(oldCell.getLatticeVectors().get(1));
  newBasis.add(new Vect(0.0,0.0,zlen + mid));
  Cell newCell=new Cell(newBasis,newSites,oldCell.getLabel());
  org.setCell(newCell,false);
}

Fixed version (ground truth):
private void unpadOrg(){
  Cell oldCell=org.getCell();
  if (oldCell == null)   return;
  double mid=GAParameters.getParams().getMinInteratomicDistance();
  double minz=Double.MAX_VALUE;
  double maxz=Double.MIN_VALUE;
  for (  Site s : oldCell.getSites()) {
    List<Double> cartComps=s.getCoords().getCartesianComponents();
    minz=Math.min(minz,cartComps.get(2));
    maxz=Math.max(maxz,cartComps.get(2));
  }
  double zlen=maxz - minz;
  List<Site> newSites=new ArrayList<Site>();
  Vect minv=new Vect(0.0,0.0,minz - mid / 2);
  for (  Site s : oldCell.getSites())   newSites.add(new Site(s.getElement(),s.getCoords().subtract(minv)));
  List<Vect> newBasis=new ArrayList<Vect>();
  newBasis.add(oldCell.getLatticeVectors().get(0));
  newBasis.add(oldCell.getLatticeVectors().get(1));
  newBasis.add(new Vect(0.0,0.0,zlen + mid));
  Cell newCell=new Cell(newBasis,newSites,oldCell.getLabel());
  org.setCell(newCell,false);
}
Program: 37782
Project: 37782
Buggy source:
public static void runMopac(StructureOrg c){
  GAParameters params=GAParameters.getParams();
  String input=writeInput(c);
  String s=null;
  BufferedReader stdInput=null;
  BufferedReader stdError=null;
  try {
    Process p=Runtime.getRuntime().exec(execpath + "String_Node_Str" + input);
    stdInput=new BufferedReader(new InputStreamReader(p.getInputStream()));
    stdError=new BufferedReader(new InputStreamReader(p.getErrorStream()));
    while ((s=stdInput.readLine()) != null) {
      GAOut.out().stdout(s,GAOut.DEBUG);
    }
    while ((s=stdError.readLine()) != null) {
      System.out.println(s);
    }
  }
 catch (  IOException e) {
    System.out.println("String_Node_Str" + e.getMessage());
    System.exit(-1);
  }
 finally {
    if (stdInput != null)     try {
      stdInput.close();
    }
 catch (    Exception x) {
    }
    if (stdError != null)     try {
      stdError.close();
    }
 catch (    Exception x) {
    }
  }
  if (parseStructure(c,params.getTempDirName() + "String_Node_Str" + c.getID()+ "String_Node_Str") == null) {
    GAOut.out().stdout("String_Node_Str",GAOut.WARNING,c.getID());
  }
 else {
    Cell p=parseStructure(c,params.getTempDirName() + "String_Node_Str" + c.getID()+ "String_Node_Str");
    c.setCell(p);
  }
}

Fixed version (ground truth):
public static void runMopac(StructureOrg c){
  GAParameters params=GAParameters.getParams();
  String input=writeInput(c);
  String s=null;
  BufferedReader stdInput=null;
  BufferedReader stdError=null;
  try {
    Process p=Runtime.getRuntime().exec(execpath + "String_Node_Str" + input);
    stdInput=new BufferedReader(new InputStreamReader(p.getInputStream()));
    stdError=new BufferedReader(new InputStreamReader(p.getErrorStream()));
    while ((s=stdInput.readLine()) != null) {
      GAOut.out().stdout(s,GAOut.DEBUG);
    }
    while ((s=stdError.readLine()) != null) {
      System.out.println(s);
    }
  }
 catch (  IOException e) {
    System.out.println("String_Node_Str" + e.getMessage());
    System.exit(-1);
  }
 finally {
    if (stdInput != null)     try {
      stdInput.close();
    }
 catch (    Exception x) {
    }
    if (stdError != null)     try {
      stdError.close();
    }
 catch (    Exception x) {
    }
  }
  Cell p=parseStructure(c,params.getTempDirName() + "String_Node_Str" + c.getID()+ "String_Node_Str");
  c.setCell(p);
}
Program: 37784
Project: 37784
Buggy source:
private static Organism makeFirstGenOrg(Generation offspring){
  GAParameters params=GAParameters.getParams();
  Development dev=params.getDevelopment();
  List<Pair<StructureOrgCreator,Integer>> initialOrgCreators=params.getInitialOrgCreators();
  StructureOrg newOrg=null;
  while (newOrg == null) {
    int socIndx=0;
    while (initialOrgCreators.size() > socIndx && initialOrgCreators.get(socIndx).getSecond() <= 0)     socIndx++;
    if (initialOrgCreators.size() <= socIndx)     return null;
    StructureOrgCreator soc=initialOrgCreators.get(socIndx).getFirst();
    do {
      newOrg=soc.makeOrganism(offspring);
    }
 while (newOrg != null && dev != null && !dev.doDevelop(offspring,newOrg));
    if (newOrg != null)     newOrg.setSOCreator(soc);
 else     initialOrgCreators.set(socIndx,new Pair<StructureOrgCreator,Integer>(soc,0));
    GAOut.out().stdout("String_Node_Str" + initialOrgCreators.get(socIndx).getSecond(),GAOut.NOTICE);
  }
  return newOrg;
}

Fixed version (ground truth):
private static Organism makeFirstGenOrg(Generation offspring){
  GAParameters params=GAParameters.getParams();
  Development dev=params.getDevelopment();
  List<Pair<StructureOrgCreator,Integer>> initialOrgCreators=params.getInitialOrgCreators();
  StructureOrg newOrg=null;
  while (newOrg == null) {
    int socIndx=0;
    while (initialOrgCreators.size() > socIndx && initialOrgCreators.get(socIndx).getSecond() <= 0)     socIndx++;
    if (initialOrgCreators.size() <= socIndx)     return null;
    StructureOrgCreator soc=initialOrgCreators.get(socIndx).getFirst();
    do {
      newOrg=soc.makeOrganism(offspring);
      System.out.println(newOrg);
    }
 while (newOrg != null && dev != null && !dev.doDevelop(offspring,newOrg));
    if (newOrg != null)     newOrg.setSOCreator(soc);
 else     initialOrgCreators.set(socIndx,new Pair<StructureOrgCreator,Integer>(soc,0));
    GAOut.out().stdout("String_Node_Str" + initialOrgCreators.get(socIndx).getSecond(),GAOut.NOTICE);
  }
  return newOrg;
}
Program: 37786
Project: 37786
Buggy source:
public static void main(String args[]){
  Cell c=VaspOut.getPOSCAR("String_Node_Str");
  System.out.println(getWyckoffCell(c));
}

Fixed version (ground truth):
public static void main(String args[]){
  Cell a=Cell.parseCif(new File("String_Node_Str"));
  Cell b=Cell.parseCif(new File("String_Node_Str"));
  System.out.println(a.matchesCell(b,0.1,0.1,0.1));
  System.out.println(getFindsymOutput(b));
}
Program: 37788
Project: 37788
Buggy source:
public Organism getNthBestOrganism(int n){
  ArrayList<Double> fitnesses=new ArrayList<Double>();
  Iterator<Organism> i=organisms.iterator();
  while (i.hasNext()) {
    Organism c=i.next();
    fitnesses.add(new Double(c.getFitness()));
  }
  n=Math.min(n,fitnesses.size());
  double fn=GAUtils.doubleSelect(fitnesses,n);
  i=organisms.iterator();
  while (i.hasNext()) {
    Organism c=i.next();
    if (fn == c.getFitness())     return c;
  }
  return null;
}

Fixed version (ground truth):
public Organism getNthBestOrganism(int n){
  return getOrganismsSorted().get(n - 1);
}
Program: 37789
Project: 37789
Buggy source:
private static String getLammpsInputFile(StructureOrg c,String potlStr){
  StringBuilder ans=new StringBuilder();
  String newline=GAUtils.newline();
  ans.append("String_Node_Str" + newline);
  ans.append("String_Node_Str" + newline);
  ans.append("String_Node_Str" + newline);
  ans.append("String_Node_Str" + newline);
  ans.append("String_Node_Str" + dataFileName + newline);
  ans.append(newline + potlStr + newline);
  ans.append("String_Node_Str" + newline);
  ans.append("String_Node_Str" + dumpFileName + newline);
  ans.append("String_Node_Str" + newline);
  ans.append("String_Node_Str" + newline);
  ans.append("String_Node_Str" + newline);
  ans.append("String_Node_Str" + newline);
  ans.append("String_Node_Str" + newline);
  return ans.toString();
}

Fixed version (ground truth):
private static String getLammpsInputFile(StructureOrg c,String potlStr){
  StringBuilder ans=new StringBuilder();
  String newline=GAUtils.newline();
  ans.append("String_Node_Str" + newline);
  ans.append("String_Node_Str" + newline);
  ans.append("String_Node_Str" + newline);
  ans.append("String_Node_Str" + newline);
  ans.append("String_Node_Str" + dataFileName + newline);
  ans.append(newline + potlStr + newline);
  ans.append("String_Node_Str" + newline);
  ans.append("String_Node_Str" + newline);
  ans.append("String_Node_Str" + newline);
  ans.append("String_Node_Str" + dumpFileName + newline);
  ans.append("String_Node_Str" + newline);
  ans.append("String_Node_Str" + newline);
  ans.append("String_Node_Str" + newline);
  return ans.toString();
}
Program: 37792
Project: 37792
Buggy source:
public static void main(String args[]){
  Cell a=Cell.parseCif(new File("String_Node_Str"));
  Cell b=Cell.parseCif(new File("String_Node_Str"));
  Cell c=Cell.parseCif(new File("String_Node_Str"));
  System.out.println(a.matchesCell(b,0.5,0.5,0.05));
  System.out.println(b.matchesCell(a,0.5,0.5,0.05));
  System.out.println(a.matchesCell(c,0.5,0.5,0.05));
  System.out.println(c.matchesCell(a,0.5,0.5,0.05));
  System.out.println(c.matchesCell(b,0.5,0.5,0.05));
  System.out.println(b.matchesCell(c,0.5,0.5,0.05));
  System.out.println(a.matchesCell(a,0.1,0.05,0.05));
  System.out.println(b.matchesCell(b,0.1,0.05,0.05));
  System.out.println(c.matchesCell(c,0.1,0.05,0.05));
}

Fixed version (ground truth):
public static void main(String args[]){
  Cell a=Cell.parseCif(new File("String_Node_Str"));
  a.getNigliReducedCell();
  for (int i=0; i < a.getNumSites(); i++) {
    if (a.getAtomsInSphereSorted(a.getSite(i).getCoords(),.8).size() > 1) {
      System.out.println("String_Node_Str");
    }
  }
}
Program: 37797
Project: 37797
Buggy source:
public static String getFindsymOutput(Cell cell){
  String output=runFindsym(getFindsymInput(cell,accuracy1));
  if (output.contains("String_Node_Str")) {
    output=runFindsym(getFindsymInput(cell,accuracy2));
  }
  return output;
}

Fixed version (ground truth):
public static String getFindsymOutput(Cell cell){
  String output=null;
  int bestSG=0;
  String bestOutput=null;
  for (int i=0; i < accuracies.length; i++) {
    output=runFindsym(getFindsymInput(cell,accuracies[i]));
    if (output.contains("String_Node_Str"))     continue;
    int sg=getSpaceGroupIntFromFSOutput(output);
    if (sg >= bestSG) {
      bestSG=sg;
      bestOutput=output;
    }
  }
  return bestOutput;
}
Program: 37798
Project: 37798
Buggy source:
public static void main(String args[]){
  Cell a=Cell.parseCif(new File("String_Node_Str"));
  Cell b=Cell.parseCif(new File("String_Node_Str"));
  System.out.println(a.matchesCell(b,0.1,0.1,0.1));
  System.out.println(getFindsymOutput(b));
}

Fixed version (ground truth):
public static void main(String args[]){
  Cell a=Cell.parseCif(new File("String_Node_Str"));
  Cell b=Cell.parseCif(new File("String_Node_Str"));
  System.out.println(a.matchesCell(b,0.1,0.1,0.1));
  System.out.println(getFindsymOutput(b.getNigliReducedCell()));
}