nus-yam/ex-repair huggingface dataset:
Program: 39423
Project: 39423
Buggy source:
/** 
 * @param bondA1
 * @param bondA2
 * @param matchBond
 * @param shouldMatchRings
 * @param matchAtomTypes (atom type also matched and symbol matched)
 * @return
 */
public static boolean matches(IBond bondA1,IBond bondA2,boolean matchBond,boolean shouldMatchRings,boolean matchAtomTypes){
  if (!isAtomMatch(bondA1,bondA2,shouldMatchRings,matchAtomTypes)) {
    return false;
  }
  return !matchBond || isBondMatch(new DefaultBondMatcher(bondA1,matchBond,matchAtomTypes),bondA2);
}

Fixed version (ground truth):
/** 
 * @param bondA1
 * @param bondA2
 * @param matchBond
 * @param shouldMatchRings
 * @param matchAtomTypes (atom type also matched and symbol matched)
 * @return
 */
public static boolean matches(IBond bondA1,IBond bondA2,boolean matchBond,boolean shouldMatchRings,boolean matchAtomTypes){
  if (!isAtomMatch(bondA1,bondA2,shouldMatchRings,matchAtomTypes)) {
    return false;
  }
  return isBondMatch(new DefaultBondMatcher(bondA1,matchBond,shouldMatchRings,matchAtomTypes),bondA2);
}
Program: 39424
Project: 39424
Buggy source:
/** 
 * @param list
 * @param source
 * @param target
 */
protected synchronized void identifyMatchedParts(List<List<CDKRMap>> list,IAtomContainer source,IAtomContainer target){
  List<IAtom> array1=new ArrayList<IAtom>();
  List<IAtom> array2=new ArrayList<IAtom>();
  for (  List<CDKRMap> rMap : list) {
    Map<Integer,Integer> atomNumbersFromContainer=new TreeMap<>();
    for (    CDKRMap rmap : rMap) {
      IAtom sourceAtom=source.getAtom(rmap.getId1());
      IAtom targetAtom=target.getAtom(rmap.getId2());
      array1.add(sourceAtom);
      array2.add(targetAtom);
      int indexI=source.getAtomNumber(sourceAtom);
      int indexJ=target.getAtomNumber(targetAtom);
      atomNumbersFromContainer.put(indexI,indexJ);
    }
    getMappings().add(atomNumbersFromContainer);
  }
}

Fixed version (ground truth):
/** 
 * @param list
 * @param source
 * @param target
 */
protected synchronized void identifyMatchedParts(List<List<CDKRMap>> list,IAtomContainer source,IAtomContainer target){
  for (  List<CDKRMap> rMap : list) {
    Map<Integer,Integer> atomNumbersFromContainer=new TreeMap<>();
    for (    CDKRMap rmap : rMap) {
      IAtom sourceAtom=source.getAtom(rmap.getId1());
      IAtom targetAtom=target.getAtom(rmap.getId2());
      int indexI=source.getAtomNumber(sourceAtom);
      int indexJ=target.getAtomNumber(targetAtom);
      atomNumbersFromContainer.put(indexI,indexJ);
    }
    getMappings().add(atomNumbersFromContainer);
  }
}
Program: 39425
Project: 39425
Buggy source:
/** 
 * @param list
 * @param source
 * @param target
 */
protected synchronized void identifySingleAtomsMatchedParts(List<CDKRMap> list,IAtomContainer source,IAtomContainer target){
  List<IAtom> array1=new ArrayList<>();
  List<IAtom> array2=new ArrayList<>();
  TreeMap<Integer,Integer> atomNumbersFromContainer=new TreeMap<>();
  for (  CDKRMap rmap : list) {
    IAtom sAtom=source.getAtom(rmap.getId1());
    IAtom tAtom=target.getAtom(rmap.getId2());
    array1.add(sAtom);
    array2.add(tAtom);
    int indexI=source.getAtomNumber(sAtom);
    int indexJ=target.getAtomNumber(tAtom);
    atomNumbersFromContainer.put(indexI,indexJ);
    getMappings().add(atomNumbersFromContainer);
  }
}

Fixed version (ground truth):
/** 
 * @param list
 * @param source
 * @param target
 */
protected synchronized void identifySingleAtomsMatchedParts(List<CDKRMap> list,IAtomContainer source,IAtomContainer target){
  TreeMap<Integer,Integer> atomNumbersFromContainer=new TreeMap<>();
  for (  CDKRMap rmap : list) {
    IAtom sAtom=source.getAtom(rmap.getId1());
    IAtom tAtom=target.getAtom(rmap.getId2());
    int indexI=source.getAtomNumber(sAtom);
    int indexJ=target.getAtomNumber(tAtom);
    atomNumbersFromContainer.put(indexI,indexJ);
    getMappings().add(atomNumbersFromContainer);
  }
}
Program: 39427
Project: 39427
Buggy source:
/** 
 * Default
 */
public SingleMapping(){
  connectedBondOrder=new TreeMap<Integer,Double>();
}

Fixed version (ground truth):
/** 
 * Default
 */
public SingleMapping(){
  connectedBondOrder=new TreeMap<>();
}
Program: 39429
Project: 39429
Buggy source:
private <K,V>Map<K,V> sortByValue(Map<K,V> map){
  List list=new LinkedList(map.entrySet());
  Collections.sort(list,new Comparator(){
    @Override public int compare(    Object object1,    Object object2){
      return ((Comparable)((Map.Entry<K,V>)(object1)).getValue()).compareTo(((Map.Entry<K,V>)(object2)).getValue());
    }
  }
);
  Map<K,V> result=new LinkedHashMap<K,V>();
  for (Iterator it=list.iterator(); it.hasNext(); ) {
    Map.Entry<K,V> entry=(Map.Entry<K,V>)it.next();
    result.put(entry.getKey(),entry.getValue());
  }
  return result;
}

Fixed version (ground truth):
private <K,V>Map<K,V> sortByValue(Map<K,V> map){
  List list=new LinkedList(map.entrySet());
  Collections.sort(list,new Comparator(){
    @Override public int compare(    Object object1,    Object object2){
      return ((Comparable)((Map.Entry<K,V>)(object1)).getValue()).compareTo(((Map.Entry<K,V>)(object2)).getValue());
    }
  }
);
  Map<K,V> result=new LinkedHashMap<>();
  for (Iterator it=list.iterator(); it.hasNext(); ) {
    Map.Entry<K,V> entry=(Map.Entry<K,V>)it.next();
    result.put(entry.getKey(),entry.getValue());
  }
  return result;
}
Program: 39430
Project: 39430
Buggy source:
/** 
 * Returns single mapping solutions.
 * @param source
 * @param target
 * @return Mappings
 * @throws CDKException
 */
