Program: 175106
Project: 175106
Buggy source:
public void render(Object gcC){
  OpenGLContext context=(OpenGLContext)gcC;
  if (!context.isDirty()) {
    return;
  }
  int x=context.getX();
  int y=context.getY();
  float zoom=context.getZoom();
  float width=context.getWidth() * zoom;
  float height=context.getHeight() * zoom;
  GL2 gl=context.getGL().getGL2();
  float[] c=color.getColorComponents(null);
  gl.glColor3f(c[0],c[1],c[2]);
  if (geometries != null) {
    if (getType().equalsIgnoreCase(POINT)) {
switch (this.displaysymbol) {
case point:
{
          gl.glPointSize(this.renderWidth);
          gl.glBegin(GL.GL_POINTS);
          for (          Geometry temp : geometries) {
            Coordinate point=temp.getCoordinate();
            gl.glVertex2d((point.x - x) / width,1 - (point.y - y) / height);
          }
          gl.glEnd();
          gl.glFlush();
        }
      break;
case circle:
{
      gl.glBegin(GL.GL_LINE_LOOP);
      gl.glLineWidth(this.renderWidth);
      for (      Geometry temp : geometries) {
        Coordinate point=temp.getCoordinate();
        double dx=(point.x - x) / width;
        double dy=1 - (point.y - y) / height;
        for (int i=0; i < 360; i++) {
          double angle=2 * Math.PI * i / 300;
          double xx=Math.cos(angle);
          double yy=Math.sin(angle);
          gl.glVertex2d(xx + dx,yy + dy);
        }
      }
      gl.glEnd();
      gl.glFlush();
    }
  break;
case square:
{
  for (  Geometry temp : geometries) {
    gl.glLineWidth(this.renderWidth);
    Coordinate point=new Coordinate(temp.getCoordinate());
    point.x=(point.x - x) / width;
    point.y=1 - (point.y - y) / height;
    double rectwidth=0.01;
    gl.glBegin(GL.GL_LINE_STRIP);
    gl.glVertex2d(point.x - rectwidth,point.y - rectwidth);
    gl.glVertex2d(point.x - rectwidth,point.y + rectwidth);
    gl.glVertex2d(point.x + rectwidth,point.y + rectwidth);
    gl.glVertex2d(point.x + rectwidth,point.y - rectwidth);
    gl.glVertex2d(point.x - rectwidth,point.y - rectwidth);
    gl.glEnd();
    gl.glFlush();
  }
}
break;
case cross:
{
for (Geometry temp : geometries) {
gl.glLineWidth(this.renderWidth);
Coordinate point=new Coordinate(temp.getCoordinate());
point.x=(point.x - x) / width;
point.y=1 - (point.y - y) / height;
double rectwidth=0.01;
gl.glBegin(GL.GL_LINE_STRIP);
gl.glVertex2d(point.x - rectwidth,point.y);
gl.glVertex2d(point.x + rectwidth,point.y);
gl.glEnd();
gl.glBegin(GL.GL_LINE_STRIP);
gl.glVertex2d(point.x,point.y - rectwidth);
gl.glVertex2d(point.x,point.y + rectwidth);
gl.glEnd();
gl.glFlush();
}
}
break;
case triangle:
{
for (Geometry temp : geometries) {
gl.glLineWidth(this.renderWidth);
Coordinate point=new Coordinate(temp.getCoordinate());
point.x=(point.x - x) / width;
point.y=1 - (point.y - y) / height;
double rectwidth=0.01;
gl.glBegin(GL.GL_LINE_STRIP);
gl.glVertex2d(point.x - rectwidth,point.y - rectwidth);
gl.glVertex2d(point.x,point.y + rectwidth);
gl.glVertex2d(point.x + rectwidth,point.y - rectwidth);
gl.glVertex2d(point.x - rectwidth,point.y - rectwidth);
gl.glEnd();
gl.glFlush();
}
}
break;
default :
{
}
}
}
 else if (getType().equalsIgnoreCase(POLYGON)) {
for (Geometry tmp : geometries) {
Polygon polygon=(Polygon)tmp;
if (polygon.getCoordinates().length < 1) {
continue;
}
float rWidth=this.renderWidth;
int interior=polygon.getNumInteriorRing();
if (interior > 0) {
LineString line=polygon.getExteriorRing();
drawPoly(gl,line.getCoordinates(),width,height,x,y,rWidth);
for (int i=0; i < interior; i++) {
LineString line2=polygon.getInteriorRingN(i);
drawPoly(gl,line2.getCoordinates(),width,height,x,y,rWidth);
}
}
 else {
drawPoly(gl,polygon.getCoordinates(),width,height,x,y,rWidth);
}
}
}
 else if (getType().equalsIgnoreCase(LINESTRING)) {
for (Geometry temp : geometries) {
if (temp.getCoordinates().length < 1) {
continue;
}
gl.glLineWidth(this.renderWidth);
gl.glBegin(GL.GL_LINE_STRIP);
Coordinate[] cs=temp.getCoordinates();
for (int p=0; p < cs.length; p++) {
gl.glVertex2d((cs[p].x - x) / width,1 - (cs[p].y - y) / height);
}
gl.glEnd();
gl.glFlush();
}
}
}
}

