nus-yam/ex-repair huggingface dataset:
Program: 186315
Project: 186315
Buggy source:
/** 
 * renders the content added by   {@link #fillTarget(JOGLTarget)}. Only has an effect if   {@link #canBeUsed()} is true.
 * @param gl  needs to be the same gl as in previous calls
 */
public void renderTo(GL gl,Camera camera,Projection projection){
  if (canBeUsed() && camera != null && projection != null) {
    if (target == null) {
      if ("String_Node_Str".equals(config.getString("String_Node_Str"))) {
        boolean shadowVolumes="String_Node_Str".equals(config.getString("String_Node_Str"));
        boolean shadowMaps="String_Node_Str".equals(config.getString("String_Node_Str"));
        target=new JOGLTargetShader(gl.getGL3(),new JOGLRenderingParameters(null,false,true,shadowVolumes,shadowMaps),null);
      }
 else {
        target=new JOGLTargetFixedFunction(gl.getGL2(),new JOGLRenderingParameters(null,false,true,false,false),null);
      }
      target.setConfiguration(config);
    }
 else     if (targetNeedsReset) {
      target.reset();
    }
    targetNeedsReset=false;
    boolean viewChanged=!camera.getPos().equals(this.cameraPos) || !camera.getUp().equals(this.cameraUp) || !camera.getLookAt().equals(this.cameraLookAt)|| !projection.equals(this.projection);
    this.camera=camera;
    this.cameraPos=camera.getPos();
    this.cameraUp=camera.getUp();
    this.cameraLookAt=camera.getLookAt();
    this.projection=projection;
    if (!target.isFinished()) {
      fillTarget(target);
      target.finish();
    }
 else {
      updateTarget(target,viewChanged);
      target.finish();
    }
    target.render(camera,projection);
  }
}

Fixed version (ground truth):
/** 
 * renders the content added by   {@link #fillTarget(JOGLTarget)}. Only has an effect if   {@link #canBeUsed()} is true.
 * @param gl  needs to be the same gl as in previous calls
 */
public void renderTo(GL gl,Camera camera,Projection projection){
  if (canBeUsed() && camera != null && projection != null) {
    if (target == null) {
      if ("String_Node_Str".equals(config.getString("String_Node_Str"))) {
        target=new JOGLTargetShader(gl.getGL3(),new JOGLRenderingParameters(null,false,true,false,false),null);
      }
 else {
        target=new JOGLTargetFixedFunction(gl.getGL2(),new JOGLRenderingParameters(null,false,true,false,false),null);
      }
      target.setConfiguration(config);
    }
 else     if (targetNeedsReset) {
      target.reset();
    }
    targetNeedsReset=false;
    boolean viewChanged=!camera.getPos().equals(this.cameraPos) || !camera.getUp().equals(this.cameraUp) || !camera.getLookAt().equals(this.cameraLookAt)|| !projection.equals(this.projection);
    this.camera=camera;
    this.cameraPos=camera.getPos();
    this.cameraUp=camera.getUp();
    this.cameraLookAt=camera.getLookAt();
    this.projection=projection;
    if (!target.isFinished()) {
      fillTarget(target);
      target.finish();
    }
 else {
      updateTarget(target,viewChanged);
      target.finish();
    }
    target.render(camera,projection);
  }
}
Program: 186316
Project: 186316
Buggy source:
private void setParameters(final JOGLTarget target){
  boolean shadowVolumes="String_Node_Str".equals(config.getString("String_Node_Str"));
  boolean shadowMaps="String_Node_Str".equals(config.getString("String_Node_Str"));
  target.setRenderingParameters(new JOGLRenderingParameters(renderOptions.isBackfaceCulling() ? CCW : null,renderOptions.isWireframe(),true,shadowVolumes,shadowMaps));
  target.setGlobalLightingParameters(GlobalLightingParameters.DEFAULT);
}

Fixed version (ground truth):
private void setParameters(final JOGLTarget target){
  boolean shadowVolumes="String_Node_Str".equals(config.getString("String_Node_Str")) || "String_Node_Str".equals(config.getString("String_Node_Str"));
  boolean shadowMaps="String_Node_Str".equals(config.getString("String_Node_Str")) || "String_Node_Str".equals(config.getString("String_Node_Str"));
  target.setRenderingParameters(new JOGLRenderingParameters(renderOptions.isBackfaceCulling() ? CCW : null,renderOptions.isWireframe(),true,shadowVolumes,shadowMaps));
  target.setGlobalLightingParameters(GlobalLightingParameters.DEFAULT);
}
Program: 186317
Project: 186317
Buggy source:
private void setParameters(final JOGLTarget target){
  boolean shadowVolumes="String_Node_Str".equals(config.getString("String_Node_Str"));
  boolean shadowMaps="String_Node_Str".equals(config.getString("String_Node_Str"));
  target.setRenderingParameters(new JOGLRenderingParameters(renderOptions.isBackfaceCulling() ? CCW : null,renderOptions.isWireframe(),true,shadowVolumes,shadowMaps));
  target.setGlobalLightingParameters(GlobalLightingParameters.DEFAULT);
}

Fixed version (ground truth):
private void setParameters(final JOGLTarget target){
  boolean shadowVolumes="String_Node_Str".equals(config.getString("String_Node_Str")) || "String_Node_Str".equals(config.getString("String_Node_Str"));
  boolean shadowMaps="String_Node_Str".equals(config.getString("String_Node_Str")) || "String_Node_Str".equals(config.getString("String_Node_Str"));
  target.setRenderingParameters(new JOGLRenderingParameters(renderOptions.isBackfaceCulling() ? CCW : null,renderOptions.isWireframe(),true,shadowVolumes,shadowMaps));
  target.setGlobalLightingParameters(GlobalLightingParameters.DEFAULT);
}
Program: 186318
Project: 186318
Buggy source:
public PolygonWithHolesXZ(SimplePolygonXZ outerPolygon,List<SimplePolygonXZ> holes){
  this.outerPolygon=outerPolygon;
  this.holes=holes;
}

Fixed version (ground truth):
public PolygonWithHolesXZ(SimplePolygonXZ outerPolygon,List<SimplePolygonXZ> holes){
  this.outerPolygon=outerPolygon;
  this.holes=holes;
  this.getArea();
}
Program: 186319
Project: 186319
Buggy source:
private void addTileSites(Collection<VectorXYZ> result,int tileLon,int tileLat,double minLon,double minLat,double maxLon,double maxLat){
  SRTMTile tile=getTile(tileLon,tileLat);
  if (tile == null)   return;
  int minX=max(0,(int)ceil(SRTMTile.PIXELS * (minLon - tileLon)));
  int maxX=min(SRTMTile.PIXELS - 1,(int)floor(SRTMTile.PIXELS * (maxLon - tileLon)));
  int minY=max(0,(int)ceil(SRTMTile.PIXELS * (minLat - tileLat)));
  int maxY=min(SRTMTile.PIXELS - 1,(int)floor(SRTMTile.PIXELS * (maxLat - tileLat)));
  for (int x=minX; x < maxX; x++) {
    for (int y=minY; y < maxY; y++) {
      short value=tile.getData(x,y);
      double lat=tileLat + 1.0 / SRTMTile.PIXELS * y;
      double lon=tileLon + 1.0 / SRTMTile.PIXELS * x;
      VectorXZ pos=projection.calcPos(lat,lon);
      if (value != SRTMTile.BLANK_VALUE && !Double.isNaN(pos.x) && !Double.isNaN(pos.z)) {
        result.add(pos.xyz(value));
      }
    }
  }
}

