nus-yam/ex-repair huggingface dataset:
Program: 29962
Project: 29962
Buggy source:
public static HE_Selection selectVerticesWithInternalLabel(final HE_Mesh mesh,final int label){
  final HE_Selection _selection=new HE_Selection(mesh);
  HE_Vertex v;
  final Iterator<HE_Vertex> vItr=mesh.vItr();
  while (vItr.hasNext()) {
    v=vItr.next();
    if (v.getTemporaryLabel() == label) {
      _selection.add(v);
    }
  }
  return _selection;
}

Fixed version (ground truth):
/** 
 * @deprecated Use {@link #selectVerticesWithTemporaryLabel(HE_Mesh,int)} instead
 */
public static HE_Selection selectVerticesWithInternalLabel(final HE_Mesh mesh,final int label){
  return selectVerticesWithTemporaryLabel(mesh,label);
}
Program: 29963
Project: 29963
Buggy source:
public static HE_Selection selectVerticesWithOtherInternalLabel(final HE_Mesh mesh,final int label){
  final HE_Selection _selection=new HE_Selection(mesh);
  HE_Vertex v;
  final Iterator<HE_Vertex> vItr=mesh.vItr();
  while (vItr.hasNext()) {
    v=vItr.next();
    if (v.getTemporaryLabel() != label) {
      _selection.add(v);
    }
  }
  return _selection;
}

Fixed version (ground truth):
/** 
 * @deprecated Use {@link #selectVerticesWithOtherTemporaryLabel(HE_Mesh,int)} instead
 */
public static HE_Selection selectVerticesWithOtherInternalLabel(final HE_Mesh mesh,final int label){
  return selectVerticesWithOtherTemporaryLabel(mesh,label);
}
Program: 29964
Project: 29964
Buggy source:
@Override public WB_FaceListMesh getMesh(){
  createMesh();
  return mesh;
}

Fixed version (ground truth):
@Override public WB_FacelistMesh getMesh(){
  createMesh();
  return mesh;
}
Program: 29965
Project: 29965
Buggy source:
/** 
 * @return
 */
public WB_FaceListMesh getMesh(){
  createMesh();
  return mesh;
}

Fixed version (ground truth):
/** 
 * @return
 */
public WB_FacelistMesh getMesh(){
  createMesh();
  return mesh;
}
Program: 29966
Project: 29966
Buggy source:
/** 
 * @return
 */
public WB_FaceListMesh getMesh(){
  createMesh();
  return mesh;
}

Fixed version (ground truth):
/** 
 * @return
 */
public WB_FacelistMesh getMesh(){
  createMesh();
  return mesh;
}
Program: 29967
Project: 29967
Buggy source:
/** 
 * @return
 */
public WB_FaceListMesh getMesh(){
  createMesh();
  return mesh;
}

Fixed version (ground truth):
/** 
 * @return
 */
public WB_FacelistMesh getMesh(){
  createMesh();
  return mesh;
}
Program: 29971
Project: 29971
Buggy source:
/** 
 */
private void createVertices(){
  final double da=(2 * Math.PI) / strutFacets;
  for (int id=0; id < (frame.getNumberOfStruts() * 2); id++) {
    final double sr=strutNodeConnections[id].radius;
    final double sgn=(strutNodeConnections[id].node == strutNodeConnections[id].strut.start()) ? 1 : -1;
    final double so=strutNodeConnections[id].maxoffset;
    final WB_Vector v=strutNodeConnections[id].strut.toVector();
    v.normalizeSelf();
    v.mulSelf(sgn);
    strutNodeConnections[id].dir=v.get();
    final WB_Plane P=strutNodeConnections[id].strut.toPlane();
    final WB_Vector u=P.getU();
    for (int j=0; j < strutFacets; j++) {
      final WB_Point p=new WB_Point(strutNodeConnections[id].node);
      final double af=angleFactor.evaluate(strutNodeConnections[id].node.xd(),strutNodeConnections[id].node.yd(),strutNodeConnections[id].node.zd());
      p.addMulSelf(so,v);
      final WB_Vector localu=u.mul(sr);
      localu.rotateAboutAxisSelf((j + af) * da,new WB_Point(),P.getNormal());
      p.addSelf(localu);
      final HE_Vertex vrtx=new HE_Vertex(p);
      vrtx.setTemporaryLabel(strutNodeConnections[id].node.getIndex());
      strutNodeConnections[id].vertices.add(vrtx);
      mesh.add(vrtx);
    }
  }
}

Fixed version (ground truth):
/** 
 */
private void createVertices(){
  final double da=(2 * Math.PI) / strutFacets;
  for (int id=0; id < (frame.getNumberOfStruts() * 2); id++) {
    final double sr=strutNodeConnections[id].radius;
    final double sgn=(strutNodeConnections[id].node == strutNodeConnections[id].strut.start()) ? 1 : -1;
    final double so=strutNodeConnections[id].maxoffset;
    final WB_Vector v=strutNodeConnections[id].strut.toVector();
    v.normalizeSelf();
    v.mulSelf(sgn);
    strutNodeConnections[id].dir=v.get();
    final WB_Plane P=strutNodeConnections[id].strut.toPlane();
    final WB_Vector u=P.getU();
    for (int j=0; j < strutFacets; j++) {
      final WB_Point p=new WB_Point(strutNodeConnections[id].node);
      final double af=angleFactor.evaluate(strutNodeConnections[id].node.xd(),strutNodeConnections[id].node.yd(),strutNodeConnections[id].node.zd());
      p.addMulSelf(so,v);
      final WB_Vector localu=u.mul(sr);
      localu.rotateAboutAxisSelf((j + af) * da,new WB_Point(),P.getNormal());
      p.addSelf(localu);
      final HE_Vertex vrtx=new HE_Vertex(p);
      vrtx.setInternalLabel(strutNodeConnections[id].node.getIndex());
      strutNodeConnections[id].vertices.add(vrtx);
      mesh.add(vrtx);
    }
  }
}
Program: 29974
Project: 29974
Buggy source:
/** 
 * @param mesh
 * @return
 */
private List<HE_Vertex> getUniqueVertices(final HE_Mesh mesh){
  final List<HE_Vertex> uniqueVertices=new FastTable<HE_Vertex>();
  if (duplicate) {
    final WB_KDTree<WB_Coord,Integer> kdtree=new WB_KDTree<WB_Coord,Integer>();
    WB_KDEntry<WB_Coord,Integer> neighbor;
    HE_Vertex v=new HE_Vertex(source.getVertex(0));
    kdtree.add(source.getVertex(0),0);
    uniqueVertices.add(v);
    mesh.add(v);
    for (int i=1; i < source.getNumberOfVertices(); i++) {
      v=new HE_Vertex(source.getVertex(i));
      v.setTemporaryLabel(i);
      neighbor=kdtree.getNearestNeighbor(v);
      if (neighbor.d2 < WB_Epsilon.SQEPSILON) {
        uniqueVertices.add(uniqueVertices.get(neighbor.value));
      }
 else {
        kdtree.add(source.getVertex(i),i);
        uniqueVertices.add(v);
        mesh.add(uniqueVertices.get(i));
      }
    }
  }
 else {
    HE_Vertex v;
    for (int i=0; i < source.getNumberOfVertices(); i++) {
      v=new HE_Vertex(source.getVertex(i));
      v.setTemporaryLabel(i);
      uniqueVertices.add(v);
      mesh.add(v);
    }
  }
  return uniqueVertices;
}

