nus-yam/ex-repair huggingface dataset:
Program: 30098
Project: 30098
Buggy source:
/** 
 * Reduce this matrix to row canonical form (reduced row echelon form). This matrix is changed and returned.
 * @hops For n by m matrix: 0 to m*n+(n-1)^2*m
 * @todo TODO Optimize loops to remove 0-nominator divisions.
 */
public Matrix reduceThis(){
  int rowCount=M;
  int colCount=N;
  int lead=0;
  for (int r=0; r < rowCount; r++) {
    if (lead >= colCount)     return this;
    int i=r;
    while (Math.abs(coords[i][lead]) <= WB_Epsilon.EPSILON) {
      i++;
      if (rowCount == i) {
        i=r;
        lead++;
        if (colCount == lead) {
          return this;
        }
      }
    }
    if (i != r) {
      double[] tmpArr=coords[i];
      coords[i]=coords[r];
      coords[r]=tmpArr;
    }
    double tmp=coords[r][lead];
    for (int c=0; c < coords[r].length; c++)     coords[r][c]/=tmp;
    for (i=0; i < rowCount; i++) {
      if (i != r) {
        tmp=coords[i][lead];
        for (int c=0; c < coords[i].length; c++)         coords[i][c]-=tmp * coords[r][c];
      }
    }
    lead++;
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Reduce this matrix to row canonical form (reduced row echelon form). This matrix is changed and returned.
 */
public Matrix reduceThis(){
  int rowCount=M;
  int colCount=N;
  int lead=0;
  for (int r=0; r < rowCount; r++) {
    if (lead >= colCount)     return this;
    int i=r;
    while (Math.abs(coords[i][lead]) <= WB_Epsilon.EPSILON) {
      i++;
      if (rowCount == i) {
        i=r;
        lead++;
        if (colCount == lead) {
          return this;
        }
      }
    }
    if (i != r) {
      double[] tmpArr=coords[i];
      coords[i]=coords[r];
      coords[r]=tmpArr;
    }
    double tmp=coords[r][lead];
    for (int c=0; c < coords[r].length; c++)     coords[r][c]/=tmp;
    for (i=0; i < rowCount; i++) {
      if (i != r) {
        tmp=coords[i][lead];
        for (int c=0; c < coords[i].length; c++)         coords[i][c]-=tmp * coords[r][c];
      }
    }
    lead++;
  }
  return this;
}
Program: 30100
Project: 30100
Buggy source:
/** 
 * Invert this matrix (overwrites this and returns it).
 * @hops 31
 */
@Override public Matrix invertThis(){
  double[][] newCoords=new double[coords.length][coords[0].length];
  newCoords[0][0]=coords[1][1] * coords[2][2] - coords[1][2] * coords[2][1];
  newCoords[0][1]=coords[0][2] * coords[2][1] - coords[0][1] * coords[2][2];
  newCoords[0][2]=coords[0][1] * coords[1][2] - coords[0][2] * coords[1][1];
  newCoords[1][0]=coords[1][2] * coords[2][0] - coords[1][0] * coords[2][2];
  newCoords[1][1]=coords[0][0] * coords[2][2] - coords[0][2] * coords[2][0];
  newCoords[1][2]=coords[0][2] * coords[1][0] - coords[0][0] * coords[1][2];
  newCoords[2][0]=coords[1][0] * coords[2][1] - coords[1][1] * coords[2][0];
  newCoords[2][1]=coords[0][1] * coords[2][0] - coords[0][0] * coords[2][1];
  newCoords[2][2]=coords[0][0] * coords[1][1] - coords[0][1] * coords[1][0];
  double det=coords[0][0] * newCoords[0][0] + coords[0][1] * newCoords[1][0] + coords[0][2] * newCoords[2][0];
  this.coords=newCoords;
  return multiplyThis(1 / det);
}

Fixed version (ground truth):
/** 
 * Invert this matrix (overwrites this and returns it).
 */
@Override public Matrix invertThis(){
  double[][] newCoords=new double[coords.length][coords[0].length];
  newCoords[0][0]=coords[1][1] * coords[2][2] - coords[1][2] * coords[2][1];
  newCoords[0][1]=coords[0][2] * coords[2][1] - coords[0][1] * coords[2][2];
  newCoords[0][2]=coords[0][1] * coords[1][2] - coords[0][2] * coords[1][1];
  newCoords[1][0]=coords[1][2] * coords[2][0] - coords[1][0] * coords[2][2];
  newCoords[1][1]=coords[0][0] * coords[2][2] - coords[0][2] * coords[2][0];
  newCoords[1][2]=coords[0][2] * coords[1][0] - coords[0][0] * coords[1][2];
  newCoords[2][0]=coords[1][0] * coords[2][1] - coords[1][1] * coords[2][0];
  newCoords[2][1]=coords[0][1] * coords[2][0] - coords[0][0] * coords[2][1];
  newCoords[2][2]=coords[0][0] * coords[1][1] - coords[0][1] * coords[1][0];
  double det=coords[0][0] * newCoords[0][0] + coords[0][1] * newCoords[1][0] + coords[0][2] * newCoords[2][0];
  this.coords=newCoords;
  return multiplyThis(1 / det);
}
Program: 30101
Project: 30101
Buggy source:
/** 
 * Get the determinant of this matrix.
 * @hops 9
 */
@Override public double determinant(){
  double ret=coords[0][0] * (coords[1][1] * coords[2][2] - coords[1][2] * coords[2][1]);
  ret-=coords[0][1] * (coords[1][0] * coords[2][2] - coords[1][2] * coords[2][0]);
  ret+=coords[0][2] * (coords[1][0] * coords[2][1] - coords[1][1] * coords[2][0]);
  return ret;
}

Fixed version (ground truth):
/** 
 * Get the determinant of this matrix.
 */
@Override public double determinant(){
  double ret=coords[0][0] * (coords[1][1] * coords[2][2] - coords[1][2] * coords[2][1]);
  ret-=coords[0][1] * (coords[1][0] * coords[2][2] - coords[1][2] * coords[2][0]);
  ret+=coords[0][2] * (coords[1][0] * coords[2][1] - coords[1][1] * coords[2][0]);
  return ret;
}
Program: 30103
Project: 30103
Buggy source:
/** 
 * @param corners the input set of corners
 * @param liveEdges the (continuously updated) set of edges that still feature in the live corner list. Caller has to update this set :)
 */
public CollisionQ(Skeleton skel){
  this.skel=skel;
  faceEvents=new PriorityQueue<EdgeCollision>(Math.max(3,skel.liveCorners.size()),HeightEvent.heightComparator);
  miscEvents=new PriorityQueue<HeightEvent>(Math.max(3,skel.liveCorners.size()),HeightEvent.heightComparator);
}

Fixed version (ground truth):
public CollisionQ(Skeleton skel){
  this.skel=skel;
  faceEvents=new PriorityQueue<EdgeCollision>(Math.max(3,skel.liveCorners.size()),HeightEvent.heightComparator);
  miscEvents=new PriorityQueue<HeightEvent>(Math.max(3,skel.liveCorners.size()),HeightEvent.heightComparator);
}
Program: 30104
Project: 30104
Buggy source:
/** 
 * We rely on the fact that we can shift the point's heights without changing their locations in hashmaps.
 * @return
 */
@Override public int hashCode(){
  return System.identityHashCode(this);
}

Fixed version (ground truth):
/** 
 * We rely on the fact that we can shift the point's heights without changing their locations in hashmaps.
 * @return integer hashCode
 */
@Override public int hashCode(){
  return System.identityHashCode(this);
}
Program: 30105
Project: 30105
Buggy source:
/** 
 * Corners (unlike point3ds) are only equal to themselves. We never move a point, but can create multiple (uniques) at one location. We also change prev/next pointers to edges and other corners but need to retain hashing behaviour. Therefore we revert to the system hash.
 * @param t1
 * @return
 */
@Override public boolean equals(Object t1){
  return this == t1;
}

Fixed version (ground truth):
/** 
 * Corners (unlike point3ds) are only equal to themselves. We never move a point, but can create multiple (uniques) at one location. We also change prev/next pointers to edges and other corners but need to retain hashing behaviour. Therefore we revert to the system hash.
 * @param t1
 * @return true/false
 */
@Override public boolean equals(Object t1){
  return this == t1;
}
Program: 30106
Project: 30106
Buggy source:
/** 
 * Clones this set of corners. Creates new edges, corners and machines from the given set. Preserves currentCorners.
 * @param ribbon
 * @return
 */
public static LoopL<Corner> dupeNewAll(LoopL<Corner> ribbon){
  final Cache<Corner,Corner> cacheC=new Cache<Corner,Corner>(){
    Cache<Machine,Machine> cacheM=new Cache<Machine,Machine>(){
      @Override public Machine create(      Machine i){
        return new Machine(i.currentAngle);
      }
    }
;
    Cache<Edge,Edge> cacheE=new Cache<Edge,Edge>(){
      @Override public Edge create(      Edge i){
        Edge out=new Edge(getCorner(i.start),getCorner(i.end));
        out.setAngle(i.getAngle());
        out.machine=cacheM.get(i.machine);
        for (        Corner c : i.currentCorners) {
          out.currentCorners.add(getCorner(c));
        }
        return out;
      }
    }
;
    public Corner getCorner(    Corner input){
      Corner ner=get(input);
      return ner;
    }
    @Override public Corner create(    Corner i){
      Corner ner=new Corner(i.x,i.y);
      cache.put(i,ner);
      ner.nextC=get(i.nextC);
      ner.prevC=get(i.prevC);
      ner.nextL=cacheE.get(i.nextL);
      ner.prevL=cacheE.get(i.prevL);
      return ner;
    }
  }
;
  LoopL<Corner> loopl=new LoopL();
  for (  Loop<Corner> pLoop : ribbon) {
    Loop<Corner> loop=new Loop();
    loopl.add(loop);
    for (    Corner c : pLoop)     loop.append(cacheC.get(c));
  }
  return loopl;
}

Fixed version (ground truth):
/** 
 * Clones this set of corners. Creates new edges, corners and machines from the given set. Preserves currentCorners.
 * @param ribbon
 * @return cloned set of corners
 */
public static LoopL<Corner> dupeNewAll(LoopL<Corner> ribbon){
  final Cache<Corner,Corner> cacheC=new Cache<Corner,Corner>(){
    Cache<Machine,Machine> cacheM=new Cache<Machine,Machine>(){
      @Override public Machine create(      Machine i){
        return new Machine(i.currentAngle);
      }
    }
;
    Cache<Edge,Edge> cacheE=new Cache<Edge,Edge>(){
      @Override public Edge create(      Edge i){
        Edge out=new Edge(getCorner(i.start),getCorner(i.end));
        out.setAngle(i.getAngle());
        out.machine=cacheM.get(i.machine);
        for (        Corner c : i.currentCorners) {
          out.currentCorners.add(getCorner(c));
        }
        return out;
      }
    }
;
    public Corner getCorner(    Corner input){
      Corner ner=get(input);
      return ner;
    }
    @Override public Corner create(    Corner i){
      Corner ner=new Corner(i.x,i.y);
      cache.put(i,ner);
      ner.nextC=get(i.nextC);
      ner.prevC=get(i.prevC);
      ner.nextL=cacheE.get(i.nextL);
      ner.prevL=cacheE.get(i.prevL);
      return ner;
    }
  }
;
  LoopL<Corner> loopl=new LoopL();
  for (  Loop<Corner> pLoop : ribbon) {
    Loop<Corner> loop=new Loop();
    loopl.add(loop);
    for (    Corner c : pLoop)     loop.append(cacheC.get(c));
  }
  return loopl;
}
Program: 30107
Project: 30107
Buggy source:
/** 
 * UNTESTED!
 * @param ribbon
 * @return
 */
public static LoopL<Edge> fromPoints2d(LoopL<Point2d> ribbon){
  LoopL<Edge> loopl=new LoopL();
  Cache<Point2d,Corner> cache=new Cache<Point2d,Corner>(){
    @Override public Corner create(    Point2d i){
      return new Corner(i.x,i.y);
    }
  }
;
  for (  Loop<Point2d> pLoop : ribbon) {
    Loop<Edge> loop=new Loop();
    loopl.add(loop);
    for (    Loopable<Point2d> pair : pLoop.loopableIterator())     loop.append(new Edge(cache.get(pair.get()),cache.get(pair.getNext().get())));
  }
  return loopl;
}

Fixed version (ground truth):
/** 
 * @param ribbon
 * @return edge loops
 */
public static LoopL<Edge> fromPoints2d(LoopL<Point2d> ribbon){
  LoopL<Edge> loopl=new LoopL();
  Cache<Point2d,Corner> cache=new Cache<Point2d,Corner>(){
    @Override public Corner create(    Point2d i){
      return new Corner(i.x,i.y);
    }
  }
;
  for (  Loop<Point2d> pLoop : ribbon) {
    Loop<Edge> loop=new Loop();
    loopl.add(loop);
    for (    Loopable<Point2d> pair : pLoop.loopableIterator())     loop.append(new Edge(cache.get(pair.get()),cache.get(pair.getNext().get())));
  }
  return loopl;
}
Program: 30108
Project: 30108
Buggy source:
/** 
 * Collides a's two adjacent edges against the other given edge. Currently this handles the case that a.next, a.prev is
 * @return
 */
static Tuple3d collide(Corner a,Edge edge){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
static Tuple3d collide(Corner a,Edge edge){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 30109
Project: 30109
Buggy source:
/** 
 * Hash is agnostic to which edge is in a, b and c
 * @return
 */
@Override public int hashCode(){
  int hash=3;
  hash+=(this.a != null ? this.a.hashCode() : 0);
  hash+=(this.b != null ? this.b.hashCode() : 0);
  hash+=(this.c != null ? this.c.hashCode() : 0);
  return hash * 31;
}

Fixed version (ground truth):
/** 
 * Hash is agnostic to which edge is in a, b and c
 * @return hashcode
 */
@Override public int hashCode(){
  int hash=3;
  hash+=(this.a != null ? this.a.hashCode() : 0);
  hash+=(this.b != null ? this.b.hashCode() : 0);
  hash+=(this.c != null ? this.c.hashCode() : 0);
  return hash * 31;
}
Program: 30110
Project: 30110
Buggy source:
public HeightCollision(List<EdgeCollision> coHeighted){
  this.coHeighted=coHeighted;
  height=coHeighted.get(0).getHeight();
}

Fixed version (ground truth):
/** 
 * @param coHeighted .size() > 1
 */
public HeightCollision(List<EdgeCollision> coHeighted){
  this.coHeighted=coHeighted;
  height=coHeighted.get(0).getHeight();
}
Program: 30111
Project: 30111
Buggy source:
/** 
 * @param A Each rows of A is a cartesian point
 * @param b the offset of the matrix (normally 0?)
 * @return
 */
public static Vector3d solve(final Matrix3d A,final Tuple3d offset){
  final double[][] as=new double[][]{{A.m00,A.m01,A.m02},{A.m10,A.m11,A.m12},{A.m20,A.m21,A.m22}};
  final Matrix am=new Matrix(as);
  final double[] bs=new double[]{offset.x,offset.y,offset.z};
  final Matrix bm=new Matrix(bs,3);
  final double[][] out=am.solve(bm).getArray();
  final double d=offset.x * out[0][0] + offset.y * out[1][0] + offset.z * out[2][0];
  return new Vector3d(out[0][0],out[1][0],out[2][0]);
}

Fixed version (ground truth):
public static Vector3d solve(final Matrix3d A,final Tuple3d offset){
  final double[][] as=new double[][]{{A.m00,A.m01,A.m02},{A.m10,A.m11,A.m12},{A.m20,A.m21,A.m22}};
  final Matrix am=new Matrix(as);
  final double[] bs=new double[]{offset.x,offset.y,offset.z};
  final Matrix bm=new Matrix(bs,3);
  final double[][] out=am.solve(bm).getArray();
  final double d=offset.x * out[0][0] + offset.y * out[1][0] + offset.z * out[2][0];
  return new Vector3d(out[0][0],out[1][0],out[2][0]);
}
Program: 30112
Project: 30112
Buggy source:
/** 
 * Project point onto line
 * @param ept
 * @return
 */
public Point3d projectLine(Point3d ept){
  return project(ept,false);
}

Fixed version (ground truth):
/** 
 * Project point onto line
 * @param ept
 * @return projected point
 */
public Point3d projectLine(Point3d ept){
  return project(ept,false);
}
Program: 30113
Project: 30113
Buggy source:
/** 
 * @param directions the directions to set
 */
public void addHeightEvent(HeightEvent dir){
  events.add(dir);
  sortHeightEvents();
}

Fixed version (ground truth):
public void addHeightEvent(HeightEvent dir){
  events.add(dir);
  sortHeightEvents();
}
Program: 30114
Project: 30114
Buggy source:
/** 
 * Removes entire list indexed by key
 * @param key
 * @return
 */
public List<B> remove(A key){
  return map.remove(key);
}

Fixed version (ground truth):
/** 
 * Removes entire list indexed by key
 * @param key
 * @return list indexed by key
 */
public List<B> remove(A key){
  return map.remove(key);
}
Program: 30115
Project: 30115
Buggy source:
/** 
 * Given two sets of leading corners, find the corner (if any) that lies on both edges
 * @return
 */
private Corner findAdjacent(Set<Corner> first,Set<Corner> second){
  for (  Corner c : first)   if (second.contains(c.nextC))   return c.nextC;
  return null;
}

Fixed version (ground truth):
/** 
 * Given two sets of leading corners, find the corner (if any) that lies on both edges
 * @return Corner
 */
private Corner findAdjacent(Set<Corner> first,Set<Corner> second){
  for (  Corner c : first)   if (second.contains(c.nextC))   return c.nextC;
  return null;
}
Program: 30116
Project: 30116
Buggy source:
/** 
 * When caculating an offset, we can assume that all edges add a face at every interval this returns the number of faces below this face.
 * @return
 */
public int getParentCount(){
  int count=-1;
  Face f=this;
  while (f != null) {
    count++;
    f=f.parent;
  }
  return count;
}

Fixed version (ground truth):
/** 
 * When calculating an offset, we can assume that all edges add a face at every interval this returns the number of faces below this face.
 * @return parent count
 */
public int getParentCount(){
  int count=-1;
  Face f=this;
  while (f != null) {
    count++;
    f=f.parent;
  }
  return count;
}
Program: 30117
Project: 30117
Buggy source:
/** 
 * One edge may start in two locations at the same time. To accomodate this, you call newEdge once per new edge, then new Defining Segment for each corner that references that edge.
 * @param startCorner The corner at the start of the edge at the base of this edge
 * @param aParentCorner A corner whose
 * @param profileFeatures
 */
public void newEdge(Edge e,Corner aParentLeadingCorner){
}

Fixed version (ground truth):
public void newEdge(Edge e,Corner aParentLeadingCorner){
}
Program: 30118
Project: 30118
Buggy source:
/** 
 * Some faces (such as base-plates for globals) can't really be classified nicely. They live here.
 * @param geom
 */
public void addNonSkeletonOutputFace(LoopL<Point3d> points,Vector3d norm){
  nonSkelFaces.add(new LoopNormal(points,norm));
}

Fixed version (ground truth):
public void addNonSkeletonOutputFace(LoopL<Point3d> points,Vector3d norm){
  nonSkelFaces.add(new LoopNormal(points,norm));
}
Program: 30119
Project: 30119
Buggy source:
/** 
 * Two parallel faces have become consecutive, remove info about toGo, add to toKeep
 * @toKeep leading corner to keep
 * @toGo leading corner to go
 */
void merge(Corner toKeep,Corner toGo){
  Face toGoFace=faces.get(toGo.nextL.start), toKeepFace=faces.get(toKeep.nextL.start);
  if (toGoFace == null) {
    System.err.println("String_Node_Str");
    return;
  }
  toKeepFace.definingSE.addAll(toGoFace.definingSE);
  toKeepFace.results.addEntriesFrom(toGoFace.results);
  toKeepFace.definingCorners.addAll(toGoFace.definingCorners);
  faces.put(toGo.nextL.start,toKeepFace);
  faces.put(toGo,toKeepFace);
}

Fixed version (ground truth):
/** 
 * Two parallel faces have become consecutive, remove info about toGo, add to toKeep
 */
void merge(Corner toKeep,Corner toGo){
  Face toGoFace=faces.get(toGo.nextL.start), toKeepFace=faces.get(toKeep.nextL.start);
  if (toGoFace == null) {
    System.err.println("String_Node_Str");
    return;
  }
  toKeepFace.definingSE.addAll(toGoFace.definingSE);
  toKeepFace.results.addEntriesFrom(toGoFace.results);
  toKeepFace.definingCorners.addAll(toGoFace.definingCorners);
  faces.put(toGo.nextL.start,toKeepFace);
  faces.put(toGo,toKeepFace);
}
Program: 30120
Project: 30120
Buggy source:
/** 
 * @Deprecated
 * @param cap height (flat-topped skeleton) to finish at
 */
public Skeleton(LoopL<Edge> input,final double cap){
  setupForEdges(input);
  qu.add(new HeightEvent(){
    @Override public double getHeight(){
      return cap;
    }
    @Override public boolean process(    Skeleton skel){
      SkeletonCapUpdate capUpdate=new SkeletonCapUpdate(skel);
      flatTop=capUpdate.getCap(cap);
      capUpdate.update(new LoopL(),new SetCorrespondence<Corner,Corner>(),new DHash<Corner,Corner>());
      return true;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @param cap height (flat-topped skeleton) to finish at
 */
public Skeleton(LoopL<Edge> input,final double cap){
  setupForEdges(input);
  qu.add(new HeightEvent(){
    @Override public double getHeight(){
      return cap;
    }
    @Override public boolean process(    Skeleton skel){
      SkeletonCapUpdate capUpdate=new SkeletonCapUpdate(skel);
      flatTop=capUpdate.getCap(cap);
      capUpdate.update(new LoopL(),new SetCorrespondence<Corner,Corner>(),new DHash<Corner,Corner>());
      return true;
    }
  }
);
}
Program: 30121
Project: 30121
Buggy source:
public static WB_Classification classifyPointToLine2D(final WB_Coordinate p,final WB_Line L){
  final double dist=-L.getDirection().yd() * p.xd() + L.getDirection().xd() * p.yd() + L.getOrigin().xd() * L.getDirection().yd() - L.getOrigin().yd() * L.getDirection().xd();
  if (dist > WB_Epsilon.EPSILON) {
    return WB_Classification.FRONT;
  }
  if (dist < -WB_Epsilon.EPSILON) {
    return WB_Classification.BACK;
  }
  return WB_Classification.ON;
}

Fixed version (ground truth):
/** 
 * Classify 2D point to 2D line.
 * @param p 2D point
 * @param L
 * @return WB_Classification.FRONT, WB_Classification.BACK,WB_Classification.ON
 */
public static WB_Classification classifyPointToLine2D(final WB_Coordinate p,final WB_Line L){
  final double dist=-L.getDirection().yd() * p.xd() + L.getDirection().xd() * p.yd() + L.getOrigin().xd() * L.getDirection().yd() - L.getOrigin().yd() * L.getDirection().xd();
  if (dist > WB_Epsilon.EPSILON) {
    return WB_Classification.FRONT;
  }
  if (dist < -WB_Epsilon.EPSILON) {
    return WB_Classification.BACK;
  }
  return WB_Classification.ON;
}
Program: 30122
Project: 30122
Buggy source:
public void saveGradleProperties(Properties prop) throws IOException {
  FileOutputStream os=new FileOutputStream(getProjectDir().getAbsolutePath() + "String_Node_Str");
  prop.store(os,null);
}

Fixed version (ground truth):
public void saveGradleProperties(Properties prop,File projectPath) throws IOException {
  FileOutputStream os=new FileOutputStream(projectPath.getAbsolutePath() + "String_Node_Str");
  prop.store(os,null);
}
Program: 30123
Project: 30123
Buggy source:
public void updateEngineVersion(File projectPath) throws FileNotFoundException, IOException {
  Properties prop=getGradleProperties(projectPath);
  prop.setProperty(Config.BLADE_ENGINE_VERSION_PROP,Versions.getVersion());
  prop.setProperty("String_Node_Str",Versions.getLibgdxVersion());
  prop.setProperty("String_Node_Str",Versions.getRoboVMVersion());
  prop.setProperty("String_Node_Str",Versions.getROBOVMGradlePluginVersion());
  prop.setProperty("String_Node_Str",Versions.getAndroidGradlePluginVersion());
  prop.setProperty("String_Node_Str",Versions.getBladeInkVersion());
  saveGradleProperties(prop);
}

Fixed version (ground truth):
public void updateEngineVersion(File projectPath) throws FileNotFoundException, IOException {
  Properties prop=getGradleProperties(projectPath);
  prop.setProperty(Config.BLADE_ENGINE_VERSION_PROP,Versions.getVersion());
  prop.setProperty("String_Node_Str",Versions.getLibgdxVersion());
  prop.setProperty("String_Node_Str",Versions.getRoboVMVersion());
  prop.setProperty("String_Node_Str",Versions.getROBOVMGradlePluginVersion());
  prop.setProperty("String_Node_Str",Versions.getAndroidGradlePluginVersion());
  prop.setProperty("String_Node_Str",Versions.getBladeInkVersion());
  saveGradleProperties(prop,projectPath);
}
Program: 30124
Project: 30124
Buggy source:
/** 
 * Saves the selected version
 */
private void setCurrentVersion(String version){
  try {
    Properties prop=Ctx.project.getGradleProperties(Ctx.project.getProjectDir());
    prop.setProperty("String_Node_Str",version);
    Ctx.project.saveGradleProperties(prop);
  }
 catch (  IOException e) {
    Message.showMsg(getStage(),"String_Node_Str",3);
  }
}

Fixed version (ground truth):
/** 
 * Saves the selected version
 */
private void setCurrentVersion(String version){
  try {
    Properties prop=Ctx.project.getGradleProperties(Ctx.project.getProjectDir());
    prop.setProperty("String_Node_Str",version);
    Ctx.project.saveGradleProperties(prop,Ctx.project.getProjectDir());
  }
 catch (  IOException e) {
    Message.showMsg(getStage(),"String_Node_Str",3);
  }
}
Program: 30125
Project: 30125
Buggy source:
private void updateDesc(){
  String idStr=(String)id.getText();
  int i=((OptionsInputPanel)id).getSelectedIndex();
  if (i == -1) {
    if (idStr.isEmpty())     setInfo(DEFAULT_DESC);
 else     setInfo(CUSTOM_VERB_DESC);
  }
 else {
    if (ScopePanel.SCENE_SCOPE.equals(scope)) {
      setInfo(SCENE_VERBS_INFO[i]);
    }
 else {
      setInfo(VERBS_INFO[i]);
    }
  }
  if (idStr != null && idStr.equals("String_Node_Str"))   setVisible(target,true);
 else   setVisible(target,false);
  pack();
}

Fixed version (ground truth):
private void updateDesc(){
  String idStr=(String)id.getText();
  int i=((OptionsInputPanel)id).getSelectedIndex();
  if (i == -1) {
    if (idStr != null && idStr.isEmpty())     setInfo(DEFAULT_DESC);
 else     setInfo(CUSTOM_VERB_DESC);
  }
 else {
    if (ScopePanel.SCENE_SCOPE.equals(scope)) {
      setInfo(SCENE_VERBS_INFO[i]);
    }
 else {
      setInfo(VERBS_INFO[i]);
    }
  }
  if (idStr != null && idStr.equals("String_Node_Str"))   setVisible(target,true);
 else   setVisible(target,false);
  pack();
}
Program: 30127
Project: 30127
Buggy source:
public static Object cloneElement(Object e){
  Json json=new BladeJson(Ctx.project.getWorld(),Mode.MODEL);
  if (e instanceof Action) {
    StringWriter buffer=new StringWriter();
    json.setWriter(buffer);
    ActionUtils.writeJson((Action)e,json);
    String str=buffer.toString();
    EditorLogger.debug(str);
    JsonValue root=new JsonReader().parse(str);
    return ActionUtils.readJson(Ctx.project.getWorld(),json,root);
  }
 else {
    String str=json.toJson(e,(Class<?>)null);
    return json.fromJson(e.getClass(),str);
  }
}

Fixed version (ground truth):
public static Object cloneElement(Object e){
  Json json=new BladeJson(Ctx.project.getWorld(),Mode.MODEL);
  if (e instanceof Action) {
    StringWriter buffer=new StringWriter();
    json.setWriter(buffer);
    ActionUtils.writeJson((Action)e,json);
    String str=buffer.toString();
    EditorLogger.debug(str);
    JsonValue root=new JsonReader().parse(str);
    return ActionUtils.readJson(Ctx.project.getWorld(),json,root);
  }
 else   if (e instanceof Scene) {
    String str=json.toJson(e,(Class<?>)null);
    Scene s=new Scene(((Scene)e).getWorld());
    JsonValue root=new JsonReader().parse(str);
    s.read(json,root);
    return s;
  }
 else {
    String str=json.toJson(e,(Class<?>)null);
    return json.fromJson(e.getClass(),str);
  }
}
Program: 30128
Project: 30128
Buggy source:
public void setVariable(String name,String value) throws Exception {
  if (story.getVariablesState().get(name) instanceof InkList) {
    InkList rawList=(InkList)story.getVariablesState().get(name);
    if (rawList.getOrigins() == null) {
      List<String> names=rawList.getOriginNames();
      if (names != null) {
        ArrayList<ListDefinition> origins=new ArrayList<ListDefinition>();
        for (        String n : names) {
          ListDefinition def=story.getListDefinitions().getDefinition(n);
          if (!origins.contains(def))           origins.add(def);
        }
        rawList.setOrigins(origins);
      }
    }
    rawList.addItem(value);
  }
 else   story.getVariablesState().set(name,value);
}

Fixed version (ground truth):
public synchronized void setVariable(String name,String value) throws Exception {
  if (story.getVariablesState().get(name) instanceof InkList) {
    InkList rawList=(InkList)story.getVariablesState().get(name);
    if (rawList.getOrigins() == null) {
      List<String> names=rawList.getOriginNames();
      if (names != null) {
        ArrayList<ListDefinition> origins=new ArrayList<ListDefinition>();
        for (        String n : names) {
          ListDefinition def=story.getListDefinitions().getDefinition(n);
          if (!origins.contains(def))           origins.add(def);
        }
        rawList.setOrigins(origins);
      }
    }
    rawList.addItem(value);
  }
 else   story.getVariablesState().set(name,value);
}
Program: 30129
Project: 30129
Buggy source:
public void cancel(){
  for (  Action c : actions) {
    if (c instanceof VerbRunner)     ((VerbRunner)c).cancel();
  }
  ip=actions.size() + 1;
  EngineLogger.debug("String_Node_Str" + id);
  if (cb != null)   cb.resume();
}

Fixed version (ground truth):
public void cancel(){
  ip=actions.size() + 1;
  for (  Action c : actions) {
    if (c instanceof VerbRunner)     ((VerbRunner)c).cancel();
  }
  if (cb != null) {
    ActionCallback cb2=cb;
    cb=null;
    cb2.resume();
  }
  EngineLogger.debug("String_Node_Str" + id);
}
Program: 30130
Project: 30130
Buggy source:
public void nextStep(){
  boolean stop=false;
  while (!isFinished() && !stop) {
    Action a=actions.get(ip);
    if (EngineLogger.debugMode())     EngineLogger.debug(ip + "String_Node_Str" + a.getClass().getSimpleName());
    try {
      if (a.run(this))       stop=true;
 else       ip++;
    }
 catch (    Exception e) {
      EngineLogger.error("String_Node_Str" + a.getClass().getSimpleName() + "String_Node_Str"+ e.getMessage(),e);
      ip++;
    }
  }
  if (ip == actions.size()) {
    EngineLogger.debug("String_Node_Str" + id);
    if (cb != null)     cb.resume();
  }
}

Fixed version (ground truth):
public void nextStep(){
  boolean stop=false;
  while (!isFinished() && !stop) {
    Action a=actions.get(ip);
    if (EngineLogger.debugMode())     EngineLogger.debug(ip + "String_Node_Str" + a.getClass().getSimpleName());
    try {
      if (a.run(this))       stop=true;
 else       ip++;
    }
 catch (    Exception e) {
      EngineLogger.error("String_Node_Str" + a.getClass().getSimpleName() + "String_Node_Str"+ e.getMessage(),e);
      ip++;
    }
  }
  if (ip == actions.size()) {
    EngineLogger.debug("String_Node_Str" + id);
    if (cb != null) {
      ActionCallback cb2=cb;
      cb=null;
      cb2.resume();
    }
  }
}
Program: 30132
Project: 30132
Buggy source:
private static void parseArgs(String[] args){
  for (int i=1; i < args.length; i++) {
    if (args[i - 1].equals("String_Node_Str")) {
      try {
        File file=new File(args[i]).getCanonicalFile();
        Ctx.project.loadProject(file);
      }
 catch (      Exception ex) {
        EditorLogger.printStackTrace(ex);
      }
    }
 else     if (args[i].equals("String_Node_Str")) {
      EditorLogger.setDebug();
    }
  }
}

Fixed version (ground truth):
private static void parseArgs(String[] args){
  for (int i=0; i < args.length; i++) {
    if (args[i].equals("String_Node_Str") && i < args.length - 1) {
      try {
        File file=new File(args[i + 1]).getCanonicalFile();
        Ctx.project.loadProject(file);
      }
 catch (      Exception ex) {
        EditorLogger.printStackTrace(ex);
      }
    }
 else     if (args[i].equals("String_Node_Str")) {
      EditorLogger.setDebugLevel(Levels.DEBUG);
    }
  }
}
Program: 30133
Project: 30133
Buggy source:
public static void setDebug(){
  level=Levels.DEBUG;
  console.setLoggingToSystem(true);
}

Fixed version (ground truth):
public static void setDebug(){
  level=Levels.DEBUG;
  EngineLogger.setDebug();
  console.setLoggingToSystem(true);
}
Program: 30134
Project: 30134
Buggy source:
@Override public boolean run(VerbRunner cb){
  w.enterScene(scene,init);
  return true;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  w.setCurrentScene(scene,init);
  return true;
}
Program: 30135
Project: 30135
Buggy source:
private void restoreStandPose(CharacterActor a){
  if (a == null)   return;
  String fa=((AnimationRenderer)a.getRenderer()).getCurrentAnimationId();
  String talkAnim=animation != null ? animation : a.getTalkAnim();
  if (fa.startsWith(talkAnim)) {
    a.stand();
  }
  if (animation != null) {
    a.setTalkAnim(previousDefaultTalkAnim);
  }
}

Fixed version (ground truth):
private void restoreStandPose(CharacterActor a){
  if (a == null)   return;
  if (animation != null) {
    a.setTalkAnim(previousDefaultTalkAnim);
  }
}
Program: 30136
Project: 30136
Buggy source:
@Override public void resume(){
  BaseActor actor=w.getCurrentScene().getActor(characterName,false);
  if (characterTurn) {
    characterTurn=false;
    if (previousAnim != null) {
      SpriteActor player=w.getCurrentScene().getPlayer();
      player.startAnimation(previousAnim,null);
    }
    if (responseText != null) {
      Rectangle boundingRectangle=actor.getBBox().getBoundingRectangle();
      float x=boundingRectangle.getX() + boundingRectangle.getWidth() / 2;
      float y=boundingRectangle.getY() + boundingRectangle.getHeight();
      w.getCurrentScene().getTextManager().addText(responseText,x,y,false,Text.Type.TALK,((CharacterActor)actor).getTextColor(),null,actor.getId(),responseVoiceId,this);
      if (actor instanceof CharacterActor) {
        startTalkAnim((CharacterActor)actor);
      }
    }
 else {
      previousAnim=null;
      super.resume();
    }
  }
 else {
    if (actor instanceof SpriteActor && previousAnim != null) {
      ((SpriteActor)actor).startAnimation(previousAnim,null);
    }
    super.resume();
  }
}

Fixed version (ground truth):
@Override public void resume(){
  BaseActor actor=w.getCurrentScene().getActor(characterName,false);
  if (characterTurn) {
    characterTurn=false;
    if (previousAnim != null) {
      SpriteActor player=w.getCurrentScene().getPlayer();
      player.startAnimation(previousAnim,null);
    }
    if (responseText != null) {
      Rectangle boundingRectangle=actor.getBBox().getBoundingRectangle();
      float x=boundingRectangle.getX() + boundingRectangle.getWidth() / 2;
      float y=boundingRectangle.getY() + boundingRectangle.getHeight();
      if (actor instanceof CharacterActor) {
        startTalkAnim((CharacterActor)actor);
      }
      w.getCurrentScene().getTextManager().addText(responseText,x,y,false,Text.Type.TALK,((CharacterActor)actor).getTextColor(),null,actor.getId(),responseVoiceId,this);
    }
 else {
      previousAnim=null;
      super.resume();
    }
  }
 else {
    if (actor instanceof SpriteActor && previousAnim != null) {
      ((SpriteActor)actor).startAnimation(previousAnim,null);
    }
    super.resume();
  }
}
Program: 30137
Project: 30137
Buggy source:
private void restoreStandPose(CharacterActor a){
  if (a == null)   return;
  String fa=((AnimationRenderer)a.getRenderer()).getCurrentAnimationId();
  if (fa.startsWith(a.getTalkAnim())) {
    a.stand();
  }
}

Fixed version (ground truth):
private void restoreStandPose(CharacterActor a){
  if (a == null)   return;
}
Program: 30138
Project: 30138
Buggy source:
@Override public boolean run(VerbRunner cb){
  if (w.getCurrentDialog() == null || w.getCurrentDialog().getCurrentOption() == null) {
    EngineLogger.debug("String_Node_Str");
    return false;
  }
  setVerbCb(cb);
  DialogOption o=w.getCurrentDialog().getCurrentOption();
  String playerText=o.getText();
  responseText=o.getResponseText();
  responseVoiceId=o.getResponseVoiceId();
  characterName=w.getCurrentDialog().getActor().getId();
  characterTurn=true;
  previousAnim=null;
  restoreStandPose(w.getCurrentScene().getPlayer());
  if (w.getCurrentScene().getActor(characterName,false) instanceof SpriteActor)   restoreStandPose((CharacterActor)w.getCurrentScene().getActor(characterName,false));
  if (playerText != null) {
    CharacterActor player=w.getCurrentScene().getPlayer();
    Rectangle boundingRectangle=player.getBBox().getBoundingRectangle();
    float x=boundingRectangle.getX() + boundingRectangle.getWidth() / 2;
    float y=boundingRectangle.getY() + boundingRectangle.getHeight();
    w.getCurrentScene().getTextManager().addText(playerText,x,y,false,Text.Type.TALK,player.getTextColor(),null,player.getId(),o.getVoiceId(),this);
    startTalkAnim(player);
  }
 else {
    resume();
  }
  return getWait();
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  if (w.getCurrentDialog() == null || w.getCurrentDialog().getCurrentOption() == null) {
    EngineLogger.debug("String_Node_Str");
    return false;
  }
  setVerbCb(cb);
  DialogOption o=w.getCurrentDialog().getCurrentOption();
  String playerText=o.getText();
  responseText=o.getResponseText();
  responseVoiceId=o.getResponseVoiceId();
  characterName=w.getCurrentDialog().getActor().getId();
  characterTurn=true;
  previousAnim=null;
  restoreStandPose(w.getCurrentScene().getPlayer());
  if (w.getCurrentScene().getActor(characterName,false) instanceof SpriteActor)   restoreStandPose((CharacterActor)w.getCurrentScene().getActor(characterName,false));
  if (playerText != null) {
    CharacterActor player=w.getCurrentScene().getPlayer();
    Rectangle boundingRectangle=player.getBBox().getBoundingRectangle();
    float x=boundingRectangle.getX() + boundingRectangle.getWidth() / 2;
    float y=boundingRectangle.getY() + boundingRectangle.getHeight();
    startTalkAnim(player);
    w.getCurrentScene().getTextManager().addText(playerText,x,y,false,Text.Type.TALK,player.getTextColor(),null,player.getId(),o.getVoiceId(),this);
  }
 else {
    resume();
  }
  return getWait();
}
Program: 30139
Project: 30139
Buggy source:
private void processCommand(HashMap<String,String> params,String line){
  String commandName=null;
  String commandParams[]=null;
  int i=line.indexOf(NAME_VALUE_TAG_SEPARATOR);
  if (i == -1) {
    commandName=line.substring(1).trim();
  }
 else {
    commandName=line.substring(1,i).trim();
    commandParams=line.substring(i + 1).split(PARAM_SEPARATOR);
    processParams(Arrays.asList(commandParams),params);
  }
  if ("String_Node_Str".equals(commandName)) {
    boolean init=true;
    if (params.get("String_Node_Str") != null)     init=Boolean.parseBoolean(params.get("String_Node_Str"));
    w.enterScene(params.get("String_Node_Str"),init);
  }
 else   if ("String_Node_Str".equals(commandName)) {
    w.setModelProp(params.get("String_Node_Str"),params.get("String_Node_Str"));
  }
 else {
    if ("String_Node_Str".equals(commandName)) {
      commandName=commandParams[0].trim();
      params.remove(commandName);
    }
    if (commandName.length() > 0 && Character.isUpperCase(commandName.charAt(0))) {
      Action action;
      try {
        action=ActionFactory.createByClass("String_Node_Str" + commandName + "String_Node_Str",params);
        action.init(w);
        actions.add(action);
      }
 catch (      ClassNotFoundException|ReflectionException e) {
        EngineLogger.error(e.getMessage(),e);
      }
    }
 else {
      EngineLogger.error("String_Node_Str" + commandName);
    }
  }
}

Fixed version (ground truth):
private void processCommand(HashMap<String,String> params,String line){
  String commandName=null;
  String commandParams[]=null;
  int i=line.indexOf(NAME_VALUE_TAG_SEPARATOR);
  if (i == -1) {
    commandName=line.substring(1).trim();
  }
 else {
    commandName=line.substring(1,i).trim();
    commandParams=line.substring(i + 1).split(PARAM_SEPARATOR);
    processParams(Arrays.asList(commandParams),params);
  }
  if ("String_Node_Str".equals(commandName)) {
    boolean init=true;
    if (params.get("String_Node_Str") != null)     init=Boolean.parseBoolean(params.get("String_Node_Str"));
    w.setCurrentScene(params.get("String_Node_Str"),init);
  }
 else   if ("String_Node_Str".equals(commandName)) {
    w.setModelProp(params.get("String_Node_Str"),params.get("String_Node_Str"));
  }
 else {
    if ("String_Node_Str".equals(commandName)) {
      commandName=commandParams[0].trim();
      params.remove(commandName);
    }
    if (commandName.length() > 0 && Character.isUpperCase(commandName.charAt(0))) {
      Action action;
      try {
        action=ActionFactory.createByClass("String_Node_Str" + commandName + "String_Node_Str",params);
        action.init(w);
        actions.add(action);
      }
 catch (      ClassNotFoundException|ReflectionException e) {
        EngineLogger.error(e.getMessage(),e);
      }
    }
 else {
      EngineLogger.error("String_Node_Str" + commandName);
    }
  }
}
Program: 30140
Project: 30140
Buggy source:
/** 
 * Actions to do when setting an animation: - play animation sound - add 'in' distance
 * @param repeatType
 */
protected void outAnim(Type repeatType){
  AnimationDesc fa=((AnimationRenderer)renderer).getCurrentAnimation();
  if (fa != null) {
    if (fa.sound != null && repeatType != Tween.Type.REVERSE) {
      String sid=fa.sound;
      if (scene != null && scene.getWorld().getSounds().get(sid) == null)       sid=id + "String_Node_Str" + fa.sound;
      if (scene != null)       scene.getSoundManager().playSound(sid);
 else       scene.getWorld().getCurrentScene().getSoundManager().playSound(sid);
    }
    Vector2 inD=fa.inD;
    if (inD != null) {
      float s=EngineAssetManager.getInstance().getScale();
      setPosition(getX() + inD.x * s,getY() + inD.y * s);
    }
  }
}

Fixed version (ground truth):
/** 
 * Actions to do when setting an animation: - play animation sound - add 'in' distance
 * @param repeatType
 */
protected void outAnim(Type repeatType){
  AnimationDesc fa=((AnimationRenderer)renderer).getCurrentAnimation();
  if (fa != null) {
    if (fa.sound != null && repeatType != Tween.Type.REVERSE) {
      String sid=fa.sound;
      if (scene != null && scene.getWorld().getSounds().get(sid) == null)       sid=id + "String_Node_Str" + fa.sound;
      if (scene != null)       scene.getSoundManager().playSound(sid);
    }
    Vector2 inD=fa.inD;
    if (inD != null) {
      float s=EngineAssetManager.getInstance().getScale();
      setPosition(getX() + inD.x * s,getY() + inD.y * s);
    }
  }
}
Program: 30141
Project: 30141
Buggy source:
/** 
 * Actions to do when setting an animation: - stop previous animation sound - add 'out' distance from previous animation
 */
protected void inAnim(){
  AnimationDesc fa=((AnimationRenderer)renderer).getCurrentAnimation();
  if (fa != null) {
    if (fa.sound != null) {
      String sid=fa.sound;
      if (scene != null && scene.getWorld().getSounds().get(sid) == null)       sid=id + "String_Node_Str" + fa.sound;
      if (scene != null)       scene.getSoundManager().stopSound(sid);
 else       scene.getWorld().getCurrentScene().getSoundManager().stopSound(sid);
    }
    Vector2 outD=fa.outD;
    if (outD != null) {
      float s=EngineAssetManager.getInstance().getScale();
      setPosition(getX() + outD.x * s,getY() + outD.y * s);
    }
  }
}

Fixed version (ground truth):
/** 
 * Actions to do when setting an animation: - stop previous animation sound - add 'out' distance from previous animation
 */
protected void inAnim(){
  AnimationDesc fa=((AnimationRenderer)renderer).getCurrentAnimation();
  if (fa != null) {
    if (fa.sound != null) {
      String sid=fa.sound;
      if (scene != null && scene.getWorld().getSounds().get(sid) == null)       sid=id + "String_Node_Str" + fa.sound;
      if (scene != null)       scene.getSoundManager().stopSound(sid);
    }
    Vector2 outD=fa.outD;
    if (outD != null) {
      float s=EngineAssetManager.getInstance().getScale();
      setPosition(getX() + outD.x * s,getY() + outD.y * s);
    }
  }
}
Program: 30142
Project: 30142
Buggy source:
public void setCurrentScene(Scene s){
  currentScene=s;
}

Fixed version (ground truth):
public void setCurrentScene(String id,boolean init){
  if (id.equals("String_Node_Str" + WorldProperties.PREVIOUS_SCENE.toString()))   id=getCustomProperty(WorldProperties.PREVIOUS_SCENE.toString());
  Scene s=scenes.get(id);
  if (s != null) {
    setCurrentScene(s,init);
  }
 else {
    EngineLogger.error("String_Node_Str" + id);
  }
}
Program: 30143
Project: 30143
Buggy source:
public void loadChapter(String chapter,String scene,boolean test) throws Exception {
  if (test)   this.testScene=scene;
  serialization.loadChapter(chapter);
  if (scene != null) {
    currentScene=null;
    enterScene(scene,true);
  }
}

Fixed version (ground truth):
public void loadChapter(String chapter,String scene,boolean test) throws Exception {
  if (test)   this.testScene=scene;
  serialization.loadChapter(chapter);
  if (scene != null) {
    currentScene=null;
    setCurrentScene(scene,true);
  }
}
Program: 30147
Project: 30147
Buggy source:
public static Object cloneElement(Object e){
  Json json=new Json();
  if (e instanceof Action) {
    StringWriter buffer=new StringWriter();
    json.setWriter(buffer);
    ActionUtils.writeJson((Action)e,json);
    String str=buffer.toString();
    EditorLogger.debug(str);
    JsonValue root=new JsonReader().parse(str);
    return ActionUtils.readJson(json,root);
  }
 else {
    SerializationHelper.getInstance().setMode(Mode.MODEL);
    String str=json.toJson(e,(Class<?>)null);
    return json.fromJson(e.getClass(),str);
  }
}

Fixed version (ground truth):
public static Object cloneElement(Object e){
  Json json=new Json();
  if (e instanceof Action) {
    StringWriter buffer=new StringWriter();
    json.setWriter(buffer);
    ActionUtils.writeJson((Action)e,json);
    String str=buffer.toString();
    EditorLogger.debug(str);
    JsonValue root=new JsonReader().parse(str);
    return ActionUtils.readJson(World.getInstance(),json,root);
  }
 else {
    SerializationHelper.getInstance().setMode(Mode.MODEL);
    String str=json.toJson(e,(Class<?>)null);
    return json.fromJson(e.getClass(),str);
  }
}
Program: 30148
Project: 30148
Buggy source:
public void save() throws IOException {
  new JsonSerializer(World.getInstance()).saveModel(id);
}

Fixed version (ground truth):
public void save() throws IOException {
  World.getInstance().getSerializer().saveModel(id);
}
Program: 30149
Project: 30149
Buggy source:
@Override public int compare(T o1,T o2){
  String s1=cellRenderer.getCellTitle(o1);
  String s2=cellRenderer.getCellTitle(o2);
  return s1.compareTo(s2);
}

Fixed version (ground truth):
@Override public int compare(T o1,T o2){
  String s1=cellRenderer.getCellTitle(o1);
  String s2=cellRenderer.getCellTitle(o2);
  if (s1 == null) {
    System.out.println("String_Node_Str");
  }
  return s1.compareTo(s2);
}
Program: 30150
Project: 30150
Buggy source:
public void sortByTitle(){
  getItems().sort(new Comparator<T>(){
    @Override public int compare(    T o1,    T o2){
      String s1=cellRenderer.getCellTitle(o1);
      String s2=cellRenderer.getCellTitle(o2);
      return s1.compareTo(s2);
    }
  }
);
}

Fixed version (ground truth):
public void sortByTitle(){
  getItems().sort(new Comparator<T>(){
    @Override public int compare(    T o1,    T o2){
      String s1=cellRenderer.getCellTitle(o1);
      String s2=cellRenderer.getCellTitle(o2);
      if (s1 == null) {
        System.out.println("String_Node_Str");
      }
      return s1.compareTo(s2);
    }
  }
);
}
Program: 30151
Project: 30151
Buggy source:
@Override public boolean run(VerbRunner cb){
  String actorId=animation.getActorId();
  SpriteActor a=(SpriteActor)World.getInstance().getCurrentScene().getActor(actorId,true);
  if (a.getRenderer() instanceof SpineRenderer) {
    SpineRenderer r=(SpineRenderer)a.getRenderer();
    String anim=animation.getAnimationId();
    if (anim.isEmpty())     anim=null;
    r.setSecondaryAnimation(anim);
  }
 else {
    EngineLogger.error("String_Node_Str");
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  String actorId=animation.getActorId();
  SpriteActor a=(SpriteActor)w.getCurrentScene().getActor(actorId,true);
  if (a.getRenderer() instanceof SpineRenderer) {
    SpineRenderer r=(SpineRenderer)a.getRenderer();
    String anim=animation.getAnimationId();
    if (anim.isEmpty())     anim=null;
    r.setSecondaryAnimation(anim);
  }
 else {
    EngineLogger.error("String_Node_Str");
  }
  return false;
}
Program: 30152
Project: 30152
Buggy source:
@Override public boolean run(VerbRunner cb){
  SpriteActor a=(SpriteActor)actor.getActor();
  if (a instanceof SpriteActor && a.getRenderer() instanceof SpineRenderer) {
    SpineRenderer r=(SpineRenderer)a.getRenderer();
    r.setSkin(skin);
  }
 else {
    EngineLogger.error("String_Node_Str");
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  SpriteActor a=(SpriteActor)actor.getActor(w);
  if (a instanceof SpriteActor && a.getRenderer() instanceof SpineRenderer) {
    SpineRenderer r=(SpineRenderer)a.getRenderer();
    r.setSkin(skin);
  }
 else {
    EngineLogger.error("String_Node_Str");
  }
  return false;
}
Program: 30153
Project: 30153
Buggy source:
@Override public boolean run(VerbRunner cb){
  String p=World.getInstance().getCustomProperty(prop);
  int v=0;
  if (p != null) {
    try {
      v=Integer.parseInt(p);
    }
 catch (    NumberFormatException e) {
    }
  }
  v+=value;
  World.getInstance().setCustomProperty(prop,Integer.toString(v));
  EngineLogger.debug("String_Node_Str" + prop + "String_Node_Str"+ World.getInstance().getCustomProperty(prop));
  return false;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  String p=w.getCustomProperty(prop);
  int v=0;
  if (p != null) {
    try {
      v=Integer.parseInt(p);
    }
 catch (    NumberFormatException e) {
    }
  }
  v+=value;
  w.setCustomProperty(prop,Integer.toString(v));
  EngineLogger.debug("String_Node_Str" + prop + "String_Node_Str"+ w.getCustomProperty(prop));
  return false;
}