Fixed version (ground truth):
private void addTileSites(Collection<VectorXYZ> result,int tileLon,int tileLat,double minLon,double minLat,double maxLon,double maxLat){
  SRTMTile tile=getTile(tileLon,tileLat);
  if (tile == null)   return;
  int minX=max(0,(int)ceil(SRTMTile.PIXELS * (minLon - tileLon)));
  int maxX=min(SRTMTile.PIXELS - 1,(int)floor(SRTMTile.PIXELS * (maxLon - tileLon)));
  int minY=max(0,(int)ceil(SRTMTile.PIXELS * (minLat - tileLat)));
  int maxY=min(SRTMTile.PIXELS - 1,(int)floor(SRTMTile.PIXELS * (maxLat - tileLat)));
  for (int x=minX; x < maxX; x++) {
    for (int y=minY; y < maxY; y++) {
      short value=tile.getData(x,y);
      double lat=tileLat + 1.0 / SRTMTile.PIXELS * (y + 0.5);
      double lon=tileLon + 1.0 / SRTMTile.PIXELS * (x + 0.5);
      VectorXZ pos=projection.calcPos(lat,lon);
      if (value != SRTMTile.BLANK_VALUE && !Double.isNaN(pos.x) && !Double.isNaN(pos.z)) {
        result.add(pos.xyz(value));
      }
    }
  }
}
Program: 186320
Project: 186320
Buggy source:
@Override public void drawTriangles(Material material,Collection<? extends TriangleXYZ> triangles,List<List<VectorXZ>> texCoordLists){
  int i=0;
  for (  TriangleXYZ triangle : triangles) {
    if (reconstructFaces()) {
      VectorXYZ n=triangle.getNormal();
      if (Double.isNaN(n.x) || Double.isNaN(n.y) || Double.isNaN(n.z)) {
        continue;
      }
      isolatedTriangles.put(material,new IsolatedTriangle(triangle,n,i * 3,texCoordLists));
    }
 else {
      drawFace(material,triangle.getVertices(),null,texCoordLists);
    }
  }
}

Fixed version (ground truth):
@Override public void drawTriangles(Material material,Collection<? extends TriangleXYZ> triangles,List<List<VectorXZ>> texCoordLists){
  int i=0;
  for (  TriangleXYZ triangle : triangles) {
    if (reconstructFaces()) {
      VectorXYZ n=triangle.getNormal();
      if (Double.isNaN(n.x) || Double.isNaN(n.y) || Double.isNaN(n.z)) {
        continue;
      }
      isolatedTriangles.put(material,new IsolatedTriangle(triangle,n,i * 3,texCoordLists));
    }
 else {
      List<List<VectorXZ>> subLists=new ArrayList<List<VectorXZ>>();
      for (      List<VectorXZ> list : texCoordLists) {
        subLists.add(list.subList(3 * i,3 * (i + 1)));
      }
      drawFace(material,triangle.getVertices(),null,subLists);
    }
    i++;
  }
}
Program: 186321
Project: 186321
Buggy source:
public void insert(VectorXYZ point){
  DelaunayTriangle triangleEnclosingPoint=getEnlosingTriangle(point);
  Stack<Flip> splitStack=new Stack<Flip>();
  Flip13 initialFlip=new Flip13(triangleEnclosingPoint,point);
  initialFlip.perform();
  splitStack.push(initialFlip);
  Queue<DelaunayTriangle> uncheckedTriangles=new LinkedList<DelaunayTriangle>();
  uncheckedTriangles.offer(initialFlip.createdTriangles[0]);
  uncheckedTriangles.offer(initialFlip.createdTriangles[1]);
  uncheckedTriangles.offer(initialFlip.createdTriangles[2]);
  while (!uncheckedTriangles.isEmpty()) {
    DelaunayTriangle triangle=uncheckedTriangles.poll();
    if (!isDelaunay(triangle)) {
      Flip22 flip=new Flip22(triangle);
      flip.perform();
      splitStack.push(flip);
    }
  }
}

Fixed version (ground truth):
public void insert(VectorXYZ point){
  DelaunayTriangle triangleEnclosingPoint=getEnlosingTriangle(point);
  Stack<Flip> splitStack=new Stack<Flip>();
  Flip13 initialFlip=new Flip13(triangleEnclosingPoint,point);
  initialFlip.perform();
  splitStack.push(initialFlip);
  Queue<DelaunayTriangle> uncheckedTriangles=new LinkedList<DelaunayTriangle>();
  uncheckedTriangles.offer(initialFlip.createdTriangles[0]);
  uncheckedTriangles.offer(initialFlip.createdTriangles[1]);
  uncheckedTriangles.offer(initialFlip.createdTriangles[2]);
  while (!uncheckedTriangles.isEmpty()) {
    DelaunayTriangle triangle=uncheckedTriangles.poll();
    if (!isDelaunay(triangle)) {
      Flip22 flip=new Flip22(triangle);
      flip.perform();
      splitStack.push(flip);
      uncheckedTriangles.offer(flip.createdTriangles[0]);
      uncheckedTriangles.offer(flip.createdTriangles[1]);
    }
  }
}
Program: 186322
Project: 186322
Buggy source:
public List<TriangleXYZ> getVoronoiParts(VectorXYZ point){
  List<TriangleXYZ> result=new ArrayList<TriangleXYZ>();
  List<DelaunayEdge> edges=getIncidentEdges(point);
  for (int i=0; i < edges.size(); i++) {
    result.add(new TriangleXYZ(point,edges.get(i).getCenter(),edges.get((i + 1) % edges.size()).getCenter()));
  }
  return result;
}

Fixed version (ground truth):
public List<TriangleXZ> getVoronoiParts(VectorXYZ point){
  List<TriangleXZ> result=new ArrayList<TriangleXZ>();
  final VectorXZ pointXZ=point.xz();
  List<VectorXZ> centers=new ArrayList<VectorXZ>();
  for (  DelaunayTriangle t : getIncidentTriangles(point)) {
    centers.add(t.getCircumcircleCenter());
  }
  Collections.sort(centers,new Comparator<VectorXZ>(){
    @Override public int compare(    VectorXZ v1,    VectorXZ v2){
      return Double.compare(v2.subtract(pointXZ).angle(),v1.subtract(pointXZ).angle());
    }
  }
);
  for (int i=0; i < centers.size(); i++) {
    result.add(new TriangleXZ(point.xz(),centers.get(i),centers.get((i + 1) % centers.size())));
  }
  return result;
}
Program: 186324
Project: 186324
Buggy source:
public double angleAt(int pointIndex){
  VectorXZ vecToPoint=getPoint(pointIndex).xz().subtract(getPoint((pointIndex + 2) % 3).xz());
  VectorXZ vecFromPoint=getPoint((pointIndex + 1) % 3).xz().subtract(getPoint(pointIndex).xz());
  return VectorXZ.angleBetween(vecToPoint,vecFromPoint);
}