@TestMethod("String_Node_Str") protected synchronized List<Map<IAtom,IAtom>> getOverLaps(IQueryAtomContainer source,IAtomContainer target) throws CDKException {
  List<Map<IAtom,IAtom>> mappings=new ArrayList<Map<IAtom,IAtom>>();
  this.source=source;
  this.target=target;
  if (source.getAtomCount() == 1 || (source.getAtomCount() > 0 && source.getBondCount() == 0)) {
    setSourceSingleAtomMap(mappings);
  }
  if (target.getAtomCount() == 1 || (target.getAtomCount() > 0 && target.getBondCount() == 0)) {
    setTargetSingleAtomMap(mappings);
  }
  return postFilter(mappings);
}

Fixed version (ground truth):
/** 
 * Returns single mapping solutions.
 * @param source
 * @param target
 * @return Mappings
 * @throws CDKException
 */
@TestMethod("String_Node_Str") protected synchronized List<Map<IAtom,IAtom>> getOverLaps(IQueryAtomContainer source,IAtomContainer target) throws CDKException {
  List<Map<IAtom,IAtom>> mappings=new ArrayList<>();
  this.source=source;
  this.target=target;
  if (source.getAtomCount() == 1 || (source.getAtomCount() > 0 && source.getBondCount() == 0)) {
    setSourceSingleAtomMap(mappings);
  }
  if (target.getAtomCount() == 1 || (target.getAtomCount() > 0 && target.getBondCount() == 0)) {
    setTargetSingleAtomMap(mappings);
  }
  return postFilter(mappings);
}
Program: 39431
Project: 39431
Buggy source:
private synchronized List<Map<IAtom,IAtom>> postFilter(List<Map<IAtom,IAtom>> mappings){
  List<Map<IAtom,IAtom>> sortedMap=new ArrayList<Map<IAtom,IAtom>>();
  if (mappings.isEmpty()) {
    return sortedMap;
  }
  Map<Integer,Double> sortedMapByValue=sortByValue(connectedBondOrder);
  for (  Integer key : sortedMapByValue.keySet()) {
    Map<IAtom,IAtom> mapToBeMoved=mappings.get(key);
    sortedMap.add(mapToBeMoved);
  }
  return sortedMap;
}

Fixed version (ground truth):
private synchronized List<Map<IAtom,IAtom>> postFilter(List<Map<IAtom,IAtom>> mappings){
  List<Map<IAtom,IAtom>> sortedMap=new ArrayList<>();
  if (mappings.isEmpty()) {
    return sortedMap;
  }
  Map<Integer,Double> sortedMapByValue=sortByValue(connectedBondOrder);
  for (  Integer key : sortedMapByValue.keySet()) {
    Map<IAtom,IAtom> mapToBeMoved=mappings.get(key);
    sortedMap.add(mapToBeMoved);
  }
  return sortedMap;
}
Program: 39432
Project: 39432
Buggy source:
private synchronized BondMatcher createBondMatcher(IBond bond){
  return new DefaultBondMatcher(bond,isBondMatchFlag(),isMatchAtomType());
}

Fixed version (ground truth):
private synchronized BondMatcher createBondMatcher(IBond bond){
  return new DefaultBondMatcher(bond,isBondMatchFlag(),isShouldMatchRings(),isMatchAtomType());
}
Program: 39433
Project: 39433
Buggy source:
boolean matchBonds(IBond queryBond,IBond targetBond){
  BondMatcher defaultVFBondMatcher=new DefaultBondMatcher(queryBond,shouldMatchBonds,shouldMatchAtomType);
  return defaultVFBondMatcher.matches(targetBond);
}

Fixed version (ground truth):
boolean matchBonds(IBond queryBond,IBond targetBond){
  BondMatcher defaultVFBondMatcher=new DefaultBondMatcher(queryBond,shouldMatchBonds,shouldMatchRings,shouldMatchAtomType);
  return defaultVFBondMatcher.matches(targetBond);
}
Program: 39434
Project: 39434
Buggy source:
/** 
 * Constructor for the CDKRMap
 * @param id1  number of the edge (bond) in the graphe 1
 * @param id2  number of the edge (bond) in the graphe 2
 */
public CDKRMap(int id1,int id2){
  this.id1=id1;
  this.id2=id2;
}

Fixed version (ground truth):
/** 
 * Constructor for the CDKRMap
 * @param id1 number of the edge (bond) in the graph e1
 * @param id2 number of the edge (bond) in the graph e2
 */
public CDKRMap(int id1,int id2){
  this.id1=id1;
  this.id2=id2;
}
Program: 39435
Project: 39435
Buggy source:
/** 
 * Sets the id1 attribute of the CDKRMap object
 * @param id1  The new id1 value
 */
public synchronized void setId1(int id1){
  this.id1=id1;
}

Fixed version (ground truth):
/** 
 * Sets the id1 attribute of the CDKRMap object
 * @param id1 The new id1 value
 */
public synchronized void setId1(int id1){
  this.id1=id1;
}
Program: 39436
Project: 39436
Buggy source:
/** 
 * Returns a hash code for object comparison.
 * @return    Returns a hash code for object comparison.
 */
@Override public synchronized int hashCode(){
  int hash=5;
  hash=79 * hash + this.getId1();
  hash=79 * hash + this.getId2();
  return hash;
}

Fixed version (ground truth):
/** 
 * Returns a hash code for object comparison.
 * @return Returns a hash code for object comparison.
 */
@Override public synchronized int hashCode(){
  int hash=5;
  hash=79 * hash + this.getId1();
  hash=79 * hash + this.getId2();
  return hash;
}
Program: 39437
Project: 39437
Buggy source:
/** 
 * Sets the id2 attribute of the CDKRMap object
 * @param id2  The new id2 value
 */
public synchronized void setId2(int id2){
  this.id2=id2;
}

Fixed version (ground truth):
/** 
 * Sets the id2 attribute of the CDKRMap object
 * @param id2 The new id2 value
 */
public synchronized void setId2(int id2){
  this.id2=id2;
}
Program: 39438
Project: 39438
Buggy source:
/** 
 * The equals method.
 * @param obj  The object to compare.
 * @return    true=if both ids equal, else false.
 */
@Override public synchronized boolean equals(Object obj){
  if (((CDKRMap)obj).getId1() == getId1() && ((CDKRMap)obj).getId2() == getId2()) {
    return (true);
  }
 else {
    return (false);
  }
}

Fixed version (ground truth):
/** 
 * The equals method.
 * @param obj The object to compare.
 * @return true=if both ids equal, else false.
 */
@Override public synchronized boolean equals(Object obj){
  if (((CDKRMap)obj).getId1() == getId1() && ((CDKRMap)obj).getId2() == getId2()) {
    return true;
  }
  return ((CDKRMap)obj).getId1() == getId1() || ((CDKRMap)obj).getId2() == getId2();
}
Program: 39439
Project: 39439
Buggy source:
/** 
 * Gets the id1 attribute of the CDKRMap object
 * @return    The id1 value
 */