Fixed version (ground truth):
public void render(Object gcC){
  OpenGLContext context=(OpenGLContext)gcC;
  if (!context.isDirty()) {
    return;
  }
  int x=context.getX();
  int y=context.getY();
  float zoom=context.getZoom();
  float width=context.getWidth() * zoom;
  float height=context.getHeight() * zoom;
  GL2 gl=context.getGL().getGL2();
  float[] c=color.getColorComponents(null);
  gl.glColor3f(c[0],c[1],c[2]);
  if (geometries != null) {
    if (getType().equalsIgnoreCase(POINT) || getType().equalsIgnoreCase(MIXED)) {
switch (this.displaysymbol) {
case point:
{
          gl.glPointSize(this.renderWidth);
          gl.glBegin(GL.GL_POINTS);
          for (          Geometry temp : geometries) {
            Coordinate point=temp.getCoordinate();
            gl.glVertex2d((point.x - x) / width,1 - (point.y - y) / height);
          }
          gl.glEnd();
          gl.glFlush();
        }
      break;
case circle:
{
      gl.glBegin(GL.GL_LINE_LOOP);
      gl.glLineWidth(this.renderWidth);
      for (      Geometry temp : geometries) {
        Coordinate point=temp.getCoordinate();
        double dx=(point.x - x) / width;
        double dy=1 - (point.y - y) / height;
        for (int i=0; i < 360; i++) {
          double angle=2 * Math.PI * i / 300;
          double xx=Math.cos(angle);
          double yy=Math.sin(angle);
          gl.glVertex2d(xx + dx,yy + dy);
        }
      }
      gl.glEnd();
      gl.glFlush();
    }
  break;
case square:
{
  for (  Geometry temp : geometries) {
    gl.glLineWidth(this.renderWidth);
    Coordinate point=new Coordinate(temp.getCoordinate());
    point.x=(point.x - x) / width;
    point.y=1 - (point.y - y) / height;
    double rectwidth=0.01;
    gl.glBegin(GL.GL_LINE_STRIP);
    gl.glVertex2d(point.x - rectwidth,point.y - rectwidth);
    gl.glVertex2d(point.x - rectwidth,point.y + rectwidth);
    gl.glVertex2d(point.x + rectwidth,point.y + rectwidth);
    gl.glVertex2d(point.x + rectwidth,point.y - rectwidth);
    gl.glVertex2d(point.x - rectwidth,point.y - rectwidth);
    gl.glEnd();
    gl.glFlush();
  }
}
break;
case cross:
{
for (Geometry temp : geometries) {
gl.glLineWidth(this.renderWidth);
Coordinate point=new Coordinate(temp.getCoordinate());
point.x=(point.x - x) / width;
point.y=1 - (point.y - y) / height;
double rectwidth=0.01;
gl.glBegin(GL.GL_LINE_STRIP);
gl.glVertex2d(point.x - rectwidth,point.y);
gl.glVertex2d(point.x + rectwidth,point.y);
gl.glEnd();
gl.glBegin(GL.GL_LINE_STRIP);
gl.glVertex2d(point.x,point.y - rectwidth);
gl.glVertex2d(point.x,point.y + rectwidth);
gl.glEnd();
gl.glFlush();
}
}
break;
case triangle:
{
for (Geometry temp : geometries) {
gl.glLineWidth(this.renderWidth);
Coordinate point=new Coordinate(temp.getCoordinate());
point.x=(point.x - x) / width;
point.y=1 - (point.y - y) / height;
double rectwidth=0.01;
gl.glBegin(GL.GL_LINE_STRIP);
gl.glVertex2d(point.x - rectwidth,point.y - rectwidth);
gl.glVertex2d(point.x,point.y + rectwidth);
gl.glVertex2d(point.x + rectwidth,point.y - rectwidth);
gl.glVertex2d(point.x - rectwidth,point.y - rectwidth);
gl.glEnd();
gl.glFlush();
}
}
break;
default :
{
}
}
}
 else if (getType().equalsIgnoreCase(POLYGON)) {
for (Geometry tmp : geometries) {
Polygon polygon=(Polygon)tmp;
if (polygon.getCoordinates().length < 1) {
continue;
}
float rWidth=this.renderWidth;
int interior=polygon.getNumInteriorRing();
if (interior > 0) {
LineString line=polygon.getExteriorRing();
drawPoly(gl,line.getCoordinates(),width,height,x,y,rWidth);
for (int i=0; i < interior; i++) {
LineString line2=polygon.getInteriorRingN(i);
drawPoly(gl,line2.getCoordinates(),width,height,x,y,rWidth);
}
}
 else {
drawPoly(gl,polygon.getCoordinates(),width,height,x,y,rWidth);
}
}
}
 else if (getType().equalsIgnoreCase(LINESTRING)) {
for (Geometry temp : geometries) {
if (temp.getCoordinates().length < 1) {
continue;
}
gl.glLineWidth(this.renderWidth);
gl.glBegin(GL.GL_LINE_STRIP);
Coordinate[] cs=temp.getCoordinates();
for (int p=0; p < cs.length; p++) {
gl.glVertex2d((cs[p].x - x) / width,1 - (cs[p].y - y) / height);
}
gl.glEnd();
gl.glFlush();
}
}
}
}