Fixed version (ground truth):
public double angleAt(int pointIndex){
  VectorXZ vecToNext=getPoint(pointIndex).xz().subtract(getPoint((pointIndex + 2) % 3).xz());
  VectorXZ vecToPrev=getPoint((pointIndex + 1) % 3).xz().subtract(getPoint(pointIndex).xz()).invert();
  return VectorXZ.angleBetween(vecToNext,vecToPrev);
}
Program: 186325
Project: 186325
Buggy source:
public void clear(){
  minX=minZ=Float.MAX_VALUE;
  maxX=maxZ=-Float.MAX_VALUE;
  points=new ArrayList<VectorXYZ>();
  triangulation=null;
  this.add(new VectorXYZ(-SIZE,0,-SIZE));
  this.add(new VectorXYZ(-SIZE,0,+SIZE));
  this.add(new VectorXYZ(+SIZE,0,+SIZE));
  this.add(new VectorXYZ(+SIZE,0,-SIZE));
  this.repaint(0);
}

Fixed version (ground truth):
public void clear(){
  minX=minZ=Float.MAX_VALUE;
  maxX=maxZ=-Float.MAX_VALUE;
  points=new ArrayList<VectorXYZ>();
  triangulation=null;
  this.add(new VectorXYZ(-SIZE,0,-SIZE));
  this.add(new VectorXYZ(+SIZE,0,-SIZE));
  this.add(new VectorXYZ(+SIZE,0,+SIZE));
  this.add(new VectorXYZ(-SIZE,0,+SIZE));
  this.repaint(0);
}
Program: 186326
Project: 186326
Buggy source:
@Override public void paint(Graphics g){
  super.paint(g);
  if (points.size() > 4) {
    VectorXYZ p=points.get(points.size() - 1);
    g.setColor(Color.YELLOW);
    for (    TriangleXYZ t : triangulation.getVoronoiParts(p)) {
      fill(g,new TriangleXZ(t.v1.xz(),t.v2.xz(),t.v3.xz()));
    }
    g.setColor(Color.GREEN);
    for (    DelaunayTriangle t : triangulation.getIncidentTriangles(p)) {
      VectorXZ center=t.getCircumcircleCenter();
      draw(g,center);
      drawCircle(g,center,t.p0.distanceToXZ(center));
    }
  }
  g.setColor(Color.RED);
  for (  DelaunayTriangle triangle : triangulation.triangles) {
    draw(g,triangle.asTriangleXZ());
  }
  g.setColor(Color.BLACK);
  for (  VectorXYZ p : points) {
    draw(g,p.xz());
  }
}

Fixed version (ground truth):
@Override public void paint(Graphics g){
  super.paint(g);
  if (points.size() > 4) {
    Random random=new Random(0);
    for (    VectorXYZ p : points) {
      g.setColor(new Color(0.5f + random.nextFloat() / 2,0.5f + random.nextFloat() / 2,0.5f + random.nextFloat() / 2));
      for (      TriangleXZ t : triangulation.getVoronoiParts(p)) {
        fill(g,t);
      }
    }
    VectorXYZ p=points.get(points.size() - 1);
    g.setColor(Color.GREEN);
    for (    DelaunayTriangle t : triangulation.getIncidentTriangles(p)) {
      VectorXZ center=t.getCircumcircleCenter();
      double radius=t.p0.distanceToXZ(center);
      draw(g,center);
      drawCircle(g,center,radius);
    }
  }
  g.setColor(Color.RED);
  for (  DelaunayTriangle triangle : triangulation.triangles) {
    draw(g,triangle.asTriangleXZ());
  }
  g.setColor(Color.BLACK);
  for (  VectorXYZ p : points) {
    draw(g,p.xz());
  }
}
Program: 186327
Project: 186327
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  double x=(Math.random() * 2 * SIZE) - SIZE;
  double z=(Math.random() * 2 * SIZE) - SIZE;
  panel.add(new VectorXYZ(x,0,z));
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  if (panel.points.size() <= 4) {
    random=new Random(1);
  }
  double x=(random.nextDouble() * 2 * SIZE) - SIZE;
  double z=(random.nextDouble() * 2 * SIZE) - SIZE;
  panel.add(new VectorXYZ(x,0,z));
}
Program: 186329
Project: 186329
Buggy source:
/** 
 * manually frees resources that would otherwise remain used until the finalize call. It is no longer possible to use  {@link #writeImageFile(File,OutputMode,int,int,Camera,Projection)}afterwards.
 */
public void freeResources(){
  if (backgroundTextureManager != null) {
    backgroundTextureManager.releaseAll();
    backgroundTextureManager=null;
  }
  if (bufferTarget != null) {
    bufferTarget.freeResources();
    bufferTarget=null;
  }
  if (pBuffer != null) {
    pBuffer.getContext().release();
    pBuffer.destroy();
    pBuffer=null;
    gl=null;
  }
}

Fixed version (ground truth):
/** 
 * manually frees resources that would otherwise remain used until the finalize call. It is no longer possible to use  {@link #writeImageFile(File,CLIArgumentsUtil.OutputMode,int,int,Camera,Projection)}afterwards.
 */
public void freeResources(){
  if (backgroundTextureManager != null) {
    backgroundTextureManager.releaseAll();
    backgroundTextureManager=null;
  }
  if (bufferTarget != null) {
    bufferTarget.freeResources();
    bufferTarget=null;
  }
  if (pBuffer != null) {
    pBuffer.getContext().release();
    pBuffer.destroy();
    pBuffer=null;
    gl=null;
  }
}
Program: 186330
Project: 186330
Buggy source:
/** 
 * returns a boundary based on the bounds in the input file if available, otherwise returns the same as   {@link #getBoundary()}
 */
public AxisAlignedBoundingBoxXZ getBoundary(){
  if (fileBoundary != null) {
    return fileBoundary;
  }
 else {
    return dataBoundary;
  }
}

Fixed version (ground truth):
/** 
 * returns a boundary based on the bounds in the input file if available, otherwise returns the same as   {@link #getDataBoundary()}
 */
public AxisAlignedBoundingBoxXZ getBoundary(){
  if (fileBoundary != null) {
    return fileBoundary;
  }
 else {
    return dataBoundary;
  }
}
Program: 186331
Project: 186331
Buggy source:
/** 
 * creates the ordering described for   {@link #getConnectedLines()}
 */