Fixed version (ground truth):
/** 
 * @param mesh
 * @return
 */
private List<HE_Vertex> getUniqueVertices(final HE_Mesh mesh){
  final List<HE_Vertex> uniqueVertices=new FastTable<HE_Vertex>();
  if (duplicate) {
    final WB_KDTree<WB_Coord,Integer> kdtree=new WB_KDTree<WB_Coord,Integer>();
    WB_KDEntry<WB_Coord,Integer> neighbor;
    HE_Vertex v=new HE_Vertex(source.getVertex(0));
    kdtree.add(source.getVertex(0),0);
    uniqueVertices.add(v);
    mesh.add(v);
    for (int i=1; i < source.getNumberOfVertices(); i++) {
      v=new HE_Vertex(source.getVertex(i));
      v.setInternalLabel(i);
      neighbor=kdtree.getNearestNeighbor(v);
      if (neighbor.d2 < WB_Epsilon.SQEPSILON) {
        uniqueVertices.add(uniqueVertices.get(neighbor.value));
      }
 else {
        kdtree.add(source.getVertex(i),i);
        uniqueVertices.add(v);
        mesh.add(uniqueVertices.get(i));
      }
    }
  }
 else {
    HE_Vertex v;
    for (int i=0; i < source.getNumberOfVertices(); i++) {
      v=new HE_Vertex(source.getVertex(i));
      v.setInternalLabel(i);
      uniqueVertices.add(v);
      mesh.add(v);
    }
  }
  return uniqueVertices;
}
Program: 29975
Project: 29975
Buggy source:
@Override protected HE_Mesh createBase(){
  final HE_Mesh mesh=new HE_Mesh();
  if (source == null) {
    return mesh;
  }
  final int[][] faces=source.getFacesAsInt();
  final List<HE_Vertex> uniqueVertices=getUniqueVertices(mesh);
  if (normalcheck) {
    unifyNormals(faces);
  }
  int id=0;
  HE_Halfedge he;
  for (  final int[] face : faces) {
    final ArrayList<HE_Halfedge> faceEdges=new ArrayList<HE_Halfedge>();
    final HE_Face hef=new HE_Face();
    hef.setTemporaryLabel(id);
    id++;
    final int fl=face.length;
    final int[] locface=new int[fl];
    int li=0;
    locface[li++]=face[0];
    for (int i=1; i < (fl - 1); i++) {
      if (uniqueVertices.get(face[i]) != uniqueVertices.get(face[i - 1])) {
        locface[li++]=face[i];
      }
    }
    if ((uniqueVertices.get(face[fl - 1]) != uniqueVertices.get(face[fl - 2])) && (uniqueVertices.get(face[fl - 1]) != uniqueVertices.get(face[0]))) {
      locface[li++]=face[fl - 1];
    }
    if (li > 2) {
      for (int i=0; i < li; i++) {
        he=new HE_Halfedge();
        faceEdges.add(he);
        mesh.setFace(he,hef);
        if (hef.getHalfedge() == null) {
          mesh.setHalfedge(hef,he);
        }
        mesh.setVertex(he,uniqueVertices.get(locface[i]));
        mesh.setHalfedge(he.getVertex(),he);
      }
      mesh.add(hef);
      mesh.cycleHalfedges(faceEdges);
      mesh.addHalfedges(faceEdges);
    }
  }
  mesh.pairHalfedges();
  mesh.capHalfedges();
  return mesh;
}

Fixed version (ground truth):
@Override protected HE_Mesh createBase(){
  final HE_Mesh mesh=new HE_Mesh();
  if (source == null) {
    return mesh;
  }
  final int[][] faces=source.getFacesAsInt();
  final List<HE_Vertex> uniqueVertices=getUniqueVertices(mesh);
  if (normalcheck) {
    unifyNormals(faces);
  }
  int id=0;
  HE_Halfedge he;
  for (  final int[] face : faces) {
    final ArrayList<HE_Halfedge> faceEdges=new ArrayList<HE_Halfedge>();
    final HE_Face hef=new HE_Face();
    hef.setInternalLabel(id);
    id++;
    final int fl=face.length;
    final int[] locface=new int[fl];
    int li=0;
    locface[li++]=face[0];
    for (int i=1; i < (fl - 1); i++) {
      if (uniqueVertices.get(face[i]) != uniqueVertices.get(face[i - 1])) {
        locface[li++]=face[i];
      }
    }
    if ((uniqueVertices.get(face[fl - 1]) != uniqueVertices.get(face[fl - 2])) && (uniqueVertices.get(face[fl - 1]) != uniqueVertices.get(face[0]))) {
      locface[li++]=face[fl - 1];
    }
    if (li > 2) {
      for (int i=0; i < li; i++) {
        he=new HE_Halfedge();
        faceEdges.add(he);
        mesh.setFace(he,hef);
        if (hef.getHalfedge() == null) {
          mesh.setHalfedge(hef,he);
        }
        mesh.setVertex(he,uniqueVertices.get(locface[i]));
        mesh.setHalfedge(he.getVertex(),he);
      }
      mesh.add(hef);
      mesh.cycleHalfedges(faceEdges);
      mesh.addHalfedges(faceEdges);
    }
  }
  mesh.pairHalfedges();
  mesh.capHalfedges();
  return mesh;
}
Program: 29977
Project: 29977
Buggy source:
@Override protected HE_Mesh createBase(){
  if (polygon == null) {
    return null;
  }
  final WB_Vector norm=polygon.getPlane().getNormal();
  final int n=polygon.getNumberOfPoints();
  final boolean surf=WB_Epsilon.isZero(thickness);
  final WB_Coord[] points=new WB_Coord[surf ? n : 2 * n];
  for (int i=0; i < n; i++) {
    points[i]=polygon.getPoint(i);
  }
  if (!surf) {
    for (int i=0; i < n; i++) {
      points[n + i]=new WB_Point(points[i]).addMulSelf(thickness,norm);
    }
  }
  int[][] faces;
  if (surf) {
    faces=new int[1][n];
    for (int i=0; i < n; i++) {
      faces[0][i]=i;
    }
  }
 else {
    faces=new int[n + 2][];
    faces[n]=new int[n];
    faces[n + 1]=new int[n];
    for (int i=0; i < n; i++) {
      faces[n][i]=i;
      faces[n + 1][i]=(2 * n) - 1 - i;
      faces[i]=new int[4];
      faces[i][0]=i;
      faces[i][3]=(i + 1) % n;
      faces[i][2]=n + ((i + 1) % n);
      faces[i][1]=n + i;
    }
  }
  final HEC_FromFacelist fl=new HEC_FromFacelist();
  fl.setVertices(points).setFaces(faces).setDuplicate(false);
  return fl.createBase().flipAllFaces();
}

