Program: 175129
Project: 175129
Buggy source:
@Override public void render(OpenGLContext context){
  if (!context.isDirty() || SumoPlatform.isBatchMode()) {
    return;
  }
  int x=context.getX();
  int y=context.getY();
  float zoom=context.getZoom();
  float width=context.getWidth() * zoom;
  float height=context.getHeight() * zoom;
  if (glayer != null) {
    List<Geometry> geomList=glayer.getGeometries();
    if (!threshable && geomList != null) {
      if (getType().equalsIgnoreCase(GeometricLayer.POINT)) {
switch (this.displaysymbol) {
case point:
{
            GL2ShapesRender.renderPolygons(context,width,height,geomList,this.renderWidth,color);
            if (selectedGeometry != null) {
              GL2ShapesRender.renderPoint(context,width,height,selectedGeometry.getCoordinate(),this.renderWidth,color);
            }
          }
        break;
case circle:
{
        GL2ShapesRender.renderCircle(context,width,height,geomList,this.renderWidth,color);
      }
    break;
case square:
{
    GL2ShapesRender.renderSquare(context,width,height,geomList,selectedGeometry,renderWidth,color);
  }
break;
case cross:
{
GL2ShapesRender.renderCross(context,width,height,geomList,selectedGeometry,renderWidth,color);
}
break;
case triangle:
{
GL2ShapesRender.renderTriangle(context,width,height,geomList,selectedGeometry,renderWidth,color);
}
break;
default :
{
}
}
}
 else if (getType().equalsIgnoreCase(GeometricLayer.POLYGON)) {
for (Geometry tmp : geomList) {
if (tmp instanceof Polygon) {
Polygon polygon=(Polygon)tmp;
if (polygon.getCoordinates().length < 1) {
continue;
}
float rWidth=polygon == selectedGeometry ? this.renderWidth * 2 : this.renderWidth;
int interior=polygon.getNumInteriorRing();
if (interior > 0) {
LineString line=polygon.getExteriorRing();
GL2ShapesRender.drawPoly(context,line.getCoordinates(),width,height,x,y,rWidth,color);
for (int i=0; i < interior; i++) {
LineString line2=polygon.getInteriorRingN(i);
GL2ShapesRender.drawPoly(context,line2.getCoordinates(),width,height,x,y,rWidth,color);
}
}
 else {
GL2ShapesRender.drawPoly(context,polygon.getCoordinates(),width,height,x,y,rWidth,color);
}
}
 else if (tmp instanceof MultiPolygon) {
MultiPolygon mpolygon=(MultiPolygon)tmp;
if (mpolygon.getCoordinates().length < 1) {
continue;
}
float rWidth=mpolygon == selectedGeometry ? this.renderWidth * 2 : this.renderWidth;
GL2ShapesRender.drawPoly(context,mpolygon.getCoordinates(),width,height,x,y,rWidth,color);
}
}
}
 else if (getType().equalsIgnoreCase(GeometricLayer.LINESTRING)) {
for (Geometry temp : geomList) {
if (temp.getCoordinates().length < 1) {
continue;
}
float size=(temp == selectedGeometry ? this.renderWidth * 2 : this.renderWidth);
GL2ShapesRender.renderPolygon(context,width,height,temp.getCoordinates(),size,color);
}
}
 else if (getType().equalsIgnoreCase(GeometricLayer.MIXED)) {
for (Geometry temp : geomList) {
if (temp.getCoordinates().length < 1) {
continue;
}
if (temp instanceof LineString || temp instanceof Polygon) {
float size=(temp == selectedGeometry ? this.renderWidth * 2 : this.renderWidth);
GL2ShapesRender.renderPolygon(context,width,height,temp.getCoordinates(),size,color);
}
 else if (temp instanceof Point) {
float size=(temp == selectedGeometry ? this.renderWidth * 2 : this.renderWidth);
Coordinate point=temp.getCoordinate();
GL2ShapesRender.renderPoint(context,width,height,point,size,color);
}
 else if (temp instanceof MultiPoint) {
float size=(temp == selectedGeometry ? this.renderWidth * 2 : this.renderWidth);
GL2ShapesRender.renderPolygon(context,width,height,temp.getCoordinates(),size,color);
}
}
}
}
 else {
if (getType().equalsIgnoreCase(GeometricLayer.POINT) && geomList != null) {
List<Geometry> toVisualize=new ArrayList<>();
for (Geometry temp : geomList) {
if (((Double)glayer.getAttributes(temp).get(VDSSchema.SIGNIFICANCE)) > currentThresh) {
toVisualize.add(temp);
}
}
switch (this.displaysymbol) {
case point:
{
GL2ShapesRender.renderPolygons(context,width,height,toVisualize,this.renderWidth,color);
if (selectedGeometry != null) {
GL2ShapesRender.renderPoint(context,width,height,selectedGeometry.getCoordinate(),this.renderWidth * 2,color);
}
}
break;
case circle:
{
GL2ShapesRender.renderCircle(context,width,height,toVisualize,this.renderWidth,color);
}
break;
case square:
{
GL2ShapesRender.renderSquare(context,width,height,toVisualize,selectedGeometry,renderWidth,color);
}
break;
case cross:
{
GL2ShapesRender.renderCross(context,width,height,toVisualize,selectedGeometry,renderWidth,color);
}
break;
case triangle:
{
GL2ShapesRender.renderTriangle(context,width,height,toVisualize,selectedGeometry,renderWidth,color);
}
break;
default :
{
}
}
}
 else if (getType().equalsIgnoreCase(GeometricLayer.POLYGON) || getType().equalsIgnoreCase(GeometricLayer.LINESTRING)) {
for (Geometry temp : geomList) {
if (((Double)glayer.getAttributes(temp).get(VDSSchema.SIGNIFICANCE)) > currentThresh) {
if (temp.getCoordinates().length < 1) {
continue;
}
float size=(temp == selectedGeometry ? this.renderWidth * 2 : this.renderWidth);
GL2ShapesRender.renderPolygon(context,width,height,temp.getCoordinates(),size,color);
}
}
}
 else if (getType().equalsIgnoreCase(GeometricLayer.MIXED)) {
for (Geometry temp : geomList) {
if (((Double)glayer.getAttributes(temp).get(VDSSchema.SIGNIFICANCE)) > currentThresh) {
if (temp.getCoordinates().length < 1) {
continue;
}
if (temp instanceof Polygon || temp instanceof LineString) {
float size=(temp == selectedGeometry ? this.renderWidth * 2 : this.renderWidth);
GL2ShapesRender.renderPolygon(context,width,height,temp.getCoordinates(),size,color);
}
 else if (temp instanceof Point) {
float size=temp == selectedGeometry ? this.renderWidth * 2 : this.renderWidth;
Coordinate point=temp.getCoordinate();
GL2ShapesRender.renderPoint(context,width,height,point,size,color);
}
}
}
}
}
}
}