private void sortLinesByAngle(List<? extends MapSegment> lines){
  Collections.sort(lines,new Comparator<MapSegment>(){
    @Override public int compare(    MapSegment l1,    MapSegment l2){
      VectorXZ d1=l1.getDirection();
      VectorXZ d2=l2.getDirection();
      if (inboundLines.contains(l1)) {
        d1=d1.invert();
      }
      if (inboundLines.contains(l2)) {
        d2=d2.invert();
      }
      if (d1.z < 0 && d2.z > 0) {
        return -1;
      }
 else       if (d1.z > 0 && d2.z < 0) {
        return +1;
      }
      double comparison=d1.dot(X_UNIT) - d2.dot(X_UNIT);
      if (comparison == 0) {
        return 0;
      }
      if (d1.z < 0) {
        return (comparison > 0) ? -1 : +1;
      }
 else {
        return (comparison > 0) ? +1 : -1;
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * creates the ordering described for   {@link #getConnectedSegments()}
 */
private void sortLinesByAngle(List<? extends MapSegment> lines){
  Collections.sort(lines,new Comparator<MapSegment>(){
    @Override public int compare(    MapSegment l1,    MapSegment l2){
      VectorXZ d1=l1.getDirection();
      VectorXZ d2=l2.getDirection();
      if (inboundLines.contains(l1)) {
        d1=d1.invert();
      }
      if (inboundLines.contains(l2)) {
        d2=d2.invert();
      }
      if (d1.z < 0 && d2.z > 0) {
        return -1;
      }
 else       if (d1.z > 0 && d2.z < 0) {
        return +1;
      }
      double comparison=d1.dot(X_UNIT) - d2.dot(X_UNIT);
      if (comparison == 0) {
        return 0;
      }
      if (d1.z < 0) {
        return (comparison > 0) ? -1 : +1;
      }
 else {
        return (comparison > 0) ? +1 : -1;
      }
    }
  }
);
}
Program: 186332
Project: 186332
Buggy source:
/** 
 * Triangulates a simple polygon using Ear Clipping. The implementation is based on the paper "Triangulation by Ear Clipping" by David Eberly.
 * @param outline  outline of the polygon to triangulate;can be arbitrarily modified by this method.
 * @return
 */
static final List<TriangleXZ> triangulateSimplePolygon(List<VectorXZ> outline){
  if (outline.size() == 3) {
    return Collections.singletonList(new TriangleXZ(outline.get(1),outline.get(2),outline.get(3)));
  }
  outline.remove(0);
  List<TriangleXZ> triangles=new ArrayList<TriangleXZ>(outline.size() - 2);
  boolean progress=true;
  while (outline.size() >= 3 && progress) {
    progress=false;
    for (int i=0; i < outline.size(); i++) {
      if (isEarTip(i,outline)) {
        triangles.add(triangleAtTip(i,outline));
        outline.remove(i);
        progress=true;
        break;
      }
    }
  }
  if (outline.size() >= 3) {
    throw new InvalidGeometryException("String_Node_Str" + "String_Node_Str" + outline + "String_Node_Str"+ triangles);
  }
  return triangles;
}

Fixed version (ground truth):
/** 
 * Triangulates a simple polygon using Ear Clipping. The implementation is based on the paper "Triangulation by Ear Clipping" by David Eberly.
 * @param outline  outline of the polygon to triangulate;can be arbitrarily modified by this method.
 */
static final List<TriangleXZ> triangulateSimplePolygon(List<VectorXZ> outline){
  if (outline.size() == 3) {
    return Collections.singletonList(new TriangleXZ(outline.get(1),outline.get(2),outline.get(3)));
  }
  outline.remove(0);
  List<TriangleXZ> triangles=new ArrayList<TriangleXZ>(outline.size() - 2);
  boolean progress=true;
  while (outline.size() >= 3 && progress) {
    progress=false;
    for (int i=0; i < outline.size(); i++) {
      if (isEarTip(i,outline)) {
        triangles.add(triangleAtTip(i,outline));
        outline.remove(i);
        progress=true;
        break;
      }
    }
  }
  if (outline.size() >= 3) {
    throw new InvalidGeometryException("String_Node_Str" + "String_Node_Str" + outline + "String_Node_Str"+ triangles);
  }
  return triangles;
}
Program: 186333
Project: 186333
Buggy source:
/** 
 * finds a vertex in the polygon outline that is visible from a given point.  Visibility means that the connection between the point and the outline vertex does not intersect the outline or any hole polygon.
 * @return  index of a vertex in the polygon outlineor null if none was found. The method will always find an outline vertex if there are no holes.
 */
static final Integer findVisibleOutlineVertex(List<VectorXZ> polygonOutline,VectorXZ point,Iterable<SimplePolygonXZ> holes){
  int outerIndex=-1;
  checkOuterVertex:   for (  VectorXZ outerVertex : polygonOutline) {
    outerIndex+=1;
    for (int i=0; i + 1 < polygonOutline.size(); i++) {
      if (null != GeometryUtil.getTrueLineSegmentIntersection(point,outerVertex,polygonOutline.get(i),polygonOutline.get(i + 1))) {
        continue checkOuterVertex;
      }
    }
    for (    SimplePolygonXZ hole : holes) {
      if (hole.intersects(point,outerVertex)) {
        continue checkOuterVertex;
      }
    }
    return outerIndex;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * finds a vertex in the polygon outline that is visible from a given point. Visibility means that the connection between the point and the outline vertex does not intersect the outline or any hole polygon.
 * @return  index of a vertex in the polygon outlineor null if none was found. The method will always find an outline vertex if there are no holes.
 */
static final Integer findVisibleOutlineVertex(List<VectorXZ> polygonOutline,VectorXZ point,Iterable<SimplePolygonXZ> holes){
  int outerIndex=-1;
  checkOuterVertex:   for (  VectorXZ outerVertex : polygonOutline) {
    outerIndex+=1;
    for (int i=0; i + 1 < polygonOutline.size(); i++) {
      if (null != GeometryUtil.getTrueLineSegmentIntersection(point,outerVertex,polygonOutline.get(i),polygonOutline.get(i + 1))) {
        continue checkOuterVertex;
      }
    }
    for (    SimplePolygonXZ hole : holes) {
      if (hole.intersects(point,outerVertex)) {
        continue checkOuterVertex;
      }
    }
    return outerIndex;
  }
  return null;
}
Program: 186334
Project: 186334
Buggy source:
/** 
 * draws a triangle strip.
 * @param vs             vertices of the triangle strip
 * @param texCoordsList  one texture coordinate list per texture.Each must have the same length as the "vs" parameter. Can be null if no texturing information is available.
 */
void drawTriangleStrip(Material material,List<VectorXYZ> vs,List<List<VectorXZ>> texCoordLists);

Fixed version (ground truth):
/** 
 * draws a triangle strip.
 * @param vs             vertices of the triangle strip
 * @param texCoordLists  one texture coordinate list per texture.Each must have the same length as the "vs" parameter. Can be null if no texturing information is available.
 */
void drawTriangleStrip(Material material,List<VectorXYZ> vs,List<List<VectorXZ>> texCoordLists);
Program: 186335
Project: 186335
Buggy source:
/** 
 * returns the vector that is orthogonal to the connection between pos and lookAt and points to the right of it. The result has length 1 and is parallel to the XZ plane.
 */
public VectorXYZ getRight(){
  return getViewDirection().crossNormalized(up);
}

Fixed version (ground truth):
/** 
 * returns the vector that is orthogonal to the connection between pos and lookAt and points to the right of it. The result has length 1.
 */
public VectorXYZ getRight(){
  return getViewDirection().crossNormalized(up);
}
Program: 186336
Project: 186336
Buggy source:
/** 
 * similar to   {@link #applyProjectionMatrices(GL,Projection)}, but allows rendering only a part of the "normal" image.
 * @see
 */
static final void applyProjectionMatricesForPart(GL2 gl,Projection projection,double xStart,double xEnd,double yStart,double yEnd){
  if ((xStart != 0 || xEnd != 1 || yStart != 0 || yEnd != 1) && !projection.isOrthographic()) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  }
  gl.glMatrixMode(GL_PROJECTION);
  gl.glLoadIdentity();
  if (projection.isOrthographic()) {
    double volumeWidth=projection.getAspectRatio() * projection.getVolumeHeight();
    gl.glOrtho((-0.5 + xStart) * volumeWidth,(-0.5 + xEnd) * volumeWidth,(-0.5 + yStart) * projection.getVolumeHeight(),(-0.5 + yEnd) * projection.getVolumeHeight(),projection.getNearClippingDistance(),projection.getFarClippingDistance());
  }
 else {
    new GLU().gluPerspective(projection.getVertAngle(),projection.getAspectRatio(),projection.getNearClippingDistance(),projection.getFarClippingDistance());
  }
  gl.glMatrixMode(GL_MODELVIEW);
}

Fixed version (ground truth):
/** 
 * similar to   {@link #applyProjectionMatrices(GL2,Projection)}, but allows rendering only a part of the "normal" image.
 */
static final void applyProjectionMatricesForPart(GL2 gl,Projection projection,double xStart,double xEnd,double yStart,double yEnd){
  if ((xStart != 0 || xEnd != 1 || yStart != 0 || yEnd != 1) && !projection.isOrthographic()) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  }
  gl.glMatrixMode(GL_PROJECTION);
  gl.glLoadIdentity();
  if (projection.isOrthographic()) {
    double volumeWidth=projection.getAspectRatio() * projection.getVolumeHeight();
    gl.glOrtho((-0.5 + xStart) * volumeWidth,(-0.5 + xEnd) * volumeWidth,(-0.5 + yStart) * projection.getVolumeHeight(),(-0.5 + yEnd) * projection.getVolumeHeight(),projection.getNearClippingDistance(),projection.getFarClippingDistance());
  }
 else {
    new GLU().gluPerspective(projection.getVertAngle(),projection.getAspectRatio(),projection.getNearClippingDistance(),projection.getFarClippingDistance());
  }
  gl.glMatrixMode(GL_MODELVIEW);
}
Program: 186337
Project: 186337
Buggy source:
/** 
 * builds lane connections at a junction of just oneway roads. Intended to handle motorway merges and splits well. Inbound and outbound roads must not be mixed, but build two separate continuous blocks instead.
 * @param inboundOnewayRoadsLTR  inbound roads, left to right
 * @param inboundOnewayRoadsLTR  outbound roads, left to right
 */
private static List<LaneConnection> buildLaneConnections_allOneway(MapNode node,List<Road> inboundOnewayRoadsLTR,List<Road> outboundOnewayRoadsLTR){
  List<Lane> inboundLanes=new ArrayList<Lane>();
  List<Lane> outboundLanes=new ArrayList<Lane>();
  for (  Road road : inboundOnewayRoadsLTR) {
    inboundLanes.addAll(road.getLaneLayout().getLanesLeftToRight());
  }
  for (  Road road : outboundOnewayRoadsLTR) {
    outboundLanes.addAll(road.getLaneLayout().getLanesLeftToRight());
  }
  Map<Integer,Integer> matches=findMatchingLanes(inboundLanes,outboundLanes,false,false);
  List<LaneConnection> result=new ArrayList<RoadModule.LaneConnection>();
  for (  int lane1Index : matches.keySet()) {
    final Lane lane1=inboundLanes.get(lane1Index);
    final Lane lane2=outboundLanes.get(matches.get(lane1Index));
    result.add(buildLaneConnection(lane1,lane2,RoadPart.LEFT,false,true));
  }
  return result;
}

Fixed version (ground truth):
/** 
 * builds lane connections at a junction of just oneway roads. Intended to handle motorway merges and splits well. Inbound and outbound roads must not be mixed, but build two separate continuous blocks instead.
 * @param inboundOnewayRoadsLTR  inbound roads, left to right
 * @param outboundOnewayRoadsLTR  outbound roads, left to right
 */
private static List<LaneConnection> buildLaneConnections_allOneway(MapNode node,List<Road> inboundOnewayRoadsLTR,List<Road> outboundOnewayRoadsLTR){
  List<Lane> inboundLanes=new ArrayList<Lane>();
  List<Lane> outboundLanes=new ArrayList<Lane>();
  for (  Road road : inboundOnewayRoadsLTR) {
    inboundLanes.addAll(road.getLaneLayout().getLanesLeftToRight());
  }
  for (  Road road : outboundOnewayRoadsLTR) {
    outboundLanes.addAll(road.getLaneLayout().getLanesLeftToRight());
  }
  Map<Integer,Integer> matches=findMatchingLanes(inboundLanes,outboundLanes,false,false);
  List<LaneConnection> result=new ArrayList<RoadModule.LaneConnection>();
  for (  int lane1Index : matches.keySet()) {
    final Lane lane1=inboundLanes.get(lane1Index);
    final Lane lane2=outboundLanes.get(matches.get(lane1Index));
    result.add(buildLaneConnection(lane1,lane2,RoadPart.LEFT,false,true));
  }
  return result;
}
Program: 186338
Project: 186338
Buggy source:
/** 
 * creates an rotated version of a list of vectors by rotating them by the given angle around the parallel of the x axis defined by the given Y and Z coordinates
 * @angle  rotation angle in degrees
 */
public static final List<VectorXYZ> rotateShapeX(List<VectorXYZ> shape,double angle,double posY,double posZ){
  VectorXYZ[] result=new VectorXYZ[shape.size()];
  for (int i=0; i < shape.size(); ++i) {
    result[i]=shape.get(i).add(0f,-posY,-posZ);
    result[i]=result[i].rotateX(toRadians(angle));
    result[i]=result[i].add(0f,posY,posZ);
  }
  return asList(result);
}

Fixed version (ground truth):
/** 
 * creates an rotated version of a list of vectors by rotating them by the given angle around the parallel of the x axis defined by the given Y and Z coordinates
 * @param angle  rotation angle in degrees
 */
public static final List<VectorXYZ> rotateShapeX(List<VectorXYZ> shape,double angle,double posY,double posZ){
  VectorXYZ[] result=new VectorXYZ[shape.size()];
  for (int i=0; i < shape.size(); ++i) {
    result[i]=shape.get(i).add(0f,-posY,-posZ);
    result[i]=result[i].rotateX(toRadians(angle));
    result[i]=result[i].add(0f,posY,posZ);
  }
  return asList(result);
}
Program: 186339
Project: 186339
Buggy source:
/** 
 * Returns a two- or three-element array containing first the custom data flavor, if one was created in the constructors, second the default   {@link #DATA_FLAVOR} associated with{@link TransferableObject}, and third the  {@link java.awt.datatransfer.DataFlavor.stringFlavor}.
 * @return An array of supported data flavors
 * @since 1.1
 */
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors(){
  if (customFlavor != null)   return new java.awt.datatransfer.DataFlavor[]{customFlavor,DATA_FLAVOR,java.awt.datatransfer.DataFlavor.stringFlavor};
 else   return new java.awt.datatransfer.DataFlavor[]{DATA_FLAVOR,java.awt.datatransfer.DataFlavor.stringFlavor};
}

Fixed version (ground truth):
/** 
 * Returns a two- or three-element array containing first the custom data flavor, if one was created in the constructors, second the default   {@link #DATA_FLAVOR} associated with{@link TransferableObject}, and third the  {@code java.awt.datatransfer.DataFlavor.stringFlavor}.
 * @return An array of supported data flavors
 * @since 1.1
 */
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors(){
  if (customFlavor != null)   return new java.awt.datatransfer.DataFlavor[]{customFlavor,DATA_FLAVOR,java.awt.datatransfer.DataFlavor.stringFlavor};
 else   return new java.awt.datatransfer.DataFlavor[]{DATA_FLAVOR,java.awt.datatransfer.DataFlavor.stringFlavor};
}
Program: 186340
Project: 186340
Buggy source:
public void drawText(String string,int x,int y,int screenWidth,int screenHeight,Color color){
  textRenderer.beginRendering(screenWidth,screenHeight);
  textRenderer.setColor(color);
  textRenderer.draw(string,x,y);
  textRenderer.endRendering();
}

Fixed version (ground truth):
public static final void drawText(String string,int x,int y,int screenWidth,int screenHeight,Color color){
  textRenderer.beginRendering(screenWidth,screenHeight);
  textRenderer.setColor(color);
  textRenderer.draw(string,x,y);
  textRenderer.endRendering();
}
Program: 186341
Project: 186341
Buggy source:
public ViewerFrame(final Data data,final MessageManager messageManager,final RenderOptions renderOptions,final Configuration config){
  super("String_Node_Str");
  this.data=data;
  this.renderOptions=renderOptions;
  this.messageManager=messageManager;
  data.setConfig(config);
  createMenuBar();
  glCanvas=new ViewerGLCanvas(data,messageManager,renderOptions);
  add(glCanvas,BorderLayout.CENTER);
  new FileDrop(glCanvas,new FileDrop.Listener(){
    @Override public void filesDropped(    File[] files){
      if (files.length >= 1) {
        new OpenOSMAction(ViewerFrame.this,data,renderOptions).openOSMFile(files[0],true);
      }
    }
  }
);
  DefaultNavigation navigation=new DefaultNavigation(this,renderOptions);
  glCanvas.addMouseListener(navigation);
  glCanvas.addMouseMotionListener(navigation);
  glCanvas.addMouseWheelListener(navigation);
  glCanvas.addKeyListener(navigation);
  new ToggleDebugViewAction(new HelpView(),-1,true,this,data,renderOptions);
  setDefaultCloseOperation(EXIT_ON_CLOSE);
  pack();
}

Fixed version (ground truth):
public ViewerFrame(final Data data,final MessageManager messageManager,final RenderOptions renderOptions,final Configuration config){
  super("String_Node_Str");
  this.data=data;
  this.renderOptions=renderOptions;
  this.messageManager=messageManager;
  data.setConfig(config);
  createMenuBar();
  glCanvas=new ViewerGLCanvas(data,messageManager,renderOptions);
  add(glCanvas,BorderLayout.CENTER);
  new FileDrop(glCanvas,new FileDrop.Listener(){
    @Override public void filesDropped(    File[] files){
      if (files.length >= 1) {
        new OpenOSMAction(ViewerFrame.this,data,renderOptions).openOSMFile(files[0],true);
      }
    }
  }
);
  DefaultNavigation navigation=new DefaultNavigation(this,renderOptions);
  glCanvas.addMouseListener(navigation);
  glCanvas.addMouseMotionListener(navigation);
  glCanvas.addMouseWheelListener(navigation);
  glCanvas.addKeyListener(navigation);
  setDefaultCloseOperation(EXIT_ON_CLOSE);
  pack();
}
Program: 186342
Project: 186342
Buggy source:
@Override public void display(GLAutoDrawable glDrawable){
  final GL2 gl=glDrawable.getGL().getGL2();
  JOGLTarget.clearGL(gl,Color.BLACK);
  if (renderOptions.camera != null) {
    DebugView activeWorldObjectView=null;
    for (    DebugView debugView : renderOptions.activeDebugViews) {
      if (debugView instanceof WorldObjectView) {
        activeWorldObjectView=debugView;
        continue;
      }
      debugView.renderTo(gl,renderOptions.camera,renderOptions.projection);
    }
    if (activeWorldObjectView != null) {
      activeWorldObjectView.renderTo(gl,renderOptions.camera,renderOptions.projection);
    }
    int messageCount=0;
    for (    Message message : messageManager.getLiveMessages()) {
      new JOGLTarget(gl,null,null).drawText(message.messageString,10,10 + messageCount * 20,ViewerGLCanvas.this.getWidth(),ViewerGLCanvas.this.getHeight(),Color.WHITE);
      messageCount++;
    }
    gl.glFlush();
  }
}

Fixed version (ground truth):
@Override public void display(GLAutoDrawable glDrawable){
  final GL2 gl=glDrawable.getGL().getGL2();
  JOGLTarget.clearGL(gl,Color.BLACK);
  helpView.renderTo(gl,null,null);
  if (renderOptions.camera != null) {
    DebugView activeWorldObjectView=null;
    for (    DebugView debugView : renderOptions.activeDebugViews) {
      if (debugView instanceof WorldObjectView) {
        activeWorldObjectView=debugView;
        continue;
      }
      debugView.renderTo(gl,renderOptions.camera,renderOptions.projection);
    }
    if (activeWorldObjectView != null) {
      activeWorldObjectView.renderTo(gl,renderOptions.camera,renderOptions.projection);
    }
    int messageCount=0;
    for (    Message message : messageManager.getLiveMessages()) {
      JOGLTarget.drawText(message.messageString,10,10 + messageCount * 20,ViewerGLCanvas.this.getWidth(),ViewerGLCanvas.this.getHeight(),Color.WHITE);
      messageCount++;
    }
    gl.glFlush();
  }
}
Program: 186343
Project: 186343
Buggy source:
@Override public void renderTo(GL2 gl,Camera camera,Projection projection){
  if (!canBeUsed()) {
    return;
  }
  JOGLTarget target=new JOGLTarget(gl,null,null);
  target.drawText("String_Node_Str" + "String_Node_Str",50,550,800,600,Color.LIGHT_GRAY);
  target.drawText("String_Node_Str" + GlobalValues.VERSION_STRING,50,100,800,600,Color.LIGHT_GRAY);
  target.drawText("String_Node_Str" + GlobalValues.OSM2WORLD_URI,50,75,800,600,Color.LIGHT_GRAY);
  target.drawText("String_Node_Str" + GlobalValues.WIKI_URI,50,50,800,600,Color.LIGHT_GRAY);
}

Fixed version (ground truth):
@Override public void renderTo(GL2 gl,Camera camera,Projection projection){
  if (!canBeUsed()) {
    return;
  }
  JOGLTarget.drawText("String_Node_Str" + "String_Node_Str",50,550,800,600,Color.LIGHT_GRAY);
  JOGLTarget.drawText("String_Node_Str" + GlobalValues.VERSION_STRING,50,100,800,600,Color.LIGHT_GRAY);
  JOGLTarget.drawText("String_Node_Str" + GlobalValues.OSM2WORLD_URI,50,75,800,600,Color.LIGHT_GRAY);
  JOGLTarget.drawText("String_Node_Str" + GlobalValues.WIKI_URI,50,50,800,600,Color.LIGHT_GRAY);
}
Program: 186345
Project: 186345
Buggy source:
/** 
 * put the values for a primitive's vertices into the buffer
 */
private void addPrimitiveToValueBuffer(DoubleBuffer buffer,Primitive primitive){
  List<VectorXYZ> primVertices=new ArrayList<VectorXYZ>(primitive.indices.length);
  for (  int index : primitive.indices) {
    primVertices.add(primitiveBuffer.getVertex(index));
  }
  List<VectorXYZ> primNormals=primitive.normals;
  List<List<VectorXZ>> primTexCoordLists=primitive.texCoordLists;
  if (primitive.type == Type.TRIANGLE_STRIP) {
    primVertices=triangleVertexListFromTriangleStrip(primVertices);
    primNormals=triangleVertexListFromTriangleStrip(primNormals);
    if (primTexCoordLists != null) {
      List<List<VectorXZ>> newPrimTexCoordLists=new ArrayList<List<VectorXZ>>();
      for (      List<VectorXZ> primTexCoordList : primTexCoordLists) {
        newPrimTexCoordLists.add(triangleVertexListFromTriangleStrip(primTexCoordList));
      }
      primTexCoordLists=newPrimTexCoordLists;
    }
  }
 else   if (primitive.type == Type.TRIANGLE_FAN) {
    primVertices=triangleVertexListFromTriangleFan(primVertices);
    primNormals=triangleVertexListFromTriangleFan(primNormals);
    if (primTexCoordLists != null) {
      List<List<VectorXZ>> newPrimTexCoordLists=new ArrayList<List<VectorXZ>>();
      for (      List<VectorXZ> primTexCoordList : primTexCoordLists) {
        newPrimTexCoordLists.add(triangleVertexListFromTriangleFan(primTexCoordList));
      }
      primTexCoordLists=newPrimTexCoordLists;
    }
  }
  for (int i=0; i < primVertices.size(); i++) {
    if (primTexCoordLists == null && material.getNumTextureLayers() > 0) {
      System.out.println(material);
    }
    for (int t=0; t < material.getNumTextureLayers(); t++) {
      VectorXZ textureCoord=primTexCoordLists.get(t).get(i);
      buffer.put(textureCoord.x);
      buffer.put(textureCoord.z);
    }
    VectorXYZ n=primNormals.get(i);
    buffer.put(n.x);
    buffer.put(n.y);
    buffer.put(-n.z);
    VectorXYZ v=primVertices.get(i);
    buffer.put(v.x);
    buffer.put(v.y);
    buffer.put(-v.z);
  }
}

Fixed version (ground truth):
/** 
 * put the values for a primitive's vertices into the buffer
 */
private void addPrimitiveToValueBuffer(DoubleBuffer buffer,Primitive primitive){
}
Program: 186347
Project: 186347
Buggy source:
@Override public void renderTo(Target<?> target){
  target.drawTriangles(WATER,getTriangulation(),globalTexCoordLists(getTriangulation(),WATER,false));
  double width=0.1;
  double height=0.5;
  List<VectorXYZ> wallShape=asList(new VectorXYZ(-width / 2,0,0),new VectorXYZ(-width / 2,height,0),new VectorXYZ(+width / 2,height,0),new VectorXYZ(+width / 2,0,0));
  List<VectorXYZ> path=area.getElevationProfile().getWithEle(area.getOuterPolygon().getVertexLoop());
  List<List<VectorXYZ>> strips=createShapeExtrusionAlong(wallShape,path,nCopies(path.size(),VectorXYZ.Y_UNIT));
  for (  List<VectorXYZ> strip : strips) {
    target.drawTriangleStrip(Materials.ASPHALT,strip,null);
  }
}

Fixed version (ground truth):
@Override public void renderTo(Target<?> target){
  target.drawTriangles(WATER,getTriangulation(),globalTexCoordLists(getTriangulation(),WATER,false));
  double width=0.1;
  double height=0.5;
  List<VectorXYZ> wallShape=asList(new VectorXYZ(-width / 2,0,0),new VectorXYZ(-width / 2,height,0),new VectorXYZ(+width / 2,height,0),new VectorXYZ(+width / 2,0,0));
  List<VectorXYZ> path=area.getElevationProfile().getWithEle(area.getOuterPolygon().getVertexLoop());
  List<List<VectorXYZ>> strips=createShapeExtrusionAlong(wallShape,path,nCopies(path.size(),VectorXYZ.Y_UNIT));
  for (  List<VectorXYZ> strip : strips) {
    target.drawTriangleStrip(Materials.CONCRETE,strip,wallTexCoordLists(strip,Materials.CONCRETE));
  }
}
Program: 186348
Project: 186348
Buggy source:
/** 
 * creates an IntersectionGrid with all terrain cells and boundaries
 */
private IntersectionGrid prepareSpeedupGrid(MapData mapData,CellularTerrainElevation eleData){
  final IntersectionGrid speedupGrid=new IntersectionGrid(mapData.getDataBoundary().pad(20),50,50);
  for (  TerrainElevationCell cell : eleData.getCells()) {
    speedupGrid.insert(cell);
  }
  iterate(mapData.getWorldObjects(IntersectionTestObject.class),new Operation<IntersectionTestObject>(){
    @Override public void perform(    IntersectionTestObject object){
      if (((WorldObject)object).getGroundState() == GroundState.ON) {
        speedupGrid.insert(object);
      }
    }
  }
);
  return speedupGrid;
}

Fixed version (ground truth):
/** 
 * creates an IntersectionGrid with all terrain cells and boundaries
 */
private IntersectionGrid prepareSpeedupGrid(MapData mapData,CellularTerrainElevation eleData){
  AxisAlignedBoundingBoxXZ speedupGridBounds=union(mapData.getDataBoundary(),new AxisAlignedBoundingBoxXZ(eleData.getBoundaryPolygonXZ().getVertexCollection()));
  final IntersectionGrid speedupGrid=new IntersectionGrid(speedupGridBounds.pad(20),50,50);
  for (  TerrainElevationCell cell : eleData.getCells()) {
    speedupGrid.insert(cell);
  }
  iterate(mapData.getWorldObjects(IntersectionTestObject.class),new Operation<IntersectionTestObject>(){
    @Override public void perform(    IntersectionTestObject object){
      if (((WorldObject)object).getGroundState() == GroundState.ON) {
        speedupGrid.insert(object);
      }
    }
  }
);
  return speedupGrid;
}
Program: 186350
Project: 186350
Buggy source:
/** 
 * returns a sequence of node running along the center of the line from start to end (each with offset). Uses the   {@link WaySegmentElevationProfile} for addingelevation information.
 */
public List<VectorXYZ> getCenterline(){
  WaySegmentElevationProfile eleProfile=line.getElevationProfile();
  if (startOffset == VectorXZ.NULL_VECTOR && endOffset == VectorXZ.NULL_VECTOR) {
    return eleProfile.getPointsWithEle();
  }
 else {
    List<VectorXYZ> centerline=new ArrayList<VectorXYZ>();
    VectorXZ startWithOffset=getStartWithOffset();
    VectorXZ endWithOffset=getEndWithOffset();
    if (startOffset != VectorXZ.NULL_VECTOR) {
      centerline.add(startWithOffset.xyz(eleProfile.getEleAt(startWithOffset)));
    }
    for (    VectorXYZ p : eleProfile.getPointsWithEle()) {
      VectorXZ pXZ=p.xz();
      if (isBetween(pXZ,startWithOffset,endWithOffset) && distanceSquared(pXZ,startWithOffset) > 0.1 && distanceSquared(pXZ,endWithOffset) > 0.1) {
        centerline.add(p);
      }
    }
    if (endOffset != VectorXZ.NULL_VECTOR) {
      centerline.add(endWithOffset.xyz(eleProfile.getEleAt(endWithOffset)));
    }
    return centerline;
  }
}

Fixed version (ground truth):
/** 
 * returns a sequence of node running along the center of the line from start to end (each with offset). Uses the   {@link WaySegmentElevationProfile} for addingelevation information.
 */
public List<VectorXYZ> getCenterline(){
  WaySegmentElevationProfile eleProfile=line.getElevationProfile();
  if (startOffset == VectorXZ.NULL_VECTOR && endOffset == VectorXZ.NULL_VECTOR) {
    return eleProfile.getPointsWithEle();
  }
 else {
    List<VectorXYZ> centerline=new ArrayList<VectorXYZ>();
    VectorXZ startWithOffset=getStartWithOffset();
    VectorXZ endWithOffset=getEndWithOffset();
    centerline.add(startWithOffset.xyz(eleProfile.getEleAt(startWithOffset)));
    for (int i=1; i < eleProfile.getPointsWithEle().size() - 1; ++i) {
      VectorXYZ p=eleProfile.getPointsWithEle().get(i);
      VectorXZ pXZ=p.xz();
      if (isBetween(pXZ,startWithOffset,endWithOffset) && distanceSquared(pXZ,startWithOffset) > 0.1 && distanceSquared(pXZ,endWithOffset) > 0.1) {
        centerline.add(p);
      }
    }
    centerline.add(endWithOffset.xyz(eleProfile.getEleAt(endWithOffset)));
    return centerline;
  }
}
Program: 186351
Project: 186351
Buggy source:
/** 
 * provides the left or right border (a line at an appropriate distance from the center line), taking into account cut vectors, offsets and elevation information.  Available after cut vectors, offsets and elevation information have been calculated. Left and right border have the same number of nodes as the elevation profile's   {@link WaySegmentElevationProfile#getPointsWithEle()}. //TODO: compatible with future offset/clearing influences?
 */
public List<VectorXYZ> getOutline(boolean right){
  if (right) {
    if (rightOutline == null) {
      calculateOutlines();
    }
    return rightOutline;
  }
 else {
    if (leftOutline == null) {
      calculateOutlines();
    }
    return leftOutline;
  }
}

Fixed version (ground truth):
/** 
 * provides the left or right border (a line at an appropriate distance from the center line), taking into account cut vectors, offsets and elevation information. Available after cut vectors, offsets and elevation information have been calculated. Left and right border have the same number of nodes as the elevation profile's   {@link WaySegmentElevationProfile#getPointsWithEle()}. //TODO: compatible with future offset/clearing influences?
 */
public List<VectorXYZ> getOutline(boolean right){
  if (right) {
    if (rightOutline == null) {
      calculateOutlines();
    }
    return rightOutline;
  }
 else {
    if (leftOutline == null) {
      calculateOutlines();
    }
    return leftOutline;
  }
}
Program: 186353
Project: 186353
Buggy source:
public void visitMethodInsn(int opcode,String owner,String name,String desc){
  SrgFile.MethodInfo smi=main.srg.getMethod(owner,name,desc);
  String seargeName=smi.name;
  desc=main.deobfMethodDescriptor(desc);
  String deobfName=main.methods.get(seargeName);
  if (deobfName == null)   deobfName=seargeName;
  owner=main.srg.getClassName(owner);
  super.visitMethodInsn(opcode,owner,deobfName,desc);
}

Fixed version (ground truth):
public void visitMethodInsn(int opcode,String owner,String name,String desc){
  String seargeName=main.lookupInheritedMethod(owner,name,desc);
  desc=main.deobfMethodDescriptor(desc);
  String deobfName=main.methods.get(seargeName);
  if (deobfName == null)   deobfName=seargeName;
  owner=main.srg.getClassName(owner);
  super.visitMethodInsn(opcode,owner,deobfName,desc);
}
Program: 186354
Project: 186354
Buggy source:
public void visitLdcInsn(Object cst){
  if (cst instanceof Type) {
    String desc=((Type)cst).getDescriptor();
    if (desc.charAt(0) == 'L' && desc.charAt(desc.length() - 1) == ';')     cst=Type.getType("String_Node_Str" + main.srg.getClassName(desc.substring(1,desc.length() - 1)) + "String_Node_Str");
  }
  super.visitLdcInsn(cst);
}

Fixed version (ground truth):
public void visitLdcInsn(Object cst){
  if (cst instanceof Type) {
    cst=Type.getType(main.deobfTypeDescriptor(((Type)cst).getDescriptor()));
  }
  super.visitLdcInsn(cst);
}