Fixed version (ground truth):
@Override protected HE_Mesh createBase(){
  if (polygon == null) {
    return null;
  }
  final WB_Vector norm=polygon.getPlane().getNormal();
  final int n=polygon.getNumberOfPoints();
  final boolean surf=WB_Epsilon.isZero(thickness);
  final WB_Coord[] points=new WB_Coord[surf ? n : 2 * n];
  for (int i=0; i < n; i++) {
    points[i]=polygon.getPoint(i);
  }
  if (!surf) {
    for (int i=0; i < n; i++) {
      points[n + i]=new WB_Point(points[i]).addMulSelf(thickness,norm);
    }
  }
  int[][] faces;
  if (surf) {
    faces=new int[1][n];
    for (int i=0; i < n; i++) {
      faces[0][i]=i;
    }
  }
 else {
    faces=new int[n + 2][];
    faces[n]=new int[n];
    faces[n + 1]=new int[n];
    for (int i=0; i < n; i++) {
      faces[n][i]=i;
      faces[n + 1][i]=(2 * n) - 1 - i;
      faces[i]=new int[4];
      faces[i][0]=i;
      faces[i][3]=(i + 1) % n;
      faces[i][2]=n + ((i + 1) % n);
      faces[i][1]=n + i;
    }
  }
  final HEC_FromFacelist fl=new HEC_FromFacelist();
  fl.setVertices(points).setFaces(faces).setDuplicate(false);
  return fl.createBase().flipFaces();
}
Program: 29978
Project: 29978
Buggy source:
@Override protected HE_Mesh createBase(){
  if ((facets < 3) || (WB_Epsilon.isZero(radius))) {
    return null;
  }
  final WB_Point[] ppoints=new WB_Point[facets];
  for (int i=0; i < facets; i++) {
    final double x=radius * Math.cos(((Math.PI * 2.0) / facets) * i);
    final double y=radius * Math.sin(((Math.PI * 2.0) / facets) * i);
    ppoints[i]=new WB_Point(x,y,0.0);
  }
  final WB_Polygon polygon=gf.createSimplePolygon(ppoints);
  final WB_Vector norm=polygon.getPlane().getNormal();
  final int n=polygon.getNumberOfPoints();
  final boolean surf=WB_Epsilon.isZero(thickness);
  final WB_Coord[] points=new WB_Coord[surf ? n : 2 * n];
  for (int i=0; i < n; i++) {
    points[i]=polygon.getPoint(i);
  }
  if (!surf) {
    for (int i=0; i < n; i++) {
      points[n + i]=new WB_Point(points[i]).addMulSelf(thickness,norm);
    }
  }
  int[][] faces;
  if (surf) {
    faces=new int[1][n];
    for (int i=0; i < n; i++) {
      faces[0][i]=i;
    }
  }
 else {
    faces=new int[n + 2][];
    faces[n]=new int[n];
    faces[n + 1]=new int[n];
    for (int i=0; i < n; i++) {
      faces[n][i]=i;
      faces[n + 1][i]=(2 * n) - 1 - i;
      faces[i]=new int[4];
      faces[i][0]=i;
      faces[i][3]=(i + 1) % n;
      faces[i][2]=n + ((i + 1) % n);
      faces[i][1]=n + i;
    }
  }
  final HEC_FromFacelist fl=new HEC_FromFacelist();
  fl.setVertices(points).setFaces(faces).setDuplicate(false);
  return fl.createBase().flipAllFaces();
}

Fixed version (ground truth):
@Override protected HE_Mesh createBase(){
  if ((facets < 3) || (WB_Epsilon.isZero(radius))) {
    return null;
  }
  final WB_Point[] ppoints=new WB_Point[facets];
  for (int i=0; i < facets; i++) {
    final double x=radius * Math.cos(((Math.PI * 2.0) / facets) * i);
    final double y=radius * Math.sin(((Math.PI * 2.0) / facets) * i);
    ppoints[i]=new WB_Point(x,y,0.0);
  }
  final WB_Polygon polygon=gf.createSimplePolygon(ppoints);
  final WB_Vector norm=polygon.getPlane().getNormal();
  final int n=polygon.getNumberOfPoints();
  final boolean surf=WB_Epsilon.isZero(thickness);
  final WB_Coord[] points=new WB_Coord[surf ? n : 2 * n];
  for (int i=0; i < n; i++) {
    points[i]=polygon.getPoint(i);
  }
  if (!surf) {
    for (int i=0; i < n; i++) {
      points[n + i]=new WB_Point(points[i]).addMulSelf(thickness,norm);
    }
  }
  int[][] faces;
  if (surf) {
    faces=new int[1][n];
    for (int i=0; i < n; i++) {
      faces[0][i]=i;
    }
  }
 else {
    faces=new int[n + 2][];
    faces[n]=new int[n];
    faces[n + 1]=new int[n];
    for (int i=0; i < n; i++) {
      faces[n][i]=i;
      faces[n + 1][i]=(2 * n) - 1 - i;
      faces[i]=new int[4];
      faces[i][0]=i;
      faces[i][3]=(i + 1) % n;
      faces[i][2]=n + ((i + 1) % n);
      faces[i][1]=n + i;
    }
  }
  final HEC_FromFacelist fl=new HEC_FromFacelist();
  fl.setVertices(points).setFaces(faces).setDuplicate(false);
  return fl.createBase().flipFaces();
}
Program: 29979
Project: 29979
Buggy source:
/** 
 * @param P
 * @param p
 * @return
 */
public static WB_Classification classifyPointToPlane3D(final WB_Plane P,final WB_Coord p){
  if (WB_Epsilon.isZero(WB_GeometryOp.getDistanceToPlane3D(p,P))) {
    return WB_Classification.ON;
  }
  final WB_Predicates predicates=new WB_Predicates();
  final double signp=predicates.orientTetra(P.getOrigin(),P.getOrigin().addMul(100,P.getU()),P.getOrigin().addMul(100,P.getV()),p);
  if (signp == 0) {
    return WB_Classification.ON;
  }
  if (signp < 0) {
    return WB_Classification.FRONT;
  }
  return WB_Classification.BACK;
}

Fixed version (ground truth):
/** 
 * @param P
 * @param p
 * @return WB_Classification.ON,WB_Classification.FRONT or WB_Classification.BACK
 */
public static WB_Classification classifyPointToPlane3D(final WB_Plane P,final WB_Coord p){
  if (WB_Epsilon.isZero(WB_GeometryOp.getDistanceToPlane3D(p,P))) {
    return WB_Classification.ON;
  }
  final WB_Predicates predicates=new WB_Predicates();
  final double signp=predicates.orientTetra(P.getOrigin(),P.getOrigin().addMul(100,P.getU()),P.getOrigin().addMul(100,P.getV()),p);
  if (signp == 0) {
    return WB_Classification.ON;
  }
  if (signp < 0) {
    return WB_Classification.FRONT;
  }
  return WB_Classification.BACK;
}
Program: 29980
Project: 29980
Buggy source:
/** 
 * @return 
 */
protected List<WB_Point> getPoints(){
  return points;
}

Fixed version (ground truth):
/** 
 * @return
 */
public List<WB_Point> getPoints(){
  return points;
}
Program: 29982
Project: 29982
Buggy source:
/** 
 * @param tuples
 */
protected WB_CoordinateSequence(final double[][] tuples){
  ordinates=new TDoubleArrayList(tuples.length,Double.NaN);
  n=tuples.length;
  for (  final double[] p : tuples) {
    ordinates.add(p[0]);
    ordinates.add(p[1]);
    ordinates.add(p[2]);
    ordinates.add(p[3]);
  }
}

Fixed version (ground truth):
/** 
 * @param tuples
 */
public WB_CoordinateSequence(final double[][] tuples){
  ordinates=new TDoubleArrayList(tuples.length,Double.NaN);
  n=tuples.length;
  for (  final double[] p : tuples) {
    ordinates.add(p[0]);
    ordinates.add(p[1]);
    ordinates.add(p[2]);
    ordinates.add(p[3]);
  }
  revision=0;
}
Program: 29983
Project: 29983
Buggy source:
/** 
 * @return 
 */