Fixed version (ground truth):
@Override public void render(OpenGLContext context){
  if (!context.isDirty() || SumoPlatform.isBatchMode()) {
    return;
  }
  int x=context.getX();
  int y=context.getY();
  float zoom=context.getZoom();
  float width=context.getWidth() * zoom;
  float height=context.getHeight() * zoom;
  if (glayer != null) {
    List<Geometry> geomList=glayer.getGeometries();
    if (!threshable && geomList != null) {
      if (getType().equalsIgnoreCase(GeometricLayer.POINT)) {
switch (this.displaysymbol) {
case point:
{
            GL2ShapesRender.renderPolygons(context,width,height,geomList,this.renderWidth,color);
            if (selectedGeometry != null) {
              GL2ShapesRender.renderPoint(context,width,height,selectedGeometry.getCoordinate(),this.renderWidth,color);
            }
          }
        break;
case circle:
{
        GL2ShapesRender.renderCircle(context,width,height,geomList,selectedGeometry,this.renderWidth,color);
      }
    break;
case square:
{
    GL2ShapesRender.renderSquare(context,width,height,geomList,selectedGeometry,renderWidth,color);
  }
break;
case cross:
{
GL2ShapesRender.renderCross(context,width,height,geomList,selectedGeometry,renderWidth,color);
}
break;
case triangle:
{
GL2ShapesRender.renderTriangle(context,width,height,geomList,selectedGeometry,renderWidth,color);
}
break;
default :
{
}
}
}
 else if (getType().equalsIgnoreCase(GeometricLayer.POLYGON)) {
for (Geometry tmp : geomList) {
if (tmp instanceof Polygon) {
Polygon polygon=(Polygon)tmp;
if (polygon.getCoordinates().length < 1) {
continue;
}
float rWidth=polygon == selectedGeometry ? this.renderWidth * 2 : this.renderWidth;
int interior=polygon.getNumInteriorRing();
if (interior > 0) {
LineString line=polygon.getExteriorRing();
GL2ShapesRender.drawPoly(context,line.getCoordinates(),width,height,x,y,rWidth,color);
for (int i=0; i < interior; i++) {
LineString line2=polygon.getInteriorRingN(i);
GL2ShapesRender.drawPoly(context,line2.getCoordinates(),width,height,x,y,rWidth,color);
}
}
 else {
GL2ShapesRender.drawPoly(context,polygon.getCoordinates(),width,height,x,y,rWidth,color);
}
}
 else if (tmp instanceof MultiPolygon) {
MultiPolygon mpolygon=(MultiPolygon)tmp;
if (mpolygon.getCoordinates().length < 1) {
continue;
}
float rWidth=mpolygon == selectedGeometry ? this.renderWidth * 2 : this.renderWidth;
GL2ShapesRender.drawPoly(context,mpolygon.getCoordinates(),width,height,x,y,rWidth,color);
}
}
}
 else if (getType().equalsIgnoreCase(GeometricLayer.LINESTRING)) {
for (Geometry temp : geomList) {
if (temp.getCoordinates().length < 1) {
continue;
}
float size=(temp == selectedGeometry ? this.renderWidth * 2 : this.renderWidth);
GL2ShapesRender.renderPolygon(context,width,height,temp.getCoordinates(),size,color);
}
}
 else if (getType().equalsIgnoreCase(GeometricLayer.MIXED)) {
for (Geometry temp : geomList) {
if (temp.getCoordinates().length < 1) {
continue;
}
if (temp instanceof LineString || temp instanceof Polygon) {
float size=(temp == selectedGeometry ? this.renderWidth * 2 : this.renderWidth);
GL2ShapesRender.renderPolygon(context,width,height,temp.getCoordinates(),size,color);
}
 else if (temp instanceof Point) {
float size=(temp == selectedGeometry ? this.renderWidth * 2 : this.renderWidth);
Coordinate point=temp.getCoordinate();
GL2ShapesRender.renderPoint(context,width,height,point,size,color);
}
 else if (temp instanceof MultiPoint) {
float size=(temp == selectedGeometry ? this.renderWidth * 2 : this.renderWidth);
GL2ShapesRender.renderPolygon(context,width,height,temp.getCoordinates(),size,color);
}
}
}
}
 else {
if (getType().equalsIgnoreCase(GeometricLayer.POINT) && geomList != null) {
List<Geometry> toVisualize=new ArrayList<>();
for (Geometry temp : geomList) {
if (((Double)glayer.getAttributes(temp).get(VDSSchema.SIGNIFICANCE)) > currentThresh) {
toVisualize.add(temp);
}
}
switch (this.displaysymbol) {
case point:
{
GL2ShapesRender.renderPolygons(context,width,height,toVisualize,this.renderWidth,color);
if (selectedGeometry != null) {
GL2ShapesRender.renderPoint(context,width,height,selectedGeometry.getCoordinate(),this.renderWidth * 2,color);
}
}
break;
case circle:
{
GL2ShapesRender.renderCircle(context,width,height,toVisualize,selectedGeometry,this.renderWidth,color);
}
break;
case square:
{
GL2ShapesRender.renderSquare(context,width,height,toVisualize,selectedGeometry,renderWidth,color);
}
break;
case cross:
{
GL2ShapesRender.renderCross(context,width,height,toVisualize,selectedGeometry,renderWidth,color);
}
break;
case triangle:
{
GL2ShapesRender.renderTriangle(context,width,height,toVisualize,selectedGeometry,renderWidth,color);
}
break;
default :
{
}
}
}
 else if (getType().equalsIgnoreCase(GeometricLayer.POLYGON) || getType().equalsIgnoreCase(GeometricLayer.LINESTRING)) {
for (Geometry temp : geomList) {
if (((Double)glayer.getAttributes(temp).get(VDSSchema.SIGNIFICANCE)) > currentThresh) {
if (temp.getCoordinates().length < 1) {
continue;
}
float size=(temp == selectedGeometry ? this.renderWidth * 2 : this.renderWidth);
GL2ShapesRender.renderPolygon(context,width,height,temp.getCoordinates(),size,color);
}
}
}
 else if (getType().equalsIgnoreCase(GeometricLayer.MIXED)) {
for (Geometry temp : geomList) {
if (((Double)glayer.getAttributes(temp).get(VDSSchema.SIGNIFICANCE)) > currentThresh) {
if (temp.getCoordinates().length < 1) {
continue;
}
if (temp instanceof Polygon || temp instanceof LineString) {
float size=(temp == selectedGeometry ? this.renderWidth * 2 : this.renderWidth);
GL2ShapesRender.renderPolygon(context,width,height,temp.getCoordinates(),size,color);
}
 else if (temp instanceof Point) {
float size=temp == selectedGeometry ? this.renderWidth * 2 : this.renderWidth;
Coordinate point=temp.getCoordinate();
GL2ShapesRender.renderPoint(context,width,height,point,size,color);
}
}
}
}
}
}
}