public synchronized int getId1(){
  return id1;
}

Fixed version (ground truth):
/** 
 * Gets the id1 attribute of the CDKRMap object
 * @return The id1 value
 */
public synchronized int getId1(){
  return id1;
}
Program: 39440
Project: 39440
Buggy source:
/** 
 * Gets the id2 attribute of the CDKRMap object
 * @return    The id2 value
 */
public synchronized int getId2(){
  return id2;
}

Fixed version (ground truth):
/** 
 * Gets the id2 attribute of the CDKRMap object
 * @return The id2 value
 */
public synchronized int getId2(){
  return id2;
}
Program: 39441
Project: 39441
Buggy source:
private synchronized boolean substructureAlgorithm() throws CDKException {
  Substructure mcs;
  mcs=new Substructure(getQueryContainer(),getTargetContainer(),isMatchBonds(),isMatchRings(),true);
  clearMaps();
  if (isSubgraph()) {
    getMCSList().addAll(mcs.getAllAtomMapping());
  }
  return mcs.isSubgraph();
}

Fixed version (ground truth):
private synchronized boolean substructureAlgorithm() throws CDKException {
  Substructure mcs;
  mcs=new Substructure(getQueryContainer(),getTargetContainer(),isMatchBonds(),isMatchRings(),true);
  clearMaps();
  if (mcs.isSubgraph()) {
    getMCSList().addAll(mcs.getAllAtomMapping());
  }
  return mcs.isSubgraph();
}
Program: 39442
Project: 39442
Buggy source:
/** 
 * {@inheritDoc}
 * @param targetAtom
 * @return
 */