public WB_Point getCenter(){
  final double[] center=new double[3];
  for (int i=0; i < 3; i++) {
    center[i]=0.5 * (_min[i] + _max[i]);
  }
  return new WB_Point(center);
}

Fixed version (ground truth):
/** 
 * @return
 */
public WB_Point getCenter(){
  final double[] center=new double[3];
  for (int i=0; i < 3; i++) {
    center[i]=0.5 * (_min[i] + _max[i]);
  }
  return new WB_Point(center);
}
Program: 29984
Project: 29984
Buggy source:
/** 
 * @param other 
 */
public void expandToInclude(final WB_AABB other){
  expandToInclude(other._min);
  expandToInclude(other._max);
}

Fixed version (ground truth):
/** 
 * @param other
 */
public void expandToInclude(final WB_AABB other){
  expandToInclude(other._min);
  expandToInclude(other._max);
}
Program: 29985
Project: 29985
Buggy source:
/** 
 * @param x 
 * @param y 
 * @param z 
 */
public void translate(final double x,final double y,final double z){
  if (isNull()) {
    return;
  }
  _min[0]+=x;
  _max[0]+=x;
  _min[1]+=y;
  _max[1]+=y;
  _min[2]+=z;
  _max[2]+=z;
}

Fixed version (ground truth):
/** 
 * @param x
 * @param y
 * @param z
 */
public void translate(final double x,final double y,final double z){
  if (isNull()) {
    return;
  }
  _min[0]+=x;
  _max[0]+=x;
  _min[1]+=y;
  _max[1]+=y;
  _min[2]+=z;
  _max[2]+=z;
}
Program: 29986
Project: 29986
Buggy source:
/** 
 * @param factor 
 */
public void pad(final double factor){
  final WB_Point c=getCenter();
  for (int i=0; i < 3; i++) {
    _min[i]=c.getd(i) + ((factor + 1.0) * (_min[i] - c.getd(i)));
    _max[i]=c.getd(i) + ((factor + 1.0) * (_max[i] - c.getd(i)));
  }
}

Fixed version (ground truth):
/** 
 * @param factor
 */
public void pad(final double factor){
  final WB_Point c=getCenter();
  for (int i=0; i < 3; i++) {
    _min[i]=c.getd(i) + ((factor + 1.0) * (_min[i] - c.getd(i)));
    _max[i]=c.getd(i) + ((factor + 1.0) * (_max[i] - c.getd(i)));
  }
}
Program: 29987
Project: 29987
Buggy source:
/** 
 * @return 
 */
public WB_Point getMin(){
  return new WB_Point(_min);
}

Fixed version (ground truth):
/** 
 * @return
 */
public WB_Point getMin(){
  return new WB_Point(_min);
}
Program: 29988
Project: 29988
Buggy source:
/** 
 * @param other 
 * @return 
 */
public WB_AABB intersection(final WB_AABB other){
  if (isNull() || other.isNull() || !intersects(other)) {
    return null;
  }
  final double[] newmin=new double[3];
  final double[] newmax=new double[3];
  for (int i=0; i < 3; i++) {
    newmin[i]=Math.max(_min[i],other._min[i]);
    newmax[i]=Math.min(_max[i],other._max[i]);
  }
  return new WB_AABB(newmin,newmax);
}

Fixed version (ground truth):
/** 
 * @param other
 * @return
 */
public WB_AABB intersection(final WB_AABB other){
  if (isNull() || other.isNull() || !intersects(other)) {
    return null;
  }
  final double[] newmin=new double[3];
  final double[] newmax=new double[3];
  for (int i=0; i < 3; i++) {
    newmin[i]=Math.max(_min[i],other._min[i]);
    newmax[i]=Math.min(_max[i],other._max[i]);
  }
  return new WB_AABB(newmin,newmax);
}
Program: 29989
Project: 29989
Buggy source:
/** 
 * @param id 
 */
public void setId(final int id){
  _id=id;
}

Fixed version (ground truth):
/** 
 * @param id
 */
public void setId(final int id){
  _id=id;
}
Program: 29990
Project: 29990
Buggy source:
/** 
 * @return 
 */
public double getCenterZ(){
  return 0.5 * (_min[2] + _max[2]);
}

Fixed version (ground truth):
/** 
 * @return
 */
public double getCenterZ(){
  return 0.5 * (_min[2] + _max[2]);
}
Program: 29991
Project: 29991
Buggy source:
/** 
 * @return 
 */
public double getCenterY(){
  return 0.5 * (_min[1] + _max[1]);
}

Fixed version (ground truth):
/** 
 * @return
 */
public double getCenterY(){
  return 0.5 * (_min[1] + _max[1]);
}
Program: 29992
Project: 29992
Buggy source:
/** 
 * @return 
 */
public double getCenterX(){
  return 0.5 * (_min[0] + _max[0]);
}

Fixed version (ground truth):
/** 
 * @return
 */
public double getCenterX(){
  return 0.5 * (_min[0] + _max[0]);
}
Program: 29993
Project: 29993
Buggy source:
/** 
 * @return 
 */
public WB_Point getMax(){
  return new WB_Point(_max);
}

Fixed version (ground truth):
/** 
 * @return
 */
public WB_Point getMax(){
  return new WB_Point(_max);
}
Program: 29994
Project: 29994
Buggy source:
/** 
 * @return 
 */
public int getTrueDim(){
  if (!isValid()) {
    return -1;
  }
  int dim=0;
  for (int i=0; i < 3; i++) {
    if ((_max[i] - _min[i]) >= WB_Epsilon.EPSILON) {
      dim++;
    }
  }
  return dim;
}

Fixed version (ground truth):
/** 
 * @return
 */
public int getTrueDim(){
  if (!isValid()) {
    return -1;
  }
  int dim=0;
  for (int i=0; i < 3; i++) {
    if ((_max[i] - _min[i]) >= WB_Epsilon.EPSILON) {
      dim++;
    }
  }
  return dim;
}
Program: 29995
Project: 29995
Buggy source:
/** 
 * @param x 
 * @return 
 */
public boolean contains(final double[] x){
  return covers(x);
}

Fixed version (ground truth):
/** 
 * @param x
 * @return
 */
public boolean contains(final double[] x){
  return covers(x);
}
Program: 29996
Project: 29996
Buggy source:
/** 
 * @return 
 */
public double getMinZ(){
  return _min[2];
}

Fixed version (ground truth):
/** 
 * @return
 */
public double getMinZ(){
  return _min[2];
}
Program: 29997
Project: 29997
Buggy source:
/** 
 * @return 
 */
public double getMinX(){
  return _min[0];
}

Fixed version (ground truth):
/** 
 * @return
 */
public double getMinX(){
  return _min[0];
}
Program: 29998
Project: 29998
Buggy source:
/** 
 * @return 
 */
public double getMinY(){
  return _min[1];
}

Fixed version (ground truth):
/** 
 * @return
 */
public double getMinY(){
  return _min[1];
}
Program: 29999
Project: 29999
Buggy source:
/** 
 * @return 
 */