@Override public boolean matches(IAtom targetAtom){
  if (targetAtom instanceof IQueryAtom) {
    return ((IQueryAtom)targetAtom).matches(getQueryAtom());
  }
 else   if (getQueryAtom() != null && getQueryAtom() instanceof IQueryAtom) {
    return ((IQueryAtom)getQueryAtom()).matches(targetAtom);
  }
 else {
    if (!matchSymbol(targetAtom)) {
      return false;
    }
    if (isShouldMatchRings() && isAtomAttachedToRing(getQueryAtom()) && isAtomAttachedToRing(targetAtom)) {
      return true;
    }
 else     if (isShouldMatchRings() && (isAliphaticAtom(getQueryAtom()) && isRingAtom(targetAtom))) {
      return false;
    }
 else     if (isShouldMatchRings() && (isRingAtom(getQueryAtom()) && isAliphaticAtom(targetAtom))) {
      return false;
    }
 else     if (isShouldMatchRings() && (isRingAtom(getQueryAtom()) && isRingAtom(targetAtom))) {
      if (getQueryAtom().getProperty(SMALLEST_RING_SIZE) != targetAtom.getProperty(SMALLEST_RING_SIZE)) {
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @param targetAtom
 * @return
 */
@Override public boolean matches(IAtom targetAtom){
  if (targetAtom instanceof IQueryAtom) {
    return ((IQueryAtom)targetAtom).matches(getQueryAtom());
  }
 else   if (getQueryAtom() != null && getQueryAtom() instanceof IQueryAtom) {
    return ((IQueryAtom)getQueryAtom()).matches(targetAtom);
  }
 else {
    if (!matchSymbol(targetAtom)) {
      return false;
    }
    if (isShouldMatchRings() && isAtomAttachedToRing(getQueryAtom()) && !isRingAtom(getQueryAtom())&& isAtomAttachedToRing(targetAtom)&& !isRingAtom(targetAtom)) {
      return true;
    }
 else     if (isShouldMatchRings() && (isAliphaticAtom(getQueryAtom()) && isRingAtom(targetAtom))) {
      return false;
    }
 else     if (isShouldMatchRings() && (isRingAtom(getQueryAtom()) && isAliphaticAtom(targetAtom))) {
      return false;
    }
 else     if (isShouldMatchRings() && (isRingAtom(getQueryAtom()) && isRingAtom(targetAtom))) {
      if (getQueryAtom().getProperty(SMALLEST_RING_SIZE) != targetAtom.getProperty(SMALLEST_RING_SIZE)) {
        return false;
      }
    }
  }
  return true;
}
Program: 39443
Project: 39443
Buggy source:
public Map<String,String> getStringDataTypes(){
  return stringDataTypes;
}

Fixed version (ground truth):
public Map<String,String> getStringDataTypes(){
  return Collections.unmodifiableMap(stringDataTypes);
}
Program: 39444
Project: 39444
Buggy source:
/** 
 * Returns Target molecule
 * @return
 * @throws IOException
 * @throws CDKException
 */
public IAtomContainer getTarget() throws IOException, CDKException {
  String filenameOrData=argumentHandler.getTargetFilepath();
  String type=argumentHandler.getTargetType();
  if (isSingleFileTarget) {
    ISimpleChemObjectReader reader=getReader(type,filenameOrData);
    IChemFile chemFile=reader.read(new ChemFile());
    IAtomContainer molecule=(IAtomContainer)ChemFileManipulator.getAllAtomContainers(chemFile).get(0);
    configure(molecule,type);
    return molecule;
  }
 else {
    return getMolFromString(filenameOrData,type);
  }
}

Fixed version (ground truth):
/** 
 * Returns Target molecule
 * @return
 * @throws IOException
 * @throws CDKException
 */
public IAtomContainer getTarget() throws IOException, CDKException {
  String filenameOrData=argumentHandler.getTargetFilepath();
  String type=argumentHandler.getTargetType();
  if (isSingleFileTarget) {
    ISimpleChemObjectReader reader=getReader(type,filenameOrData);
    IChemFile chemFile=reader.read(new ChemFile());
    IAtomContainer molecule=ChemFileManipulator.getAllAtomContainers(chemFile).get(0);
    configure(molecule,type);
    return molecule;
  }
 else {
    return getMolFromString(filenameOrData,type);
  }
}
Program: 39445
Project: 39445
Buggy source:
public Map<String,String> getMultipleDataTypes(){
  return multipleDataTypes;
}

Fixed version (ground truth):
public Map<String,String> getMultipleDataTypes(){
  return Collections.unmodifiableMap(multipleDataTypes);
}
Program: 39446
Project: 39446
Buggy source:
public Map<String,String> getSingularDataTypes(){
  return singularDataTypes;
}

Fixed version (ground truth):
public Map<String,String> getSingularDataTypes(){
  return Collections.unmodifiableMap(singularDataTypes);
}
Program: 39447
Project: 39447
Buggy source:
/** 
 * Return Query molecule
 * @return
 * @throws IOException
 * @throws CDKException
 */
public IAtomContainer getQuery() throws IOException, CDKException {
  String filenameOrData=argumentHandler.getQueryFilepath();
  String type=argumentHandler.getQueryType();
  if (isSingleFileQuery) {
    ISimpleChemObjectReader reader=getReader(type,filenameOrData);
    IChemFile chemFile=reader.read(new ChemFile());
    IAtomContainer molecule=(IAtomContainer)ChemFileManipulator.getAllAtomContainers(chemFile).get(0);
    configure(molecule,type);
    return molecule;
  }
 else {
    return getMolFromString(filenameOrData,type);
  }
}

Fixed version (ground truth):
/** 
 * Return Query molecule
 * @return
 * @throws IOException
 * @throws CDKException
 */
public IAtomContainer getQuery() throws IOException, CDKException {
  String filenameOrData=argumentHandler.getQueryFilepath();
  String type=argumentHandler.getQueryType();
  if (isSingleFileQuery) {
    ISimpleChemObjectReader reader=getReader(type,filenameOrData);
    IChemFile chemFile=reader.read(new ChemFile());
    IAtomContainer molecule=ChemFileManipulator.getAllAtomContainers(chemFile).get(0);
    configure(molecule,type);
    return molecule;
  }
 else {
    return getMolFromString(filenameOrData,type);
  }
}
Program: 39449
Project: 39449
Buggy source:
protected synchronized boolean hasClique(Map<Integer,Integer> cliqueMap,List<Map<Integer,Integer>> mapGlobal){
  for (  Map<Integer,Integer> storedMap : mapGlobal) {
    if (cliqueMap.size() < storedMap.size()) {
      return true;
    }
    if (cliqueMap.keySet().equals(storedMap.keySet()) && cliqueMap.values().equals(storedMap.values())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param cliqueMap
 * @param mapGlobal
 * @return
 */
protected synchronized boolean hasClique(Map<Integer,Integer> cliqueMap,List<Map<Integer,Integer>> mapGlobal){
  for (  Map<Integer,Integer> storedMap : mapGlobal) {
    if (cliqueMap.size() < storedMap.size()) {
      return true;
    }
 else     if (cliqueMap.equals(storedMap)) {
      return true;
    }
  }
  return false;
}
Program: 39453
Project: 39453
Buggy source:
private boolean hasMap(Map<Integer,Integer> maps,List<Map<Integer,Integer>> mapGlobal){
  for (  Map<Integer,Integer> test : mapGlobal) {
    if (test.equals(maps)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean hasMap(Map<Integer,Integer> maps,List<Map<Integer,Integer>> mapGlobal){
  for (  Map<Integer,Integer> test : mapGlobal) {
    if (test.size() > maps.size()) {
      return true;
    }
    if (test.equals(maps)) {
      return true;
    }
  }
  return false;
}
Program: 39454
Project: 39454
Buggy source:
@Override public void onCreate(SQLiteDatabase db){
  db.execSQL(ActiveRegions.DATABASE_CREATE_ACTIVEREGIONS);
  db.execSQL(ActiveTimes.DATABASE_CREATE_ACTIVETIMES);
  db.execSQL(Contexts.DATABASE_CREATE_CONTEXTS);
  db.execSQL(ContextTimes.DATABASE_CREATE_CONTEXTTIMES);
  db.execSQL(ContextsTasks.DATABASE_CREATE_TASKCONTEXTS);
  db.execSQL(Tasks.DATABASE_CREATE_TASKS);
}

Fixed version (ground truth):
@Override public void onCreate(SQLiteDatabase db){
  db.execSQL(ActiveRegions.DATABASE_CREATE_ACTIVEREGIONS);
  db.execSQL(ActiveTimes.DATABASE_CREATE_ACTIVETIMES);
  db.execSQL(ContextRegions.DATABASE_CREATE_CONTEXTREGIONS);
  db.execSQL(Contexts.DATABASE_CREATE_CONTEXTS);
  db.execSQL(ContextTimes.DATABASE_CREATE_CONTEXTTIMES);
  db.execSQL(Families.DATABASE_CREATE_FAMILIES);
  db.execSQL(ContextsTasks.DATABASE_CREATE_TASKCONTEXTS);
  db.execSQL(Tasks.DATABASE_CREATE_TASKS);
}
Program: 39455
Project: 39455
Buggy source:
public static void main(String[] args) throws Exception {
  if (args.length != 2) {
    System.err.println("String_Node_Str" + ProtographClient.class.getSimpleName() + "String_Node_Str");
    return;
  }
  String host=args[0];
  int port=Integer.parseInt(args[1]);
  ProtographClient client=new ProtographClient(host,port);
  ConsoleReader reader=new ConsoleReader();
  for (; ; ) {
    String line=reader.readLine();
    if (line == null) {
      break;
    }
    List<JSONObject> results=client.exec(line.trim() + "String_Node_Str");
    if (null == results) {
      log.info("String_Node_Str");
    }
 else {
      int c=0;
      for (      JSONObject result : results) {
        c++;
        log.info(c + "String_Node_Str" + result.toString(4));
      }
    }
    if (line.toLowerCase().equals("String_Node_Str")) {
      client.disconnect();
      break;
    }
  }
  client.disconnect();
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  if (args.length != 2) {
    System.err.println("String_Node_Str" + ProtographClient.class.getSimpleName() + "String_Node_Str");
    return;
  }
  String host=args[0];
  int port=Integer.parseInt(args[1]);
  ProtographClient client=new ProtographClient(host,port);
  ConsoleReader reader=new ConsoleReader();
  for (; ; ) {
    String line=reader.readLine();
    if (line == null) {
      break;
    }
    List<JSONObject> results=client.exec(line.trim() + "String_Node_Str");
    if (null == results) {
      log.info("String_Node_Str");
    }
 else {
      if (results.size() == 0) {
        log.info("String_Node_Str");
      }
 else {
        int c=0;
        for (        JSONObject result : results) {
          c++;
          log.info(c + "String_Node_Str" + result.toString(4));
        }
      }
    }
    if (line.toLowerCase().equals("String_Node_Str")) {
      client.disconnect();
      break;
    }
  }
  client.disconnect();
}
Program: 39457
Project: 39457
Buggy source:
public ChannelPipeline getPipeline() throws Exception {
  ChannelPipeline pipeline=pipeline();
  pipeline.addLast("String_Node_Str",new DelimiterBasedFrameDecoder(8192,Delimiters.lineDelimiter()));
  pipeline.addLast("String_Node_Str",new StringDecoder());
  pipeline.addLast("String_Node_Str",new StringEncoder());
  pipeline.addLast("String_Node_Str",client.getProtographClientHandler());
  return pipeline;
}

Fixed version (ground truth):
public ChannelPipeline getPipeline() throws Exception {
  ChannelPipeline pipeline=pipeline();
  pipeline.addLast("String_Node_Str",new DelimiterBasedFrameDecoder(65535 * 2,Delimiters.lineDelimiter()));
  pipeline.addLast("String_Node_Str",new StringDecoder());
  pipeline.addLast("String_Node_Str",new StringEncoder());
  pipeline.addLast("String_Node_Str",client.getProtographClientHandler());
  return pipeline;
}
Program: 39458
Project: 39458
Buggy source:
public void onError(String err){
  super.onError(err);
  log.info("String_Node_Str" + err);
  this.err=err;
  success=false;
}

Fixed version (ground truth):
public void onError(String err){
  super.onError(err);
  this.err=err;
  success=false;
}
Program: 39459
Project: 39459
Buggy source:
public void onComplete(){
  super.onComplete();
  log.info("String_Node_Str");
}

Fixed version (ground truth):
public void onComplete(){
  super.onComplete();
}
Program: 39460
Project: 39460
Buggy source:
public void onResult(String result){
  log.info("String_Node_Str" + result);
  results.add(result);
}

Fixed version (ground truth):
public void onResult(String result){
  results.add(result);
}
Program: 39463
Project: 39463
Buggy source:
public Graph(String graphName) throws Exception {
  this.graphName=graphName;
  gr=new ListenableDirectedWeightedGraph<JSONVertex,JSONEdge>(JSONEdge.class);
  connectivityInspector=new ConnectivityInspector<JSONVertex,JSONEdge>(gr);
  vertices=new ConcurrentHashMap<String,JSONVertex>();
  gr.addVertexSetListener(this);
  gr.addGraphListener(this);
  gr.addVertexSetListener(connectivityInspector);
  gr.addGraphListener(connectivityInspector);
  executorService=Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() - 1);
  fiberFactory=new PoolFiberFactory(executorService);
  vertexProcesses=new ProcessGroup<JSONVertex,JSONObject>(this,"String_Node_Str",executorService,fiberFactory);
  edgeProcesses=new ProcessGroup<JSONEdge,JSONObject>(this,"String_Node_Str",executorService,fiberFactory);
  graphProcesses=new ProcessGroup<EventObject,JSONObject>(this,"String_Node_Str",executorService,fiberFactory);
  luceneDirectory=new RAMDirectory();
  indexWriter=new IndexWriter(luceneDirectory,new StandardAnalyzer(Version.LUCENE_30),IndexWriter.MaxFieldLength.LIMITED);
  indexReader=indexWriter.getReader();
  searcher=new IndexSearcher(indexReader);
  processdb=new SQLDB(this.graphName);
}

Fixed version (ground truth):
public Graph(String graphName) throws Exception {
  this.graphName=graphName;
  gr=new ListenableDirectedWeightedGraph<JSONVertex,JSONEdge>(JSONEdge.class);
  connectivityInspector=new ConnectivityInspector<JSONVertex,JSONEdge>(gr);
  vertices=new ConcurrentHashMap<String,JSONVertex>();
  gr.addVertexSetListener(this);
  gr.addGraphListener(this);
  gr.addVertexSetListener(connectivityInspector);
  gr.addGraphListener(connectivityInspector);
  executorService=Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() - 1);
  fiberFactory=new PoolFiberFactory(executorService);
  vertexProcesses=new ProcessGroup<JSONVertex,JSONObject>(this,"String_Node_Str",executorService,fiberFactory);
  edgeProcesses=new ProcessGroup<JSONEdge,JSONObject>(this,"String_Node_Str",executorService,fiberFactory);
  graphProcesses=new ProcessGroup<EventObject,JSONObject>(this,"String_Node_Str",executorService,fiberFactory);
  luceneDirectory=new RAMDirectory();
  indexWriter=new IndexWriter(luceneDirectory,new StandardAnalyzer(Version.LUCENE_30),IndexWriter.MaxFieldLength.LIMITED);
  indexReader=indexWriter.getReader();
  searcher=new IndexSearcher(indexReader);
  processdb=new SQLDB(this.graphName);
  try {
    processdb.update("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    processdb.update("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}
Program: 39464
Project: 39464
Buggy source:
public String addVertex(String key,JSONObject jo) throws Exception {
  JSONVertex jv=new JSONVertex(key,jo);
  gr.addVertex(jv);
  vertices.put(key,jv);
  indexObject(key,VERTEX_TYPE,jo);
  vertexProcesses.start(key + "String_Node_Str",jv,new TestGraphProcess());
  return key;
}

Fixed version (ground truth):
public String addVertex(String key,JSONObject jo) throws Exception {
  JSONVertex jv=new JSONVertex(key,jo);
  gr.addVertex(jv);
  vertices.put(key,jv);
  indexObject(key,VERTEX_TYPE,jo);
  return key;
}
Program: 39466
Project: 39466
Buggy source:
public ProcessGroup(Graph graph,String name,ExecutorService executorService,PoolFiberFactory fiberFactory){
  this.graphRef=new WeakReference<Graph>(graph);
  this.name=name;
  processMap=new ConcurrentHashMap<String,GraphProcess<T,M>>();
  this.executorService=executorService;
  this.fiberFactory=fiberFactory;
  log.info("String_Node_Str" + name);
}

Fixed version (ground truth):
public ProcessGroup(Graph graph,String name,ExecutorService executorService,PoolFiberFactory fiberFactory){
  this.graphRef=new WeakReference<Graph>(graph);
  this.name=name;
  processMap=new ConcurrentHashMap<String,GraphProcess<T,M>>();
  this.executorService=executorService;
  this.fiberFactory=fiberFactory;
  scriptEngineMap=new ConcurrentHashMap<String,GScriptEngine>();
  log.info("String_Node_Str" + name);
}
Program: 39467
Project: 39467
Buggy source:
public void indexObject(String key,String type,JSONObject jo) throws Exception {
  Document doc=new Document();
  doc.add(new Field(TYPE_FIELD,type,Field.Store.YES,Field.Index.NOT_ANALYZED_NO_NORMS));
  doc.add(new Field(KEY_FIELD,key,Field.Store.YES,Field.Index.NOT_ANALYZED_NO_NORMS));
  if (null != jo && null != JSONObject.getNames(jo)) {
    for (    String k : JSONObject.getNames(jo)) {
      doc.add(new Field(k,jo.getString(k),Field.Store.YES,Field.Index.ANALYZED_NO_NORMS));
    }
  }
  indexWriter.updateDocument(new Term(KEY_FIELD,key),doc);
  refreshGraphIndex();
}

Fixed version (ground truth):
public void indexObject(String key,String type,JSONObject jo) throws Exception {
  Document doc=new Document();
  doc.add(new Field(TYPE_FIELD,type,Field.Store.YES,Field.Index.NOT_ANALYZED_NO_NORMS));
  doc.add(new Field(KEY_FIELD,key,Field.Store.YES,Field.Index.NOT_ANALYZED_NO_NORMS));
  if (null != jo && null != JSONObject.getNames(jo)) {
    for (    String k : JSONObject.getNames(jo)) {
      doc.add(new Field(k,jo.getString(k),Field.Store.YES,Field.Index.NOT_ANALYZED_NO_NORMS));
    }
  }
  indexWriter.updateDocument(new Term(KEY_FIELD,key),doc);
  refreshGraphIndex();
}
Program: 39469
Project: 39469
Buggy source:
public void kill() throws Exception {
  fiber.dispose();
  log("String_Node_Str" + name);
}

Fixed version (ground truth):
public void kill() throws Exception {
  beforeKill();
  fiber.dispose();
  log("String_Node_Str" + name);
}
Program: 39470
Project: 39470
Buggy source:
public JSONEdge getEdge(String key) throws Exception {
  JSONObject jsonVertex=get(key);
  JSONVertex fromVertex=vertices.get(jsonVertex.getString("String_Node_Str"));
  JSONVertex toVertex=vertices.get(jsonVertex.getString("String_Node_Str"));
  return gr.getEdge(fromVertex,toVertex);
}

Fixed version (ground truth):
public JSONEdge getEdge(String key) throws Exception {
  JSONObject jsonEdge=get(key);
  JSONVertex fromVertex=vertices.get(jsonEdge.getString("String_Node_Str"));
  JSONVertex toVertex=vertices.get(jsonEdge.getString("String_Node_Str"));
  return gr.getEdge(fromVertex,toVertex);
}
Program: 39472
Project: 39472
Buggy source:
/** 
 * Start the playback. This function goes through an infinite loop (until it is stopped using the stop() method). The matrix of samples and beats is divided by the number of beats. On each iteration, a BPM callback is sent back to the objects that were registered on the OnBPMListener().
 */
public void play(){
  playback=new Runnable(){
    int count=0;
    public void run(){
      if (mOnBPMListener != null)       mOnBPMListener.onBPM(count);
      while (playing) {
        long millis=System.currentTimeMillis();
        for (int i=0; i < rows; i++)         if (matrix[i][count] != 0)         sound.play(samples[i],100,100,1,0,1);
        count=(count + 1) % beats;
        long next=(60 * 1000) / bpm;
        try {
          Thread.sleep(next - (System.currentTimeMillis() - millis));
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
    }
  }
;
  playing=true;
  Thread thandler=new Thread(playback);
  thandler.start();
}

Fixed version (ground truth):
/** 
 * Start the playback. This function goes through an infinite loop (until it is stopped using the stop() method). The matrix of samples and beats is divided by the number of beats. On each iteration, a BPM callback is sent back to the objects that were registered on the OnBPMListener().
 */
public void play(){
  playback=new Runnable(){
    int count=0;
    public void run(){
      while (playing) {
        if (mOnBPMListener != null)         mOnBPMListener.onBPM(count);
        long millis=System.currentTimeMillis();
        for (int i=0; i < rows; i++)         if (matrix[i][count] != 0)         sound.play(samples[i],100,100,1,0,1);
        count=(count + 1) % beats;
        long next=(60 * 1000) / bpm;
        try {
          Thread.sleep(next - (System.currentTimeMillis() - millis));
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
    }
  }
;
  playing=true;
  Thread thandler=new Thread(playback);
  thandler.start();
}
Program: 39473
Project: 39473
Buggy source:
public void run(){
  if (mOnBPMListener != null)   mOnBPMListener.onBPM(count);
  while (playing) {
    long millis=System.currentTimeMillis();
    for (int i=0; i < rows; i++)     if (matrix[i][count] != 0)     sound.play(samples[i],100,100,1,0,1);
    count=(count + 1) % beats;
    long next=(60 * 1000) / bpm;
    try {
      Thread.sleep(next - (System.currentTimeMillis() - millis));
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void run(){
  while (playing) {
    if (mOnBPMListener != null)     mOnBPMListener.onBPM(count);
    long millis=System.currentTimeMillis();
    for (int i=0; i < rows; i++)     if (matrix[i][count] != 0)     sound.play(samples[i],100,100,1,0,1);
    count=(count + 1) % beats;
    long next=(60 * 1000) / bpm;
    try {
      Thread.sleep(next - (System.currentTimeMillis() - millis));
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
}
Program: 39474
Project: 39474
Buggy source:
@Override public void validate() throws ConfigurationException {
  super.validate();
  Validate.configurationDirectoryExists(catalinaHome,"String_Node_Str" + "String_Node_Str" + catalinaHome + "String_Node_Str");
  Validate.configurationDirectoryExists(javaHome,"String_Node_Str" + "String_Node_Str" + javaHome + "String_Node_Str");
  Validate.isValidFile(catalinaHome + "String_Node_Str" + serverConfig,"String_Node_Str" + catalinaHome + "String_Node_Str"+ serverConfig+ "String_Node_Str");
  this.setOutputToConsole(AccessController.doPrivileged(new PrivilegedAction<Boolean>(){
    @Override public Boolean run(){
      final String val=System.getProperty("String_Node_Str");
      return val == null || !"String_Node_Str".equals(val);
    }
  }
));
}

Fixed version (ground truth):
@Override public void validate() throws ConfigurationException {
  super.validate();
  Validate.configurationDirectoryExists(catalinaHome,"String_Node_Str" + "String_Node_Str" + catalinaHome + "String_Node_Str");
  Validate.configurationDirectoryExists(javaHome,"String_Node_Str" + "String_Node_Str" + javaHome + "String_Node_Str");
  Validate.isValidFile(getCatalinaBase() + "String_Node_Str" + serverConfig,"String_Node_Str" + getCatalinaBase() + "String_Node_Str"+ serverConfig+ "String_Node_Str");
  this.setOutputToConsole(AccessController.doPrivileged(new PrivilegedAction<Boolean>(){
    @Override public Boolean run(){
      final String val=System.getProperty("String_Node_Str");
      return val == null || !"String_Node_Str".equals(val);
    }
  }
));
}
Program: 39475
Project: 39475
Buggy source:
@Override public ContainerMethodExecutor deploy(Context context,Archive<?> archive) throws DeploymentException {
  if (archive instanceof WebArchive) {
    ArchivePath sunWebXmlPath=ArchivePaths.create("String_Node_Str");
    if (!archive.contains(sunWebXmlPath)) {
      ((WebArchive)archive).addWebResource("String_Node_Str","String_Node_Str");
    }
  }
  return super.deploy(context,archive);
}

Fixed version (ground truth):
@Override public ContainerMethodExecutor deploy(Context context,Archive<?> archive) throws DeploymentException {
  if (WebArchive.class.isInstance(archive)) {
    ArchivePath sunWebXmlPath=ArchivePaths.create("String_Node_Str");
    if (!archive.contains(sunWebXmlPath)) {
      ((WebArchive)archive).addWebResource("String_Node_Str","String_Node_Str");
    }
  }
  return super.deploy(context,archive);
}
Program: 39476
Project: 39476
Buggy source:
@Override public ContainerMethodExecutor deploy(Context context,Archive<?> archive) throws DeploymentException {
  if (WebArchive.class.isInstance(archive)) {
    ArchivePath sunWebXmlPath=ArchivePaths.create("String_Node_Str");
    if (!archive.contains(sunWebXmlPath)) {
      ((WebArchive)archive).addWebResource("String_Node_Str","String_Node_Str");
    }
  }
  return super.deploy(context,archive);
}

Fixed version (ground truth):
@Override public ContainerMethodExecutor deploy(Context context,Archive<?> archive) throws DeploymentException {
  if (WebArchive.class.isInstance(archive)) {
    ArchivePath sunWebXmlPath=ArchivePaths.create("String_Node_Str");
    if (!archive.contains(sunWebXmlPath)) {
      WebArchive.class.cast(archive).addWebResource("String_Node_Str","String_Node_Str");
    }
  }
  return super.deploy(context,archive);
}
Program: 39477
Project: 39477
Buggy source:
public static <T>ClassExecutorWithInput<T> classExecutorWithInput(Class<T> applyingClass,Object... constructorParameters){
  return new FunkyExecutorWithInput<T>(classExecutor(applyingClass,constructorParameters));
}

Fixed version (ground truth):
public static <T>ClassExecutorWithInput<T> classExecutorWithInput(Class<T> applyingClass,Object... constructorArguments){
  return new FunkyExecutorWithInput<T>(classExecutor(applyingClass,constructorArguments));
}
Program: 39478
Project: 39478
Buggy source:
public static <T>ClassExecutor<T> classExecutor(Class<T> applyingClass,Object... constructorParameters){
  return new FunkyExecutor<T>(applyingClass,constructorParameters);
}

Fixed version (ground truth):
/** 
 * @param constructorArguments if you want the  {@link ClassExecutor} to be serialized, allconstructorArguments elements should be  {@link Serializable}.
 */
public static <T>ClassExecutor<T> classExecutor(Class<T> applyingClass,Object... constructorArguments){
  return new FunkyExecutor<T>(applyingClass,constructorArguments);
}
Program: 39479
Project: 39479
Buggy source:
FunkyExecutor(Class<T> applyingClass,Object... constructorArguments){
  constructor=extractConstructor(applyingClass);
  constructionArguments=extractConstructionArguments(constructor,constructorArguments);
}

Fixed version (ground truth):
/** 
 * @param constructorArguments if you want the  {@link ClassExecutor} to be serialized, allconstructorArguments elements should be  {@link Serializable}.
 */
FunkyExecutor(Class<T> applyingClass,Object... constructorArguments){
  this.applyingClass=applyingClass;
  constructor=extractConstructor(applyingClass);
  constructionArguments=extractConstructionArguments(constructor,constructorArguments);
}
Program: 39480
Project: 39480
Buggy source:
@Override public String toString(){
  return getClass().getSimpleName() + "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return executor.getClassSimpleName() + "String_Node_Str";
}
Program: 39481
Project: 39481
Buggy source:
@Test(expected=IllegalArgumentException.class) public void invalidInput(){
class NotFortyTwo extends Const<String> {
{
      if ("String_Node_Str".equals(t))       invalid("String_Node_Str");
    }
  }
  List<String> list=Lists.newArrayList();
  Collection<String> strings=Constraints.constrainedCollection(list,withConst(NotFortyTwo.class));
  strings.add("String_Node_Str");
}

Fixed version (ground truth):
@Test(expected=IllegalArgumentException.class) public void invalidInput(){
  strings.add("String_Node_Str");
}
Program: 39482
Project: 39482
Buggy source:
@Test public void validInput(){
class NotFortyTwo extends Const<String> {
{
      if ("String_Node_Str".equals(t))       invalid("String_Node_Str");
    }
  }
  List<String> list=Lists.newArrayList();
  Collection<String> strings=Constraints.constrainedCollection(list,withConst(NotFortyTwo.class));
  strings.add("String_Node_Str");
}

Fixed version (ground truth):
@Test public void validInput(){
  strings.add("String_Node_Str");
}
Program: 39483
Project: 39483
Buggy source:
public Func(){
  f=FunkyExecutorWithInput.getThreadLocalParameter();
}

Fixed version (ground truth):
public Func(){
  f=FunkyExecutorWithInput.<From>getThreadLocalParameter();
}
Program: 39484
Project: 39484
Buggy source:
public Pred(){
  t=FunkyExecutorWithInput.getThreadLocalParameter();
}

Fixed version (ground truth):
public Pred(){
  t=FunkyExecutorWithInput.<T>getThreadLocalParameter();
}
Program: 39485
Project: 39485
Buggy source:
@Test public void testThrows(){
class Fails extends Comp<Object> {
{
      r=42 / 0;
    }
  }
  try {
    withComp(Fails.class).compare(null,null);
    fail();
  }
 catch (  RuntimeException e) {
    assertTrue(e.getCause() instanceof InvocationTargetException);
    assertTrue(e.getCause().getCause() instanceof ArithmeticException);
  }
}

Fixed version (ground truth):
@Test public void testThrows(){
class Fails extends Comp<Object> {
{
      r=42 / 0;
    }
  }
  try {
    withComp(Fails.class).compare(null,null);
    fail();
  }
 catch (  RuntimeException e) {
    assertTrue(e instanceof ArithmeticException);
  }
}
Program: 39486
Project: 39486
Buggy source:
@Test public void testThrows(){
class Fails extends Func<Object,Integer> {
{
      t=42 / 0;
    }
  }
  try {
    withFunc(Fails.class).apply(null);
    fail();
  }
 catch (  RuntimeException e) {
    assertTrue(e.getCause() instanceof InvocationTargetException);
    assertTrue(e.getCause().getCause() instanceof ArithmeticException);
  }
}

Fixed version (ground truth):
@Test public void testThrows(){
class Fails extends Func<Object,Integer> {
{
      t=42 / 0;
    }
  }
  try {
    withFunc(Fails.class).apply(null);
    fail();
  }
 catch (  RuntimeException e) {
    assertTrue(e instanceof ArithmeticException);
  }
}
Program: 39487
Project: 39487
Buggy source:
@Test public void testThrows(){
class Fails extends Pred<Object> {
{
      r=42 / 0 > 69;
    }
  }
  try {
    withPred(Fails.class).apply(null);
    fail();
  }
 catch (  RuntimeException e) {
    assertTrue(e.getCause() instanceof InvocationTargetException);
    assertTrue(e.getCause().getCause() instanceof ArithmeticException);
  }
}

Fixed version (ground truth):
@Test public void testThrows(){
class Fails extends Pred<Object> {
{
      r=42 / 0 > 69;
    }
  }
  try {
    withPred(Fails.class).apply(null);
    fail();
  }
 catch (  RuntimeException e) {
    assertTrue(e instanceof ArithmeticException);
  }
}
Program: 39488
Project: 39488
Buggy source:
protected Stopped(StoppedAnimationFactory factory,BaseMovement movement) throws SlickException {
  String movementName=movement.toString();
  name="String_Node_Str" + movementName;
  factory.from(movementName,MOVEMENT_ANIMATION_DELAY);
}

Fixed version (ground truth):
protected Stopped(StoppedAnimationFactory factory,BaseMovement movement) throws SlickException {
  name="String_Node_Str" + movement.name();
  factory.from(movement.name(),MOVEMENT_ANIMATION_DELAY);
}
Program: 39489
Project: 39489
Buggy source:
public void move(){
  currentCollisionPolygon=currentMovement.move(currentCollisionPolygon,SPEED);
}

Fixed version (ground truth):
public void move(){
  currentMovement=movementStrategy.availableMovement(currentCollisionPolygon,SPEED);
  currentCollisionPolygon=currentMovement.move(currentCollisionPolygon,SPEED);
}
Program: 39490
Project: 39490
Buggy source:
public void updateDirection(Movement movement){
  currentMovement=movementStrategy.next(movement,currentCollisionPolygon,SPEED);
}

Fixed version (ground truth):
public void updateDirection(Movement movement){
  movementStrategy.update(movement,currentCollisionPolygon,SPEED);
}
Program: 39491
Project: 39491
Buggy source:
public PacMan from(CollisionPolygon collisionPolygon,Board board) throws SlickException {
  movementBuilder.buildMovements();
  return new PacMan(collisionPolygon,new BufferedMovementStrategy(board,movementBuilder.defaultMovement(),new NullMovement()),board);
}

Fixed version (ground truth):
public PacMan from(CollisionPolygon collisionPolygon,Board board) throws SlickException {
  movementBuilder.buildMovements();
  return new PacMan(collisionPolygon,new BufferedMovementStrategy(board,movementBuilder,new NullMovement()),board);
}
Program: 39492
Project: 39492
Buggy source:
public Down(AnimationFactory animationFactory) throws SlickException {
  super(animationFactory);
}

Fixed version (ground truth):
public Down(MovementAnimationFactory animationFactory) throws SlickException {
  super("String_Node_Str",animationFactory);
}
Program: 39493
Project: 39493
Buggy source:
public Left(AnimationFactory animationFactory) throws SlickException {
  super(animationFactory);
}

Fixed version (ground truth):
public Left(MovementAnimationFactory animationFactory) throws SlickException {
  super("String_Node_Str",animationFactory);
}
Program: 39494
Project: 39494
Buggy source:
protected Movement(){
}

Fixed version (ground truth):
public Movement(String name,MovementAnimationFactory animationFactory) throws SlickException {
  this.name=name;
  animation=animationFactory.from(name,ANIMATION_DELAY);
}
Program: 39495
Project: 39495
Buggy source:
public void buildMovements() throws SlickException {
  animationFactory=new AnimationFactory();
  defaultDirection=new Left(animationFactory);
  movements=new HashMap<Integer,Movement>();
  movements.put(KEY_DOWN,new Down(animationFactory));
  movements.put(KEY_UP,new Up(animationFactory));
  movements.put(KEY_RIGHT,new Right(animationFactory));
  movements.put(KEY_LEFT,defaultDirection);
}

Fixed version (ground truth):
public void buildMovements() throws SlickException {
  MovementAnimationFactory animationFactory=new MovementAnimationFactory();
  Left left=new Left(animationFactory);
  Down down=new Down(animationFactory);
  Up up=new Up(animationFactory);
  Right right=new Right(animationFactory);
  defaultDirection=left;
  movements=new HashMap<Integer,Movement>();
  movements.put(KEY_DOWN,down);
  movements.put(KEY_UP,up);
  movements.put(KEY_RIGHT,right);
  movements.put(KEY_LEFT,left);
  stoppedMovements=new HashMap<Movement,Stopped>();
  StoppedAnimationFactory stoppedFactory=new StoppedAnimationFactory();
  stoppedMovements.put(up,new Stopped(stoppedFactory,up));
  stoppedMovements.put(down,new Stopped(stoppedFactory,down));
  stoppedMovements.put(right,new Stopped(stoppedFactory,right));
  stoppedMovements.put(left,new Stopped(stoppedFactory,left));
}
Program: 39496
Project: 39496
Buggy source:
public Right(AnimationFactory animationFactory) throws SlickException {
  super(animationFactory);
}

Fixed version (ground truth):
public Right(MovementAnimationFactory animationFactory) throws SlickException {
  super("String_Node_Str",animationFactory);
}
Program: 39497
Project: 39497
Buggy source:
public Up(AnimationFactory animationFactory) throws SlickException {
  super(animationFactory);
}

Fixed version (ground truth):
public Up(MovementAnimationFactory animationFactory) throws SlickException {
  super("String_Node_Str",animationFactory);
}
Program: 39498
Project: 39498
Buggy source:
public Animation from(Movement movement,Integer delay,boolean stopped) throws SlickException {
  String prefix="String_Node_Str" + File.separator + "String_Node_Str"+ File.separator+ movement+ File.separator+ "String_Node_Str"+ movement+ "String_Node_Str";
  String extension="String_Node_Str";
  List<String> paths=new ArrayList<String>();
  if (stopped) {
    paths.add(prefix + 1 + extension);
  }
 else {
    for (int i=0; i < TOTAL_MOVEMENT_FRAMES; i++) {
      paths.add(prefix + i + extension);
    }
  }
  return from(paths,delay);
}

Fixed version (ground truth):
public Animation from(List<String> paths,Integer delay) throws SlickException {
  Image[] frames=new Image[paths.size()];
  for (int i=0; i < frames.length; i++) {
    frames[i]=new Image(paths.get(i));
  }
  return new Animation(frames,delay);
}
Program: 39499
Project: 39499
Buggy source:
public MovementBuilder(){
}

Fixed version (ground truth):
public MovementBuilder(){
  this.nullMovement=new NullMovement();
}
Program: 39500
Project: 39500
Buggy source:
protected Stopped(StoppedAnimationFactory factory,BaseMovement movement) throws SlickException {
  name="String_Node_Str" + movement.name();
  factory.from(movement.name(),MOVEMENT_ANIMATION_DELAY);
}

Fixed version (ground truth):
protected Stopped(StoppedAnimationFactory factory,BaseMovement movement) throws SlickException {
  name="String_Node_Str" + movement.name();
  animation=factory.from(movement.name(),MOVEMENT_ANIMATION_DELAY);
}