public List<double[]> getCoords(){
  if (isNull()) {
    return null;
  }
  final int n=numberOfPoints();
  final List<double[]> points=new ArrayList<double[]>(n);
  double[] values;
  for (int i=0; i < n; i++) {
    values=new double[3];
    int disc=1;
    for (int j=0; j < 3; j++) {
      if (((i / disc) % 2) == 0) {
        values[j]=_min[j];
      }
 else {
        values[j]=_max[j];
      }
      disc*=2;
    }
    points.add(values);
  }
  return points;
}

Fixed version (ground truth):
/** 
 * @return
 */
public List<double[]> getCoords(){
  if (isNull()) {
    return null;
  }
  final int n=numberOfPoints();
  final List<double[]> points=new ArrayList<double[]>(n);
  double[] values;
  for (int i=0; i < n; i++) {
    values=new double[3];
    int disc=1;
    for (int j=0; j < 3; j++) {
      if (((i / disc) % 2) == 0) {
        values[j]=_min[j];
      }
 else {
        values[j]=_max[j];
      }
      disc*=2;
    }
    points.add(values);
  }
  return points;
}
Program: 30000
Project: 30000
Buggy source:
/** 
 * @return 
 */
public boolean isDegenerate(){
  return ((getTrueDim() < 3) && (getTrueDim() > -1));
}

Fixed version (ground truth):
/** 
 * @return
 */
public boolean isDegenerate(){
  return ((getTrueDim() < 3) && (getTrueDim() > -1));
}
Program: 30001
Project: 30001
Buggy source:
/** 
 * @return 
 */
public double getDepth(){
  return getSize(2);
}

Fixed version (ground truth):
/** 
 * @return
 */
public double getDepth(){
  return getSize(2);
}
Program: 30002
Project: 30002
Buggy source:
/** 
 * @param p1 
 * @param p2 
 * @param q1 
 * @param q2 
 * @return 
 */
public static boolean intersects(final WB_Coordinate p1,final WB_Coordinate p2,final WB_Coordinate q1,final WB_Coordinate q2){
  double minq=Math.min(q1.xd(),q2.xd());
  double maxq=Math.max(q1.xd(),q2.xd());
  double minp=Math.min(p1.xd(),p2.xd());
  double maxp=Math.max(p1.xd(),p2.xd());
  if (minp > maxq) {
    return false;
  }
  if (maxp < minq) {
    return false;
  }
  minq=Math.min(q1.yd(),q2.yd());
  maxq=Math.max(q1.yd(),q2.yd());
  minp=Math.min(p1.yd(),p2.yd());
  maxp=Math.max(p1.yd(),p2.yd());
  if (minp > maxq) {
    return false;
  }
  if (maxp < minq) {
    return false;
  }
  minq=Math.min(q1.zd(),q2.zd());
  maxq=Math.max(q1.zd(),q2.zd());
  minp=Math.min(p1.zd(),p2.zd());
  maxp=Math.max(p1.zd(),p2.zd());
  if (minp > maxq) {
    return false;
  }
  if (maxp < minq) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * @param p1
 * @param p2
 * @param q1
 * @param q2
 * @return
 */
public static boolean intersects(final WB_Coordinate p1,final WB_Coordinate p2,final WB_Coordinate q1,final WB_Coordinate q2){
  double minq=Math.min(q1.xd(),q2.xd());
  double maxq=Math.max(q1.xd(),q2.xd());
  double minp=Math.min(p1.xd(),p2.xd());
  double maxp=Math.max(p1.xd(),p2.xd());
  if (minp > maxq) {
    return false;
  }
  if (maxp < minq) {
    return false;
  }
  minq=Math.min(q1.yd(),q2.yd());
  maxq=Math.max(q1.yd(),q2.yd());
  minp=Math.min(p1.yd(),p2.yd());
  maxp=Math.max(p1.yd(),p2.yd());
  if (minp > maxq) {
    return false;
  }
  if (maxp < minq) {
    return false;
  }
  minq=Math.min(q1.zd(),q2.zd());
  maxq=Math.max(q1.zd(),q2.zd());
  minp=Math.min(p1.zd(),p2.zd());
  maxp=Math.max(p1.zd(),p2.zd());
  if (minp > maxq) {
    return false;
  }
  if (maxp < minq) {
    return false;
  }
  return true;
}
Program: 30003
Project: 30003
Buggy source:
/** 
 * @return 
 */
public int numberOfTriangles(){
  if (isNull()) {
    return 0;
  }
  return 12;
}

Fixed version (ground truth):
/** 
 * @return
 */
public int numberOfTriangles(){
  if (isNull()) {
    return 0;
  }
  return 12;
}
Program: 30004
Project: 30004
Buggy source:
/** 
 * @return 
 */
public int getId(){
  return _id;
}

Fixed version (ground truth):
/** 
 * @return
 */
public int getId(){
  return _id;
}
Program: 30005
Project: 30005
Buggy source:
/** 
 * @return 
 */
public double getWidth(){
  return getSize(0);
}

Fixed version (ground truth):
/** 
 * @return
 */
public double getWidth(){
  return getSize(0);
}
Program: 30006
Project: 30006
Buggy source:
/** 
 * @return 
 */
public double getHeight(){
  return getSize(1);
}

Fixed version (ground truth):
/** 
 * @return
 */
public double getHeight(){
  return getSize(1);
}
Program: 30007
Project: 30007
Buggy source:
/** 
 * @param v 
 * @return 
 */
private int hashCode(final double v){
  final long tmp=Double.doubleToLongBits(v);
  return (int)(tmp ^ (tmp >>> 32));
}

Fixed version (ground truth):
/** 
 * @param v
 * @return
 */
private int hashCode(final double v){
  final long tmp=Double.doubleToLongBits(v);
  return (int)(tmp ^ (tmp >>> 32));
}
Program: 30008
Project: 30008
Buggy source:
/** 
 * @return 
 */
public WB_AABB get(){
  return new WB_AABB(_min,_max);
}

Fixed version (ground truth):
/** 
 * @return
 */
public WB_AABB get(){
  return new WB_AABB(_min,_max);
}
Program: 30009
Project: 30009
Buggy source:
/** 
 * @return 
 */
public int numberOfPoints(){
  if (isNull()) {
    return 0;
  }
  return 8;
}

Fixed version (ground truth):
/** 
 * @return
 */
public int numberOfPoints(){
  if (isNull()) {
    return 0;
  }
  return 8;
}
Program: 30010
Project: 30010
Buggy source:
/** 
 * @return 
 */
public WB_Point[] getPoints(){
  if (isNull()) {
    return null;
  }
  final int n=numberOfPoints();
  final WB_Point[] points=new WB_Point[n];
  double[] values;
  for (int i=0; i < n; i++) {
    values=new double[3];
    int disc=1;
    for (int j=0; j < 3; j++) {
      if (((i / disc) % 2) == 0) {
        values[j]=_min[j];
      }
 else {
        values[j]=_max[j];
      }
      disc*=2;
    }
    points[i]=new WB_Point(values);
  }
  return points;
}

Fixed version (ground truth):
/** 
 * @return
 */
public WB_Point[] getPoints(){
  if (isNull()) {
    return null;
  }
  final int n=numberOfPoints();
  final WB_Point[] points=new WB_Point[n];
  double[] values;
  for (int i=0; i < n; i++) {
    values=new double[3];
    int disc=1;
    for (int j=0; j < 3; j++) {
      if (((i / disc) % 2) == 0) {
        values[j]=_min[j];
      }
 else {
        values[j]=_max[j];
      }
      disc*=2;
    }
    points[i]=new WB_Point(values);
  }
  return points;
}
Program: 30011
Project: 30011
Buggy source:
/** 
 * @return 
 */
public int getDim(){
  return 3;
}

Fixed version (ground truth):
/** 
 * @return
 */
public int getDim(){
  return 3;
}
Program: 30012
Project: 30012
Buggy source:
/** 
 * @return 
 */
public List<int[]> getTriangles(){
  final List<int[]> tris=new ArrayList<int[]>();
  final int[] tri01={4,5,6};
  final int[] tri02={5,7,6};
  tris.add(tri01);
  tris.add(tri02);
  final int[] tri11={0,2,1};
  final int[] tri12={2,3,1};
  tris.add(tri11);
  tris.add(tri12);
  final int[] tri21={0,1,4};
  final int[] tri22={1,5,4};
  tris.add(tri21);
  tris.add(tri22);
  final int[] tri31={3,2,7};
  final int[] tri32={2,6,7};
  tris.add(tri31);
  tris.add(tri32);
  final int[] tri41={0,4,2};
  final int[] tri42={4,6,2};
  tris.add(tri41);
  tris.add(tri42);
  final int[] tri51={1,3,5};
  final int[] tri52={3,7,5};
  tris.add(tri51);
  tris.add(tri52);
  return tris;
}

Fixed version (ground truth):
/** 
 * @return
 */
public List<int[]> getTriangles(){
  final List<int[]> tris=new ArrayList<int[]>();
  final int[] tri01={4,5,6};
  final int[] tri02={5,7,6};
  tris.add(tri01);
  tris.add(tri02);
  final int[] tri11={0,2,1};
  final int[] tri12={2,3,1};
  tris.add(tri11);
  tris.add(tri12);
  final int[] tri21={0,1,4};
  final int[] tri22={1,5,4};
  tris.add(tri21);
  tris.add(tri22);
  final int[] tri31={3,2,7};
  final int[] tri32={2,6,7};
  tris.add(tri31);
  tris.add(tri32);
  final int[] tri41={0,4,2};
  final int[] tri42={4,6,2};
  tris.add(tri41);
  tris.add(tri42);
  final int[] tri51={1,3,5};
  final int[] tri52={3,7,5};
  tris.add(tri51);
  tris.add(tri52);
  return tris;
}
Program: 30013
Project: 30013
Buggy source:
/** 
 * @param s 
 * @return 
 */
public Object getData(final String s){
  return _data.get(s);
}

Fixed version (ground truth):
/** 
 * @param s
 * @return
 */
public Object getData(final String s){
  return (_data == null) ? null : _data.get(s);
}
Program: 30014
Project: 30014
Buggy source:
/** 
 * @return 
 */
public double maxExtent(){
  if (isNull()) {
    return 0.0;
  }
  final double w=getWidth();
  final double h=getHeight();
  final double d=getDepth();
  if (w > h) {
    return (w > d) ? w : d;
  }
  return (h > d) ? h : d;
}

Fixed version (ground truth):
/** 
 * @return
 */
public double maxExtent(){
  if (isNull()) {
    return 0.0;
  }
  final double w=getWidth();
  final double h=getHeight();
  final double d=getDepth();
  if (w > h) {
    return (w > d) ? w : d;
  }
  return (h > d) ? h : d;
}
Program: 30015
Project: 30015
Buggy source:
/** 
 * @param other 
 * @return 
 */
public boolean covers(final WB_AABB other){
  if (isNull() || other.isNull()) {
    return false;
  }
  for (int i=0; i < 3; i++) {
    if (other._max[i] > _max[i]) {
      return false;
    }
    if (other._min[i] < _min[i]) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * @param other
 * @return
 */
public boolean covers(final WB_AABB other){
  if (isNull() || other.isNull()) {
    return false;
  }
  for (int i=0; i < 3; i++) {
    if (other._max[i] > _max[i]) {
      return false;
    }
    if (other._min[i] < _min[i]) {
      return false;
    }
  }
  return true;
}
Program: 30016
Project: 30016
Buggy source:
/** 
 * @return 
 */
public List<int[]> getSegments(){
  final List<double[]> points=getCoords();
  final List<int[]> segments=new ArrayList<int[]>(numberOfSegments());
  for (int i=0; i < points.size(); i++) {
    for (int j=i + 1; j < points.size(); j++) {
      int comp=0;
      for (int k=0; k < 3; k++) {
        if (points.get(i)[k] != points.get(j)[k]) {
          comp++;
        }
        if (comp > 1) {
          break;
        }
      }
      if (comp == 1) {
        final int[] seg={i,j};
        segments.add(seg);
      }
    }
  }
  return segments;
}

Fixed version (ground truth):
/** 
 * @return
 */
public List<int[]> getSegments(){
  final List<double[]> points=getCoords();
  final List<int[]> segments=new ArrayList<int[]>(numberOfSegments());
  for (int i=0; i < points.size(); i++) {
    for (int j=i + 1; j < points.size(); j++) {
      int comp=0;
      for (int k=0; k < 3; k++) {
        if (points.get(i)[k] != points.get(j)[k]) {
          comp++;
        }
        if (comp > 1) {
          break;
        }
      }
      if (comp == 1) {
        final int[] seg={i,j};
        segments.add(seg);
      }
    }
  }
  return segments;
}
Program: 30017
Project: 30017
Buggy source:
/** 
 * @param tuple 
 * @return 
 */
public double getDistance(final WB_Coordinate tuple){
  double dx=0;
  double sqr=0;
  for (int i=0; i < 3; i++) {
    if (_max[i] < tuple.getd(i)) {
      sqr+=(dx=tuple.getd(i) - _max[i]) * dx;
    }
 else     if (_min[i] > tuple.getd(i)) {
      sqr+=(dx=_min[i] - tuple.getd(i)) * dx;
    }
  }
  return Math.sqrt(sqr);
}

Fixed version (ground truth):
/** 
 * @param tuple
 * @return
 */
public double getDistance(final WB_Coordinate tuple){
  double dx=0;
  double sqr=0;
  for (int i=0; i < 3; i++) {
    if (_max[i] < tuple.getd(i)) {
      sqr+=(dx=tuple.getd(i) - _max[i]) * dx;
    }
 else     if (_min[i] > tuple.getd(i)) {
      sqr+=(dx=_min[i] - tuple.getd(i)) * dx;
    }
  }
  return Math.sqrt(sqr);
}
Program: 30018
Project: 30018
Buggy source:
/** 
 * @param points 
 */
public WB_AABB(final WB_CoordinateSequence points){
  init();
  double val;
  for (int i=0; i < points.size(); i++) {
    for (int j=0; j < 3; j++) {
      val=points.get(i,j);
      if (_min[j] > val) {
        _min[j]=val;
      }
      if (_max[j] < val) {
        _max[j]=val;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * @param points
 */
public WB_AABB(final WB_CoordinateSequence points){
  init();
  double val;
  for (int i=0; i < points.size(); i++) {
    for (int j=0; j < 3; j++) {
      val=points.get(i,j);
      if (_min[j] > val) {
        _min[j]=val;
      }
      if (_max[j] < val) {
        _max[j]=val;
      }
    }
  }
}
Program: 30019
Project: 30019
Buggy source:
/** 
 * @param src 
 */
public void set(final WB_AABB src){
  System.arraycopy(src._min,0,_min,0,3);
  System.arraycopy(src._max,0,_max,0,3);
}

Fixed version (ground truth):
/** 
 * @param src
 */
public void set(final WB_AABB src){
  System.arraycopy(src._min,0,_min,0,3);
  System.arraycopy(src._max,0,_max,0,3);
}
Program: 30020
Project: 30020
Buggy source:
/** 
 * @param s 
 * @param o 
 */
public void setData(final String s,final Object o){
  if (_data == null) {
    _data=new HashMap<String,Object>();
  }
  _data.put(s,o);
}

Fixed version (ground truth):
/** 
 * @param s
 * @param o
 */
public void setData(final String s,final Object o){
  if (_data == null) {
    _data=new HashMap<String,Object>();
  }
  _data.put(s,o);
}
Program: 30021
Project: 30021
Buggy source:
/** 
 * @return 
 */
public double minExtent(){
  if (isNull()) {
    return 0.0;
  }
  final double w=getWidth();
  final double h=getHeight();
  final double d=getDepth();
  if (w < h) {
    return (w < d) ? w : d;
  }
  return (h < d) ? h : d;
}

Fixed version (ground truth):
/** 
 * @return
 */
public double minExtent(){
  if (isNull()) {
    return 0.0;
  }
  final double w=getWidth();
  final double h=getHeight();
  final double d=getDepth();
  if (w < h) {
    return (w < d) ? w : d;
  }
  return (h < d) ? h : d;
}
Program: 30022
Project: 30022
Buggy source:
/** 
 * @return 
 */
public boolean isValid(){
  return !isNull();
}

Fixed version (ground truth):
/** 
 * @return
 */
public boolean isValid(){
  return !isNull();
}
Program: 30023
Project: 30023
Buggy source:
/** 
 * @return 
 */
public double getMaxX(){
  return _max[0];
}

Fixed version (ground truth):
/** 
 * @return
 */
public double getMaxX(){
  return _max[0];
}
Program: 30024
Project: 30024
Buggy source:
/** 
 * @return 
 */
public int[][] getFaces(){
  final int[][] faces=new int[6][];
  faces[0]=new int[]{4,5,7,6};
  faces[1]=new int[]{0,2,3,1};
  faces[2]=new int[]{0,1,5,4};
  faces[3]=new int[]{3,2,6,7};
  faces[4]=new int[]{0,4,6,2};
  faces[5]=new int[]{1,3,7,5};
  return faces;
}

Fixed version (ground truth):
/** 
 * @return
 */
public int[][] getFaces(){
  final int[][] faces=new int[6][];
  faces[0]=new int[]{4,5,7,6};
  faces[1]=new int[]{0,2,3,1};
  faces[2]=new int[]{0,1,5,4};
  faces[3]=new int[]{3,2,6,7};
  faces[4]=new int[]{0,4,6,2};
  faces[5]=new int[]{1,3,7,5};
  return faces;
}
Program: 30025
Project: 30025
Buggy source:
/** 
 * @return 
 */
public double getMaxY(){
  return _max[1];
}

Fixed version (ground truth):
/** 
 * @return
 */
public double getMaxY(){
  return _max[1];
}
Program: 30026
Project: 30026
Buggy source:
/** 
 * @param aabb 
 * @return 
 */
public WB_AABB union(final WB_AABB aabb){
  final double[] newmin=new double[3];
  final double[] newmax=new double[3];
  for (int i=0; i < 3; i++) {
    newmin[i]=Math.min(_min[i],aabb._min[i]);
    newmax[i]=Math.max(_max[i],aabb._max[i]);
  }
  return new WB_AABB(newmin,newmax);
}

Fixed version (ground truth):
/** 
 * @param aabb
 * @return
 */
public WB_AABB union(final WB_AABB aabb){
  final double[] newmin=new double[3];
  final double[] newmax=new double[3];
  for (int i=0; i < 3; i++) {
    newmin[i]=Math.min(_min[i],aabb._min[i]);
    newmax[i]=Math.max(_max[i],aabb._max[i]);
  }
  return new WB_AABB(newmin,newmax);
}
Program: 30027
Project: 30027
Buggy source:
/** 
 * @return 
 */
public double getMaxZ(){
  return _max[2];
}

Fixed version (ground truth):
/** 
 * @return
 */
public double getMaxZ(){
  return _max[2];
}
Program: 30028
Project: 30028
Buggy source:
/** 
 * @return 
 */
public int numberOfSegments(){
  if (isNull()) {
    return 0;
  }
  return 12;
}

Fixed version (ground truth):
/** 
 * @return
 */
public int numberOfSegments(){
  if (isNull()) {
    return 0;
  }
  return 12;
}
Program: 30029
Project: 30029
Buggy source:
/** 
 * @param i 
 * @return 
 */
public double getSize(final int i){
  if (isNull()) {
    return 0;
  }
  return _max[i] - _min[i];
}

Fixed version (ground truth):
/** 
 * @param i
 * @return
 */
public double getSize(final int i){
  if (isNull()) {
    return 0;
  }
  return _max[i] - _min[i];
}
Program: 30030
Project: 30030
Buggy source:
/** 
 * @return 
 */
public int minOrdinate(){
  if (isNull()) {
    return 0;
  }
  double res=Double.POSITIVE_INFINITY;
  int ord=0;
  for (int i=0; i < 3; i++) {
    final double w=getSize(i);
    if (res > w) {
      res=w;
      ord=i;
    }
  }
  return ord;
}

Fixed version (ground truth):
/** 
 * @return
 */
public int minOrdinate(){
  if (isNull()) {
    return 0;
  }
  double res=Double.POSITIVE_INFINITY;
  int ord=0;
  for (int i=0; i < 3; i++) {
    final double w=getSize(i);
    if (res > w) {
      res=w;
      ord=i;
    }
  }
  return ord;
}
Program: 30031
Project: 30031
Buggy source:
/** 
 * @param tuple 
 * @return 
 */
public double getDistanceSquare(final WB_Coordinate tuple){
  double dx=0;
  double sqr=0;
  for (int i=0; i < 3; i++) {
    if (_max[i] < tuple.getd(i)) {
      sqr+=(dx=tuple.getd(i) - _max[i]) * dx;
    }
 else     if (_min[i] > tuple.getd(i)) {
      sqr+=(dx=_min[i] - tuple.getd(i)) * dx;
    }
  }
  return sqr;
}

Fixed version (ground truth):
/** 
 * @param tuple
 * @return
 */
public double getDistanceSquare(final WB_Coordinate tuple){
  double dx=0;
  double sqr=0;
  for (int i=0; i < 3; i++) {
    if (_max[i] < tuple.getd(i)) {
      sqr+=(dx=tuple.getd(i) - _max[i]) * dx;
    }
 else     if (_min[i] > tuple.getd(i)) {
      sqr+=(dx=_min[i] - tuple.getd(i)) * dx;
    }
  }
  return sqr;
}
Program: 30032
Project: 30032
Buggy source:
/** 
 * @return 
 */
public int numberOfFaces(){
  if (isNull()) {
    return 0;
  }
  return 6;
}

Fixed version (ground truth):
/** 
 * @return
 */
public int numberOfFaces(){
  if (isNull()) {
    return 0;
  }
  return 6;
}
Program: 30033
Project: 30033
Buggy source:
/** 
 * @param other 
 * @return 
 */
public boolean equals(final WB_AABB other){
  if (isNull()) {
    return other.isNull();
  }
  for (int i=0; i < 3; i++) {
    if (other._max[i] != _max[i]) {
      return false;
    }
    if (other._min[i] != _min[i]) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * @param other
 * @return
 */
public boolean equals(final WB_AABB other){
  if (isNull()) {
    return other.isNull();
  }
  for (int i=0; i < 3; i++) {
    if (other._max[i] != _max[i]) {
      return false;
    }
    if (other._min[i] != _min[i]) {
      return false;
    }
  }
  return true;
}
Program: 30034
Project: 30034
Buggy source:
/** 
 * @return 
 */
public boolean isNull(){
  return _max[0] < _min[0];
}

Fixed version (ground truth):
/** 
 * @return
 */
public boolean isNull(){
  return _max[0] < _min[0];
}
Program: 30035
Project: 30035
Buggy source:
/** 
 * @return 
 */
public int maxOrdinate(){
  if (isNull()) {
    return 0;
  }
  double res=Double.NEGATIVE_INFINITY;
  int ord=0;
  for (int i=0; i < 3; i++) {
    final double w=getSize(i);
    if (res < w) {
      res=w;
      ord=i;
    }
  }
  return ord;
}

Fixed version (ground truth):
/** 
 * @return
 */
public int maxOrdinate(){
  if (isNull()) {
    return 0;
  }
  double res=Double.NEGATIVE_INFINITY;
  int ord=0;
  for (int i=0; i < 3; i++) {
    final double w=getSize(i);
    if (res < w) {
      res=w;
      ord=i;
    }
  }
  return ord;
}
Program: 30036
Project: 30036
Buggy source:
/** 
 * @param dx 
 * @param dy 
 * @param dz 
 */
public void expandBy(final double dx,final double dy,final double dz){
  if (isNull()) {
    return;
  }
  _min[0]-=dx;
  _max[0]+=dx;
  if (_min[0] > _max[0]) {
    setToNull();
    return;
  }
  _min[1]-=dy;
  _max[1]+=dy;
  if (_min[1] > _max[1]) {
    setToNull();
    return;
  }
  _min[2]-=dz;
  _max[2]+=dz;
  if (_min[2] > _max[2]) {
    setToNull();
    return;
  }
}

Fixed version (ground truth):
/** 
 * @param dx
 * @param dy
 * @param dz
 */
public void expandBy(final double dx,final double dy,final double dz){
  if (isNull()) {
    return;
  }
  _min[0]-=dx;
  _max[0]+=dx;
  if (_min[0] > _max[0]) {
    setToNull();
    return;
  }
  _min[1]-=dy;
  _max[1]+=dy;
  if (_min[1] > _max[1]) {
    setToNull();
    return;
  }
  _min[2]-=dz;
  _max[2]+=dz;
  if (_min[2] > _max[2]) {
    setToNull();
    return;
  }
}
Program: 30037
Project: 30037
Buggy source:
/** 
 * @param i 
 * @return 
 */
public double[] getCoord(final int i){
  final double[] values=new double[3];
  int disc=1;
  for (int j=0; j < 3; j++) {
    if (((i / disc) % 2) == 0) {
      values[j]=_min[j];
    }
 else {
      values[j]=_max[j];
    }
    disc*=2;
  }
  return (values);
}

Fixed version (ground truth):
/** 
 * @param i
 * @return
 */
public double[] getCoord(final int i){
  final double[] values=new double[3];
  int disc=1;
  for (int j=0; j < 3; j++) {
    if (((i / disc) % 2) == 0) {
      values[j]=_min[j];
    }
 else {
      values[j]=_max[j];
    }
    disc*=2;
  }
  return (values);
}
Program: 30038
Project: 30038
Buggy source:
/** 
 * @return 
 */
public double getArea(){
  return getWidth() * getHeight() * getDepth();
}

Fixed version (ground truth):
/** 
 * @return
 */
public double getArea(){
  return getWidth() * getHeight() * getDepth();
}
Program: 30039
Project: 30039
Buggy source:
/** 
 * @param s 
 * @param e 
 */
TriangulateRunner(final int s,final int e){
  start=s;
  end=e;
}

Fixed version (ground truth):
/** 
 * @param s
 * @param e
 */
TriangulateRunner(final int s,final int e){
  start=s;
  end=e;
}
Program: 30040
Project: 30040
Buggy source:
/** 
 * @return 
 */
public double Kmin(){
  if (!curvaturesUpdated) {
    updateCurvatures();
  }
  return Kmin;
}

Fixed version (ground truth):
/** 
 * @return
 */
public double Kmin(){
  if (!curvaturesUpdated) {
    updateCurvatures();
  }
  return Kmin;
}
Program: 30041
Project: 30041
Buggy source:
/** 
 * @return 
 */
public double k1max(){
  if (!curvaturesUpdated) {
    updateCurvatures();
  }
  return k1max;
}

Fixed version (ground truth):
/** 
 * @return
 */
public double k1max(){
  if (!curvaturesUpdated) {
    updateCurvatures();
  }
  return k1max;
}
Program: 30042
Project: 30042
Buggy source:
/** 
 * @param i 
 * @return 
 */
public int[] vfNeighbors(final int i){
  if (!vfNeighborsUpdated) {
    updatevfNeighbors();
  }
  return vfNeighbors[i];
}

Fixed version (ground truth):
/** 
 * @param i
 * @return
 */
public int[] vfNeighbors(final int i){
  if (!vfNeighborsUpdated) {
    updatevfNeighbors();
  }
  return vfNeighbors[i];
}
Program: 30043
Project: 30043
Buggy source:
/** 
 * @return 
 */
public double k1min(){
  if (!curvaturesUpdated) {
    updateCurvatures();
  }
  return k1min;
}

Fixed version (ground truth):
/** 
 * @return
 */
public double k1min(){
  if (!curvaturesUpdated) {
    updateCurvatures();
  }
  return k1min;
}
Program: 30044
Project: 30044
Buggy source:
/** 
 * @return 
 */
public double Kmax(){
  if (!curvaturesUpdated) {
    updateCurvatures();
  }
  return Kmax;
}

Fixed version (ground truth):
/** 
 * @return
 */
public double Kmax(){
  if (!curvaturesUpdated) {
    updateCurvatures();
  }
  return Kmax;
}
Program: 30045
Project: 30045
Buggy source:
/** 
 * @param id 
 * @return 
 */
public WB_Polygon getPolygon(final int id){
  return geometryfactory.createSimplePolygon(vertices.getSubSequence(faces[id]));
}

Fixed version (ground truth):
/** 
 * @param id
 * @return
 */
public WB_Polygon getPolygon(final int id){
  return geometryfactory.createSimplePolygon(vertices.getSubSequence(faces[id]));
}
Program: 30046
Project: 30046
Buggy source:
/** 
 * @return 
 */
public WB_FaceListMesh triangulate(){
  return triangulateST();
}

Fixed version (ground truth):
/** 
 * @return
 */
public WB_FaceListMesh triangulate(){
  return triangulateST();
}
Program: 30047
Project: 30047
Buggy source:
/** 
 * @return 
 */
public double k2max(){
  if (!curvaturesUpdated) {
    updateCurvatures();
  }
  return k2max;
}

Fixed version (ground truth):
/** 
 * @return
 */
public double k2max(){
  if (!curvaturesUpdated) {
    updateCurvatures();
  }
  return k2max;
}