nus-yam/ex-repair huggingface dataset:
Program: 175089
Project: 175089
Buggy source:
private void displayDownloading(int size){
  GeoImageViewerView view=((GeoImageViewerView)SumoPlatform.getApplication().getMainView());
  if (currentSize != size) {
    if (size == 0) {
      view.setInfo("String_Node_Str",-1);
    }
 else {
      view.setInfo(new StringBuilder("String_Node_Str").append(size).toString());
    }
    currentSize=size;
  }
}

Fixed version (ground truth):
private void displayDownloading(int size){
  if (currentSize != size) {
    if (size == 0) {
      SumoPlatform.getApplication().setMessageInfo("String_Node_Str");
    }
 else {
      SumoPlatform.getApplication().setMessageInfo(new StringBuilder("String_Node_Str").append(size).toString());
    }
    currentSize=size;
  }
}
Program: 175090
Project: 175090
Buggy source:
private boolean tryMemoryCache(GL gl,String file,float xmin,float xmax,float ymin,float ymax){
  Texture t=tcm.getTexture(file);
  if (t != null) {
    bindTexture(gl,t,xmin,xmax,ymin,ymax);
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * search for the tiles on memory
 * @param gl
 * @param file
 * @param xmin
 * @param xmax
 * @param ymin
 * @param ymax
 * @return
 */
private Texture tryMemoryCache(GL gl,String file,float xmin,float xmax,float ymin,float ymax){
  Texture t=tcm.getTexture(file);
  return t;
}
Program: 175096
Project: 175096
Buggy source:
public void add(ImageLayer layer){
  try {
    if (layer == null)     return;
    GeoImageReader reader=layer.getImageReader();
    List<double[]> imageframe=layer.getImageReader().getFrameLatLon(reader.getWidth(),reader.getHeight());
    if (imageframe != null) {
      List<LatLon> ll=new ArrayList<LatLon>();
      for (      double[] c : imageframe) {
        ll.add(new LatLon(Angle.fromDegreesLatitude(c[1]),Angle.fromDegreesLongitude(c[0])));
      }
      WWGeoImage gi=new WWGeoImage(new Polyline(ll,1000),new GlobeAnnotation(layer.getName() + "String_Node_Str",new Position(new LatLon(Angle.fromDegreesLatitude(imageframe.get(0)[1]),Angle.fromDegreesLongitude(imageframe.get(0)[0])),2000)),layer.isActive() ? Color.CYAN : Color.BLUE,layer.isActive() ? Color.CYAN : Color.BLUE);
      gi.setAnnotationVisible(layer.isActive());
      gi.setDelegateOwner(layer);
      imageLayer.addRenderable(gi);
    }
  }
 catch (  Exception e) {
    logger.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
public void add(ImageLayer layer){
  try {
    if (layer == null)     return;
    initGlobe();
    GeoImageReader reader=layer.getImageReader();
    List<double[]> imageframe=layer.getImageReader().getFrameLatLon(reader.getWidth(),reader.getHeight());
    if (imageframe != null) {
      List<LatLon> ll=new ArrayList<LatLon>();
      for (      double[] c : imageframe) {
        ll.add(new LatLon(Angle.fromDegreesLatitude(c[1]),Angle.fromDegreesLongitude(c[0])));
      }
      WWGeoImage gi=new WWGeoImage(new Polyline(ll,1000),new GlobeAnnotation(layer.getName() + "String_Node_Str",new Position(new LatLon(Angle.fromDegreesLatitude(imageframe.get(0)[1]),Angle.fromDegreesLongitude(imageframe.get(0)[0])),2000)),layer.isActive() ? Color.CYAN : Color.BLUE,layer.isActive() ? Color.CYAN : Color.BLUE);
      gi.setAnnotationVisible(layer.isActive());
      gi.setDelegateOwner(layer);
      imageLayer.addRenderable(gi);
    }
  }
 catch (  Exception e) {
    logger.error(e.getMessage(),e);
  }
}
Program: 175097
Project: 175097
Buggy source:
/** 
 * Creates new form WWJPanel 
 */
public WWJPanel(){
  initComponents();
  CatalogPanel catalogPanel=new CatalogPanel(this);
  catalogPanel.setSize(new Dimension(200,jTabbedPane1.getHeight() / 2));
  catalogPanel.setBorder(new LineBorder(new Color(255)));
  jTabbedPane1.add("String_Node_Str",catalogPanel);
  PlanningPanel planningPanel=new PlanningPanel(this);
  jTabbedPane1.add("String_Node_Str",planningPanel);
  this.addComponentListener(new ComponentListener(){
    @Override public void componentShown(    ComponentEvent e){
      if (acquisitionLayer == null) {
        acquisitionLayer=new TimeRenderableLayer();
        wwjCanvas.getModel().getLayers().add(acquisitionLayer);
      }
      if (imageLayer == null) {
        imageLayer=new TimeRenderableLayer();
        wwjCanvas.getModel().getLayers().add(imageLayer);
      }
    }
    @Override public void componentResized(    ComponentEvent e){
    }
    @Override public void componentMoved(    ComponentEvent e){
    }
    @Override public void componentHidden(    ComponentEvent e){
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Creates new form WWJPanel 
 */
public WWJPanel(){
  initComponents();
  CatalogPanel catalogPanel=new CatalogPanel(this);
  catalogPanel.setSize(new Dimension(200,jTabbedPane1.getHeight() / 2));
  catalogPanel.setBorder(new LineBorder(new Color(255)));
  jTabbedPane1.add("String_Node_Str",catalogPanel);
  PlanningPanel planningPanel=new PlanningPanel(this);
  jTabbedPane1.add("String_Node_Str",planningPanel);
  this.addComponentListener(new ComponentListener(){
    @Override public void componentShown(    ComponentEvent e){
      initGlobe();
    }
    @Override public void componentResized(    ComponentEvent e){
    }
    @Override public void componentMoved(    ComponentEvent e){
    }
    @Override public void componentHidden(    ComponentEvent e){
    }
  }
);
}
Program: 175099
Project: 175099
Buggy source:
public void add(ImageLayer layer){
  try {
    if (layer == null)     return;
    GeoImageReader reader=layer.getImageReader();
    List<double[]> imageframe=layer.getImageReader().getFrameLatLon(reader.getWidth(),reader.getHeight());
    if (imageframe != null) {
      List<LatLon> ll=new ArrayList<LatLon>();
      for (      double[] c : imageframe) {
        ll.add(new LatLon(Angle.fromDegreesLatitude(c[1]),Angle.fromDegreesLongitude(c[0])));
      }
      WWGeoImage gi=new WWGeoImage(new Polyline(ll,1000),new GlobeAnnotation(layer.getName() + "String_Node_Str",new Position(new LatLon(Angle.fromDegreesLatitude(imageframe.get(0)[1]),Angle.fromDegreesLongitude(imageframe.get(0)[0])),2000)),layer.isActive() ? Color.CYAN : Color.BLUE,layer.isActive() ? Color.CYAN : Color.BLUE);
      gi.setAnnotationVisible(layer.isActive());
      gi.setDelegateOwner(layer);
      imageLayer.addRenderable(gi);
    }
  }
 catch (  Exception e) {
    logger.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
public void add(ImageLayer layer){
  try {
    if (layer == null)     return;
    initGlobe();
    GeoImageReader reader=layer.getImageReader();
    List<double[]> imageframe=layer.getImageReader().getFrameLatLon(reader.getWidth(),reader.getHeight());
    if (imageframe != null) {
      List<LatLon> ll=new ArrayList<LatLon>();
      for (      double[] c : imageframe) {
        ll.add(new LatLon(Angle.fromDegreesLatitude(c[1]),Angle.fromDegreesLongitude(c[0])));
      }
      WWGeoImage gi=new WWGeoImage(new Polyline(ll,1000),new GlobeAnnotation(layer.getName() + "String_Node_Str",new Position(new LatLon(Angle.fromDegreesLatitude(imageframe.get(0)[1]),Angle.fromDegreesLongitude(imageframe.get(0)[0])),2000)),layer.isActive() ? Color.CYAN : Color.BLUE,layer.isActive() ? Color.CYAN : Color.BLUE);
      gi.setAnnotationVisible(layer.isActive());
      gi.setDelegateOwner(layer);
      imageLayer.addRenderable(gi);
    }
  }
 catch (  Exception e) {
    logger.error(e.getMessage(),e);
  }
}
Program: 175100
Project: 175100
Buggy source:
/** 
 * Creates new form WWJPanel 
 */
public WWJPanel(){
  initComponents();
  CatalogPanel catalogPanel=new CatalogPanel(this);
  catalogPanel.setSize(new Dimension(200,jTabbedPane1.getHeight() / 2));
  catalogPanel.setBorder(new LineBorder(new Color(255)));
  jTabbedPane1.add("String_Node_Str",catalogPanel);
  PlanningPanel planningPanel=new PlanningPanel(this);
  jTabbedPane1.add("String_Node_Str",planningPanel);
  this.addComponentListener(new ComponentListener(){
    @Override public void componentShown(    ComponentEvent e){
      if (acquisitionLayer == null) {
        acquisitionLayer=new TimeRenderableLayer();
        wwjCanvas.getModel().getLayers().add(acquisitionLayer);
      }
      if (imageLayer == null) {
        imageLayer=new TimeRenderableLayer();
        wwjCanvas.getModel().getLayers().add(imageLayer);
      }
    }
    @Override public void componentResized(    ComponentEvent e){
    }
    @Override public void componentMoved(    ComponentEvent e){
    }
    @Override public void componentHidden(    ComponentEvent e){
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Creates new form WWJPanel 
 */
public WWJPanel(){
  initComponents();
  CatalogPanel catalogPanel=new CatalogPanel(this);
  catalogPanel.setSize(new Dimension(200,jTabbedPane1.getHeight() / 2));
  catalogPanel.setBorder(new LineBorder(new Color(255)));
  jTabbedPane1.add("String_Node_Str",catalogPanel);
  PlanningPanel planningPanel=new PlanningPanel(this);
  jTabbedPane1.add("String_Node_Str",planningPanel);
  this.addComponentListener(new ComponentListener(){
    @Override public void componentShown(    ComponentEvent e){
      initGlobe();
    }
    @Override public void componentResized(    ComponentEvent e){
    }
    @Override public void componentMoved(    ComponentEvent e){
    }
    @Override public void componentHidden(    ComponentEvent e){
    }
  }
);
}
Program: 175103
Project: 175103
Buggy source:
public BlackBorderAnalysis(GeoImageReader gir,int hTileSize,int vTileSize,List<Geometry> land){
  this.gir=gir;
  int nb=gir.getNBand();
  if (nb > 1) {
    for (int i=0; i < nb; i++) {
      if (gir.getBandName(i).equalsIgnoreCase("String_Node_Str") || gir.getBandName(i).equalsIgnoreCase("String_Node_Str")) {
        bandAnalysis=i;
        break;
      }
    }
  }
  sizeX=hTileSize;
  sizeY=vTileSize;
  iNPixExtremes=tileSize / 10;
  this.land=land;
}

Fixed version (ground truth):
public BlackBorderAnalysis(GeoImageReader gir,int hTileSize,int vTileSize,List<Geometry> land){
  this.gir=gir;
  int nb=gir.getNBand();
  if (nb > 1) {
    for (int i=0; i < nb; i++) {
      if (gir.getBandName(i).equalsIgnoreCase("String_Node_Str") || gir.getBandName(i).equalsIgnoreCase("String_Node_Str")) {
        bandAnalysis=i;
        break;
      }
    }
  }
  sizeX=hTileSize;
  sizeY=vTileSize;
  iNPixExtremes=hTileSize < vTileSize ? vTileSize / 10 : hTileSize / 10;
  this.land=land;
}
Program: 175104
Project: 175104
Buggy source:
/** 
 * analyze single tile
 * @param row
 * @param col
 */
public void analyse(int row,int col,boolean horizontalAnalysis){
  int iniX=(col - 1) * sizeX;
  int iniY=(row - 1) * sizeY;
  boolean normalDirection=true;
  if ((iniX > (gir.getWidth() / 2) && horizontalAnalysis)) {
    normalDirection=false;
  }
  if ((iniY > (gir.getWidth() / 2) && !horizontalAnalysis)) {
    normalDirection=false;
  }
  analyzeTile(iniX,iniY,horizontalAnalysis,normalDirection);
}

Fixed version (ground truth):
/** 
 * analyze single tile
 * @param row
 * @param col
 * @return the threshold values for this tile
 */
public int[] analyse(int row,int col,boolean horizontalAnalysis){
  int iniX=(col - 1) * sizeX;
  int iniY=(row - 1) * sizeY;
  boolean normalDirection=true;
  if ((iniX > (gir.getWidth() / 2) && horizontalAnalysis)) {
    normalDirection=false;
  }
  if ((iniY > (gir.getWidth() / 2) && !horizontalAnalysis)) {
    normalDirection=false;
  }
  int[] trheshs=analyzeTile(iniX,iniY,horizontalAnalysis,normalDirection);
  return trheshs;
}
Program: 175107
Project: 175107
Buggy source:
public BlackBorderAnalysis(GeoImageReader gir,int hTileSize,int vTileSize,List<Geometry> land){
  this.gir=gir;
  int nb=gir.getNBand();
  if (nb > 1) {
    for (int i=0; i < nb; i++) {
      if (gir.getBandName(i).equalsIgnoreCase("String_Node_Str") || gir.getBandName(i).equalsIgnoreCase("String_Node_Str")) {
        bandAnalysis=i;
        break;
      }
    }
  }
  sizeX=hTileSize;
  sizeY=vTileSize;
  iNPixExtremes=tileSize / 10;
  this.land=land;
}

Fixed version (ground truth):
public BlackBorderAnalysis(GeoImageReader gir,int hTileSize,int vTileSize,List<Geometry> land){
  this.gir=gir;
  int nb=gir.getNBand();
  if (nb > 1) {
    for (int i=0; i < nb; i++) {
      if (gir.getBandName(i).equalsIgnoreCase("String_Node_Str") || gir.getBandName(i).equalsIgnoreCase("String_Node_Str")) {
        bandAnalysis=i;
        break;
      }
    }
  }
  sizeX=hTileSize;
  sizeY=vTileSize;
  iNPixExtremes=hTileSize < vTileSize ? vTileSize / 10 : hTileSize / 10;
  this.land=land;
}
Program: 175108
Project: 175108
Buggy source:
/** 
 * analyze single tile
 * @param row
 * @param col
 */
public void analyse(int row,int col,boolean horizontalAnalysis){
  int iniX=(col - 1) * sizeX;
  int iniY=(row - 1) * sizeY;
  boolean normalDirection=true;
  if ((iniX > (gir.getWidth() / 2) && horizontalAnalysis)) {
    normalDirection=false;
  }
  if ((iniY > (gir.getWidth() / 2) && !horizontalAnalysis)) {
    normalDirection=false;
  }
  analyzeTile(iniX,iniY,horizontalAnalysis,normalDirection);
}

Fixed version (ground truth):
/** 
 * analyze single tile
 * @param row
 * @param col
 * @return the threshold values for this tile
 */
public int[] analyse(int row,int col,boolean horizontalAnalysis){
  int iniX=(col - 1) * sizeX;
  int iniY=(row - 1) * sizeY;
  boolean normalDirection=true;
  if ((iniX > (gir.getWidth() / 2) && horizontalAnalysis)) {
    normalDirection=false;
  }
  if ((iniY > (gir.getWidth() / 2) && !horizontalAnalysis)) {
    normalDirection=false;
  }
  int[] trheshs=analyzeTile(iniX,iniY,horizontalAnalysis,normalDirection);
  return trheshs;
}
Program: 175111
Project: 175111
Buggy source:
@Override public Date getImageDate(){
  Timestamp t=Timestamp.valueOf(getTimeStampStart());
  return new Date(t.getTime());
}

Fixed version (ground truth):
@Override public Date getImageDate(){
  String ts=getTimeStampStart();
  ts=ts.replace("String_Node_Str","String_Node_Str");
  Timestamp t=Timestamp.valueOf(ts);
  return new Date(t.getTime());
}
Program: 175113
Project: 175113
Buggy source:
@Override public Date getImageDate(){
  Timestamp t=Timestamp.valueOf(getTimeStampStart());
  return new Date(t.getTime());
}

Fixed version (ground truth):
@Override public Date getImageDate(){
  String ts=getTimeStampStart();
  ts=ts.replace("String_Node_Str","String_Node_Str");
  Timestamp t=Timestamp.valueOf(ts);
  return new Date(t.getTime());
}
Program: 175118
Project: 175118
Buggy source:
public static void main(String args[]){
  String metaF="String_Node_Str";
  GeoCoding gc;
  try {
    gc=new S1GeoCodingImpl(metaF);
    double lat=54.81;
    double lon=-5.81;
    double p=6180.1;
    double l=13476.0;
    try {
      double r3[]=gc.geoFromPixel(l,p);
      System.out.println("String_Node_Str" + r3[0] + "String_Node_Str"+ r3[1]);
      System.out.println("String_Node_Str" + GeoUtils.getGeoidH(r3[0],r3[1]));
    }
 catch (    GeoLocationException e) {
      e.printStackTrace();
    }
  }
 catch (  Exception e1) {
    e1.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String args[]){
  String metaF="String_Node_Str" + "String_Node_Str";
  GeoCoding gc;
  try {
    gc=new S1GeoCodingImpl(metaF);
    double lat=54.81;
    double lon=-5.81;
    double p=6180.1;
    double l=13476.0;
    try {
      double r3[]=gc.geoFromPixel(l,p);
      System.out.println("String_Node_Str" + r3[0] + "String_Node_Str"+ r3[1]);
      System.out.println("String_Node_Str" + GeoUtils.getGeoidH(r3[0],r3[1]));
    }
 catch (    GeoLocationException e) {
      e.printStackTrace();
    }
  }
 catch (  Exception e1) {
    e1.printStackTrace();
  }
}
Program: 175120
Project: 175120
Buggy source:
/** 
 * @param annotationFile
 * @throws GeoTransformException
 */
public GeoTransformOrbitState(SumoAnnotationReader annotationFile) throws GeoTransformException {
  try {
    geocoding=new S1GeoCodingImpl(annotationFile);
    pGeo=new ParallelGeoCoding(geocoding);
  }
 catch (  MathException e) {
    throw new GeoTransformException(e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * @param annotationFile
 * @throws GeoTransformException
 */
public GeoTransformOrbitState(SumoAnnotationReader annotationFile) throws GeoTransformException {
  try {
    S1Metadata meta=new S1Metadata(annotationFile);
    meta.initMetaData();
    geocoding=new S1GeoCodingImpl(meta);
    pGeo=new ParallelGeoCoding(geocoding);
  }
 catch (  Exception e) {
    throw new GeoTransformException(e.getMessage());
  }
}
Program: 175121
Project: 175121
Buggy source:
public static void main(String[] args){
  String metaF="String_Node_Str";
  GeoCoding gc;
  try {
    gc=new S1GeoCodingImpl(metaF);
    double lat=41.31735;
    double lon=2.17263;
    Coordinate c=new Coordinate(lat,lon);
  }
 catch (  Exception e1) {
    e1.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  String metaF="String_Node_Str";
  GeoCoding gc;
  try {
    S1Metadata meta=new S1Metadata(metaF);
    meta.initMetaData();
    gc=new S1GeoCodingImpl(meta);
    double lat=41.31735;
    double lon=2.17263;
    Coordinate c=new Coordinate(lat,lon);
  }
 catch (  Exception e1) {
    e1.printStackTrace();
  }
}
Program: 175122
Project: 175122
Buggy source:
/** 
 * @param annotationFile
 * @throws GeoTransformException
 */
public GeoTransformOrbitState(SumoAnnotationReader annotationFile) throws GeoTransformException {
  try {
    geocoding=new S1GeoCodingImpl(annotationFile);
    pGeo=new ParallelGeoCoding(geocoding);
  }
 catch (  MathException e) {
    throw new GeoTransformException(e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * @param annotationFile
 * @throws GeoTransformException
 */
public GeoTransformOrbitState(SumoAnnotationReader annotationFile) throws GeoTransformException {
  try {
    S1Metadata meta=new S1Metadata(annotationFile);
    meta.initMetaData();
    geocoding=new S1GeoCodingImpl(meta);
    pGeo=new ParallelGeoCoding(geocoding);
  }
 catch (  Exception e) {
    throw new GeoTransformException(e.getMessage());
  }
}
Program: 175123
Project: 175123
Buggy source:
public static void main(String[] args){
  String metaF="String_Node_Str";
  GeoCoding gc;
  try {
    gc=new S1GeoCodingImpl(metaF);
    double lat=41.31735;
    double lon=2.17263;
    Coordinate c=new Coordinate(lat,lon);
  }
 catch (  Exception e1) {
    e1.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  String metaF="String_Node_Str";
  GeoCoding gc;
  try {
    S1Metadata meta=new S1Metadata(metaF);
    meta.initMetaData();
    gc=new S1GeoCodingImpl(meta);
    double lat=41.31735;
    double lon=2.17263;
    Coordinate c=new Coordinate(lat,lon);
  }
 catch (  Exception e1) {
    e1.printStackTrace();
  }
}
Program: 175126
Project: 175126
Buggy source:
public static void main(String args[]){
  String metaF="String_Node_Str";
  GeoCoding gc;
  try {
    gc=new S1GeoCodingImpl(metaF);
    double lat=54.81;
    double lon=-5.81;
    double p=6180.1;
    double l=13476.0;
    try {
      double r3[]=gc.geoFromPixel(l,p);
      System.out.println("String_Node_Str" + r3[0] + "String_Node_Str"+ r3[1]);
      System.out.println("String_Node_Str" + GeoUtils.getGeoidH(r3[0],r3[1]));
    }
 catch (    GeoLocationException e) {
      e.printStackTrace();
    }
  }
 catch (  Exception e1) {
    e1.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String args[]){
  String metaF="String_Node_Str" + "String_Node_Str";
  GeoCoding gc;
  try {
    gc=new S1GeoCodingImpl(metaF);
    double lat=54.81;
    double lon=-5.81;
    double p=6180.1;
    double l=13476.0;
    try {
      double r3[]=gc.geoFromPixel(l,p);
      System.out.println("String_Node_Str" + r3[0] + "String_Node_Str"+ r3[1]);
      System.out.println("String_Node_Str" + GeoUtils.getGeoidH(r3[0],r3[1]));
    }
 catch (    GeoLocationException e) {
      e.printStackTrace();
    }
  }
 catch (  Exception e1) {
    e1.printStackTrace();
  }
}
Program: 175128
Project: 175128
Buggy source:
public static void renderCircle(OpenGLContext context,float zoomWidth,float zoomHeight,List<Geometry> geometries,float size,Color color){
  GL2 gl=context.getGL().getGL2();
  gl.glBegin(GL.GL_POINTS);
  gl.glLineWidth(size);
  for (int ii=0; ii < geometries.size(); ii++) {
    Geometry temp=geometries.get(ii);
    Coordinate point=temp.getCoordinate();
    double dx=(point.x - context.getX()) / zoomWidth;
    double dy=1 - (point.y - context.getY()) / zoomHeight;
    for (int i=0; i < 360; i++) {
      double xx=dx + Math.sin(i) * 0.005;
      double yy=dy + Math.cos(i) * 0.005;
      gl.glVertex2d(xx,yy);
    }
  }
  gl.glEnd();
  gl.glFlush();
}

Fixed version (ground truth):
public static void renderCircle(OpenGLContext context,float zoomWidth,float zoomHeight,List<Geometry> geometries,Geometry selectedGeometry,float size,Color color){
  GL2 gl=context.getGL().getGL2();
  float[] c=color.brighter().getColorComponents(null);
  gl.glColor3f(c[0],c[1],c[2]);
  gl.glBegin(GL.GL_POINTS);
  for (int ii=0; ii < geometries.size(); ii++) {
    Geometry temp=geometries.get(ii);
    gl.glLineWidth(temp == selectedGeometry ? size * 2 : size);
    gl.glPointSize(temp == selectedGeometry ? size * 2 : size);
    Coordinate point=temp.getCoordinate();
    double dx=(point.x - context.getX()) / zoomWidth;
    double dy=1 - (point.y - context.getY()) / zoomHeight;
    for (int i=0; i < 360; i++) {
      double xx=dx + Math.sin(i) * 0.005;
      double yy=dy + Math.cos(i) * 0.005;
      gl.glVertex2d(xx,yy);
    }
  }
  gl.glEnd();
  gl.glFlush();
}
Program: 175130
Project: 175130
Buggy source:
@Override public void render(OpenGLContext context){
  checkRemoved();
  super.render(context);
  if (!context.isDirty() || glayer == null || !this.edit) {
    return;
  }
  float zoom=context.getZoom(), width=context.getWidth() * zoom, height=context.getHeight() * zoom;
  if (type.equalsIgnoreCase(GeometricLayer.POLYGON) || type.equalsIgnoreCase(GeometricLayer.LINESTRING)) {
    GL2ShapesRender.renderPolygons(context,width,height,glayer.getGeometries(),width * 2,getColor());
  }
  if (editedPoint != null) {
    GL2ShapesRender.renderPoint(context,width,height,editedPoint,width * 3,getColor());
  }
}

Fixed version (ground truth):
@Override public void render(OpenGLContext context){
  checkRemoved();
  super.render(context);
  if (!context.isDirty() || glayer == null || !this.edit) {
    return;
  }
  float zoom=context.getZoom(), width=context.getWidth() * zoom, height=context.getHeight() * zoom;
  if (type.equalsIgnoreCase(GeometricLayer.POLYGON) || type.equalsIgnoreCase(GeometricLayer.LINESTRING)) {
    GL2ShapesRender.renderPolygons(context,width,height,glayer.getGeometries(),2,getColor());
  }
  if (editedPoint != null) {
    GL2ShapesRender.renderPoint(context,width,height,editedPoint,4,getColor());
  }
}
Program: 175132
Project: 175132
Buggy source:
public AttributesGeometry(String[] attributesSchema){
  this.schema=attributesSchema;
  attributes=new HashMap<String,Object>();
  types=new HashMap<String,Class>();
  types.put("String_Node_Str",Integer.class);
}

Fixed version (ground truth):
public AttributesGeometry(String[] attributesSchema,Class[] typesAttr){
  this.schema=attributesSchema;
  attributes=new HashMap<String,Object>();
  types=new HashMap<String,Class>();
  for (int i=0; i < attributesSchema.length; i++) {
    types.put(attributesSchema[i],typesAttr[i]);
  }
}
Program: 175133
Project: 175133
Buggy source:
/** 
 * @param source
 * @return
 */
public AttributesGeometry emptyCloneAttributes(){
  AttributesGeometry out=new AttributesGeometry(getSchema());
  for (int i=0; i < schema.length; i++) {
    if (getValues() != null) {
      out.attributes.put(schema[i],null);
      out.types.put(schema[i],get(schema[i]).getClass());
    }
  }
  return out;
}

Fixed version (ground truth):
/** 
 * @param source
 * @return
 */
public AttributesGeometry emptyCloneAttributes(){
  AttributesGeometry out=new AttributesGeometry(getSchema());
  for (int i=0; i < schema.length; i++) {
    if (getValues() != null) {
      out.attributes.put(schema[i],null);
      if (get(schema[i]) != null)       out.types.put(schema[i],get(schema[i]).getClass());
    }
  }
  return out;
}
Program: 175134
Project: 175134
Buggy source:
protected void performAdd(java.awt.Point imagePosition,OpenGLContext context){
  if (type.equals(GeometricLayer.POINT)) {
    selectedGeometry=gf.createPoint(new Coordinate(imagePosition.x,imagePosition.y));
    int size=glayer.getGeometries().size();
    Integer maxVal=0;
    for (int i=0; i < size; i++) {
      Integer val=(Integer)((AttributesGeometry)glayer.getGeometries().get(i).getUserData()).get(VDSSchema.ID);
      if (val > maxVal)       maxVal=val;
    }
    maxVal++;
    AttributesGeometry source=(AttributesGeometry)glayer.getGeometries().get(0).getUserData();
    AttributesGeometry atts=source.emptyCloneAttributes();
    atts.set(VDSSchema.ID,maxVal);
    final AttributesEditor ae=new AttributesEditor(new java.awt.Frame(),true);
    ae.setAttributes(atts);
    ae.setVisible(true);
    HashMap<String,Object> newMapVals=ae.getAttributesValues();
    atts=setNewAttributeValues(atts,newMapVals);
    glayer.put(selectedGeometry,atts);
    ae.addWindowListener(new WindowAdapter(){
      public void windowClosed(      WindowEvent e){
        try {
        }
 catch (        Throwable t) {
          t.printStackTrace();
        }
      }
    }
);
  }
}

Fixed version (ground truth):
protected void performAdd(java.awt.Point imagePosition,OpenGLContext context){
  if (type.equals(GeometricLayer.POINT)) {
    selectedGeometry=gf.createPoint(new Coordinate(imagePosition.x,imagePosition.y));
    int size=glayer.getGeometries().size();
    Integer maxVal=0;
    for (int i=0; i < size; i++) {
      Integer val=(Integer)((AttributesGeometry)glayer.getGeometries().get(i).getUserData()).get(VDSSchema.ID);
      if (val > maxVal)       maxVal=val;
    }
    maxVal++;
    AttributesGeometry atts=null;
    atts=new AttributesGeometry(VDSSchema.schema,VDSSchema.types);
    atts.set(VDSSchema.ID,maxVal);
    final AttributesEditor ae=new AttributesEditor(new java.awt.Frame(),true);
    ae.setAttributes(atts);
    ae.setVisible(true);
    HashMap<String,Object> newMapVals=ae.getAttributesValues();
    atts=setNewAttributeValues(atts,newMapVals);
    glayer.put(selectedGeometry,atts);
    ae.addWindowListener(new WindowAdapter(){
      public void windowClosed(      WindowEvent e){
        try {
        }
 catch (        Throwable t) {
          t.printStackTrace();
        }
      }
    }
);
  }
}
Program: 175138
Project: 175138
Buggy source:
@Override public void preloadLineTile(int y,int length,int band){
  if (y < 0) {
    return;
  }
  preloadedInterval=new int[]{y,y + length};
  Rectangle rect=new Rectangle(0,y,getImage(band).xSize,length);
  TIFFImageReadParam tirp=new TIFFImageReadParam();
  tirp.setSourceRegion(rect);
  TIFF tiff=getImage(band);
  try {
    preloadedDataReal=tiff.getReader().read(0,tirp).getRaster().getSamples(0,0,getImage(band).xSize,length,0,(int[])null);
    preloadedDataImg=tiff.getReader().read(0,tirp).getRaster().getSamples(0,0,getImage(band).xSize,length,1,(int[])null);
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
}

Fixed version (ground truth):
@Override public void preloadLineTile(int y,int length,int band){
  if (y < 0) {
    return;
  }
  preloadedInterval=new int[]{y,y + length};
  Rectangle rect=new Rectangle(0,y,getImage(band).xSize,length);
  TIFFImageReadParam tirp=new TIFFImageReadParam();
  tirp.setSourceRegion(rect);
  TIFF tiff=getImage(band);
  try {
    preloadedDataReal=tiff.getReader().read(0,tirp).getRaster().getSamples(0,0,rect.width,rect.height,0,(int[])null);
    preloadedDataImg=tiff.getReader().read(0,tirp).getRaster().getSamples(0,0,rect.width,rect.height,1,(int[])null);
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
}
Program: 175139
Project: 175139
Buggy source:
@Override public int readPixel(int x,int y,int band){
  TIFFImageReadParam t=new TIFFImageReadParam();
  Rectangle rect=new Rectangle(x,y,1,1);
  rect=rect.intersection(bounds);
  t.setSourceRegion(rect);
  TIFF tiff=getImage(band);
  try {
    int img=tiff.getReader().read(0,t).getRaster().getSample(0,0,1);
    int real=tiff.getReader().read(0,t).getRaster().getSample(0,0,0);
    return (int)Math.sqrt(real * real + img * img);
  }
 catch (  IOException ex) {
    logger.error(ex.getMessage(),ex);
  }
catch (  ArrayIndexOutOfBoundsException ex) {
    logger.warn(ex.getMessage());
  }
catch (  IllegalArgumentException iae) {
    logger.warn(iae.getMessage());
  }
 finally {
  }
  return -1;
}

Fixed version (ground truth):
@Override public int readPixel(int x,int y,int band){
  TIFFImageReadParam t=new TIFFImageReadParam();
  Rectangle rect=new Rectangle(x,y,1,1);
  rect=rect.intersection(bounds);
  t.setSourceRegion(rect);
  TIFF tiff=getImage(band);
  try {
    int img=tiff.getReader().readRaster(0,t).getSample(0,0,1);
    int real=tiff.getReader().read(0,t).getRaster().getSample(0,0,0);
    return (int)Math.sqrt(real * real + img * img);
  }
 catch (  IOException ex) {
    logger.error(ex.getMessage(),ex);
  }
catch (  ArrayIndexOutOfBoundsException ex) {
    logger.warn(ex.getMessage());
    ex.printStackTrace();
  }
catch (  IllegalArgumentException iae) {
    logger.warn(iae.getMessage());
  }
 finally {
  }
  return -1;
}
Program: 175141
Project: 175141
Buggy source:
@Override public int[] read(int x,int y,int w,int h,int band){
  int[] data=new int[w * h];
  TIFFImageReadParam t=new TIFFImageReadParam();
  t.setSourceRegion(new Rectangle(x,y,w,h));
  TIFF tiff=getImage(band);
  try {
    int[] img=tiff.getReader().read(0,t).getRaster().getSamples(x,y,w,h,1,(int[])null);
    int[] real=tiff.getReader().read(0,t).getRaster().getSamples(x,y,w,h,0,(int[])null);
    for (int i=0; i < img.length; i++) {
      data[i]=(int)Math.sqrt(real[i] * real[i] + img[i] * img[i]);
    }
  }
 catch (  IOException ex) {
    logger.error(ex.getMessage(),ex);
  }
catch (  ArrayIndexOutOfBoundsException ex) {
    logger.warn(ex.getMessage());
  }
catch (  IllegalArgumentException iae) {
    logger.warn(iae.getMessage());
  }
 finally {
  }
  return data;
}

Fixed version (ground truth):
@Override public int[] read(int x,int y,int w,int h,int band){
  int[] data=new int[w * h];
  TIFFImageReadParam t=new TIFFImageReadParam();
  Rectangle rect=new Rectangle(x,y,w,h);
  rect=rect.intersection(bounds);
  t.setSourceRegion(rect);
  TIFF tiff=getImage(band);
  try {
    int[] img=tiff.getReader().read(0,t).getRaster().getSamples(0,0,w,h,1,(int[])null);
    int[] real=tiff.getReader().read(0,t).getRaster().getSamples(0,0,w,h,0,(int[])null);
    for (int i=0; i < img.length; i++) {
      data[i]=(int)Math.sqrt(real[i] * real[i] + img[i] * img[i]);
    }
  }
 catch (  IOException ex) {
    logger.error(ex.getMessage(),ex);
  }
catch (  ArrayIndexOutOfBoundsException ex) {
    logger.warn(ex.getMessage());
  }
catch (  IllegalArgumentException iae) {
    logger.warn(iae.getMessage());
  }
 finally {
  }
  return data;
}
Program: 175142
Project: 175142
Buggy source:
@Override public int readPixel(int x,int y,int band){
  TIFFImageReadParam t=new TIFFImageReadParam();
  t.setSourceRegion(new Rectangle(x,y,1,1));
  TIFF tiff=getImage(band);
  try {
    int img=tiff.getReader().read(0,t).getRaster().getSample(x,y,1);
    int real=tiff.getReader().read(0,t).getRaster().getSample(x,y,0);
    return (int)Math.sqrt(real * real + img * img);
  }
 catch (  IOException ex) {
    logger.error(ex.getMessage(),ex);
  }
catch (  ArrayIndexOutOfBoundsException ex) {
    logger.warn(ex.getMessage());
  }
catch (  IllegalArgumentException iae) {
    logger.warn(iae.getMessage());
  }
 finally {
  }
  return -1;
}

Fixed version (ground truth):
@Override public int readPixel(int x,int y,int band){
  TIFFImageReadParam t=new TIFFImageReadParam();
  Rectangle rect=new Rectangle(x,y,1,1);
  rect=rect.intersection(bounds);
  t.setSourceRegion(rect);
  TIFF tiff=getImage(band);
  try {
    int img=tiff.getReader().read(0,t).getRaster().getSample(0,0,1);
    int real=tiff.getReader().read(0,t).getRaster().getSample(0,0,0);
    return (int)Math.sqrt(real * real + img * img);
  }
 catch (  IOException ex) {
    logger.error(ex.getMessage(),ex);
  }
catch (  ArrayIndexOutOfBoundsException ex) {
    logger.warn(ex.getMessage());
  }
catch (  IllegalArgumentException iae) {
    logger.warn(iae.getMessage());
  }
 finally {
  }
  return -1;
}
Program: 175143
Project: 175143
Buggy source:
@Override public int[] readTile(int x,int y,int width,int height,int band){
  Rectangle rect=new Rectangle(x,y,width,height);
  rect=rect.intersection(bounds);
  int[] tile=new int[height * width];
  if (rect.isEmpty()) {
    return tile;
  }
  if (rect.y != preloadedInterval[0] | rect.y + rect.height != preloadedInterval[1]) {
    preloadLineTile(rect.y,rect.height,band);
  }
  int yOffset=getImage(band).xSize;
  int xinit=rect.x - x;
  int yinit=rect.y - y;
  for (int i=0; i < rect.height; i++) {
    for (int j=0; j < rect.width; j++) {
      int temp=i * yOffset + j + rect.x;
      long real=preloadedDataReal[temp];
      long img=preloadedDataImg[temp];
      tile[(i + yinit) * width + j + xinit]=(int)Math.sqrt(real * real + img * img);
    }
  }
  return tile;
}

Fixed version (ground truth):
@Override public int[] readTile(int x,int y,int width,int height,int band){
  Rectangle rect=new Rectangle(x,y,width,height);
  rect=rect.intersection(bounds);
  int[] tile=new int[height * width];
  if (rect.isEmpty()) {
    return tile;
  }
  if (rect.y != preloadedInterval[0] | rect.y + rect.height != preloadedInterval[1]) {
    preloadLineTile(rect.y,rect.height,band);
  }
  int yOffset=getImage(band).xSize;
  int xinit=rect.x - x;
  int yinit=rect.y - y;
  int temp=0;
  try {
    for (int i=0; i < rect.height; i++) {
      for (int j=0; j < rect.width; j++) {
        temp=(i * yOffset + j + rect.x);
        long real=preloadedDataReal[temp];
        long img=preloadedDataImg[temp];
        tile[(i + yinit) * width + j + xinit]=(int)Math.sqrt(real * real + img * img);
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return tile;
}
Program: 175145
Project: 175145
Buggy source:
public static void main(String[] args){
  double cc[][]=new double[][]{{200.0,200.0},{500.0,200.0},{500.0,500.0},{200.0,500.0},{200.0,200.0}};
  try {
    Polygon p=PolygonOp.createPolygon(cc);
    List<Geometry> geoms=new ArrayList<>();
    geoms.add(p);
    SimpleShapefile.exportGeometriesToShapeFile(geoms,new File("String_Node_Str"),"String_Node_Str",null,null,null);
  }
 catch (  IOException|SchemaException e) {
    e.printStackTrace();
  }
catch (  ParseException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  double cc[][]=new double[][]{{200.0,200.0},{500.0,200.0},{500.0,500.0},{200.0,500.0},{200.0,200.0}};
  try {
    Polygon p=PolygonOp.createPolygon(cc);
    List<Geometry> geoms=new ArrayList<>();
    geoms.add(p);
    SimpleShapefile.exportGeometriesToShapeFile(geoms,new File("String_Node_Str"),"String_Node_Str",null,null);
  }
 catch (  IOException|SchemaException e) {
    e.printStackTrace();
  }
catch (  ParseException e) {
    e.printStackTrace();
  }
}
Program: 175146
Project: 175146
Buggy source:
/** 
 * @param output
 * @param layer
 * @param projection
 * @param reader
 */
public static void exportLayer(File output,GeometricLayer layer,String projection,GeoTransform transform){
  try {
    String type=layer.getGeometries().get(0).getGeometryType();
    SimpleFeatureType featureType=createFeatureType(layer.getGeometries().get(0).getClass(),layer.getAttributes().get(0));
    exportGeometriesToShapeFile(layer.getGeometries(),output,type,transform,featureType,layer.getAttributes());
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
 finally {
  }
}

Fixed version (ground truth):
/** 
 * @param output
 * @param layer
 * @param projection
 * @param reader
 */
public static void exportLayer(File output,GeometricLayer layer,String projection,GeoTransform transform){
  try {
    String type=layer.getGeometries().get(0).getGeometryType();
    SimpleFeatureType featureType=createFeatureType(layer.getGeometries().get(0).getClass(),(AttributesGeometry)layer.getGeometries().get(0).getUserData());
    exportGeometriesToShapeFile(layer.getGeometries(),output,type,transform,featureType);
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
 finally {
  }
}
Program: 175147
Project: 175147
Buggy source:
private void calculateMaxMinTresh(){
  minThresh=Double.MAX_VALUE;
  maxThresh=Double.MIN_VALUE;
  for (  AttributesGeometry att : glayer.getAttributes()) {
    double temp=new Double("String_Node_Str" + att.get(VDSSchema.SIGNIFICANCE));
    if (temp < minThresh) {
      minThresh=temp;
    }
    if (temp > maxThresh) {
      maxThresh=temp;
    }
  }
  currentThresh=minThresh - 0.01;
}

Fixed version (ground truth):
private void calculateMaxMinTresh(){
  minThresh=Double.MAX_VALUE;
  maxThresh=Double.MIN_VALUE;
  for (  Geometry geoms : glayer.getGeometries()) {
    AttributesGeometry att=(AttributesGeometry)geoms.getUserData();
    double temp=new Double("String_Node_Str" + att.get(VDSSchema.SIGNIFICANCE));
    if (temp < minThresh) {
      minThresh=temp;
    }
    if (temp > maxThresh) {
      maxThresh=temp;
    }
  }
  currentThresh=minThresh - 0.01;
}
Program: 175148
Project: 175148
Buggy source:
public Date[] getDates(){
  Date[] out=new Date[2];
  out[1]=new Date(0);
  out[0]=new Date(Long.MAX_VALUE);
  for (  AttributesGeometry at : glayer.getAttributes()) {
    Date temp=(Date)at.get(timeColumn);
    if (out[0].after(temp)) {
      out[0]=temp;
    }
    if (out[1].before(temp)) {
      out[1]=temp;
    }
  }
  return out;
}

Fixed version (ground truth):
public Date[] getDates(){
  Date[] out=new Date[2];
  out[1]=new Date(0);
  out[0]=new Date(Long.MAX_VALUE);
  for (  Geometry g : glayer.getGeometries()) {
    AttributesGeometry at=(AttributesGeometry)g.getUserData();
    Date temp=(Date)at.get(timeColumn);
    if (out[0].after(temp)) {
      out[0]=temp;
    }
    if (out[1].before(temp)) {
      out[1]=temp;
    }
  }
  return out;
}
Program: 175150
Project: 175150
Buggy source:
public static void main(String[] args){
  double cc[][]=new double[][]{{200.0,200.0},{500.0,200.0},{500.0,500.0},{200.0,500.0},{200.0,200.0}};
  try {
    Polygon p=PolygonOp.createPolygon(cc);
    List<Geometry> geoms=new ArrayList<>();
    geoms.add(p);
    SimpleShapefile.exportGeometriesToShapeFile(geoms,new File("String_Node_Str"),"String_Node_Str",null,null,null);
  }
 catch (  IOException|SchemaException e) {
    e.printStackTrace();
  }
catch (  ParseException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  double cc[][]=new double[][]{{200.0,200.0},{500.0,200.0},{500.0,500.0},{200.0,500.0},{200.0,200.0}};
  try {
    Polygon p=PolygonOp.createPolygon(cc);
    List<Geometry> geoms=new ArrayList<>();
    geoms.add(p);
    SimpleShapefile.exportGeometriesToShapeFile(geoms,new File("String_Node_Str"),"String_Node_Str",null,null);
  }
 catch (  IOException|SchemaException e) {
    e.printStackTrace();
  }
catch (  ParseException e) {
    e.printStackTrace();
  }
}
Program: 175151
Project: 175151
Buggy source:
/** 
 * @param output
 * @param layer
 * @param projection
 * @param reader
 */
public static void exportLayer(File output,GeometricLayer layer,String projection,GeoTransform transform){
  try {
    String type=layer.getGeometries().get(0).getGeometryType();
    SimpleFeatureType featureType=createFeatureType(layer.getGeometries().get(0).getClass(),layer.getAttributes().get(0));
    exportGeometriesToShapeFile(layer.getGeometries(),output,type,transform,featureType,layer.getAttributes());
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
 finally {
  }
}

Fixed version (ground truth):
/** 
 * @param output
 * @param layer
 * @param projection
 * @param reader
 */
public static void exportLayer(File output,GeometricLayer layer,String projection,GeoTransform transform){
  try {
    String type=layer.getGeometries().get(0).getGeometryType();
    SimpleFeatureType featureType=createFeatureType(layer.getGeometries().get(0).getClass(),(AttributesGeometry)layer.getGeometries().get(0).getUserData());
    exportGeometriesToShapeFile(layer.getGeometries(),output,type,transform,featureType);
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
 finally {
  }
}
Program: 175152
Project: 175152
Buggy source:
private void calculateMaxMinTresh(){
  minThresh=Double.MAX_VALUE;
  maxThresh=Double.MIN_VALUE;
  for (  AttributesGeometry att : glayer.getAttributes()) {
    double temp=new Double("String_Node_Str" + att.get(VDSSchema.SIGNIFICANCE));
    if (temp < minThresh) {
      minThresh=temp;
    }
    if (temp > maxThresh) {
      maxThresh=temp;
    }
  }
  currentThresh=minThresh - 0.01;
}

Fixed version (ground truth):
private void calculateMaxMinTresh(){
  minThresh=Double.MAX_VALUE;
  maxThresh=Double.MIN_VALUE;
  for (  Geometry geoms : glayer.getGeometries()) {
    AttributesGeometry att=(AttributesGeometry)geoms.getUserData();
    double temp=new Double("String_Node_Str" + att.get(VDSSchema.SIGNIFICANCE));
    if (temp < minThresh) {
      minThresh=temp;
    }
    if (temp > maxThresh) {
      maxThresh=temp;
    }
  }
  currentThresh=minThresh - 0.01;
}
Program: 175153
Project: 175153
Buggy source:
public Date[] getDates(){
  Date[] out=new Date[2];
  out[1]=new Date(0);
  out[0]=new Date(Long.MAX_VALUE);
  for (  AttributesGeometry at : glayer.getAttributes()) {
    Date temp=(Date)at.get(timeColumn);
    if (out[0].after(temp)) {
      out[0]=temp;
    }
    if (out[1].before(temp)) {
      out[1]=temp;
    }
  }
  return out;
}

Fixed version (ground truth):
public Date[] getDates(){
  Date[] out=new Date[2];
  out[1]=new Date(0);
  out[0]=new Date(Long.MAX_VALUE);
  for (  Geometry g : glayer.getGeometries()) {
    AttributesGeometry at=(AttributesGeometry)g.getUserData();
    Date temp=(Date)at.get(timeColumn);
    if (out[0].after(temp)) {
      out[0]=temp;
    }
    if (out[1].before(temp)) {
      out[1]=temp;
    }
  }
  return out;
}
Program: 175154
Project: 175154
Buggy source:
public static void renderCircle(OpenGLContext context,float zoomWidth,float zoomHeight,List<Geometry> geometries,float size,Color color){
  GL2 gl=context.getGL().getGL2();
  gl.glBegin(GL.GL_POINTS);
  gl.glLineWidth(size);
  for (int ii=0; ii < geometries.size(); ii++) {
    Geometry temp=geometries.get(ii);
    Coordinate point=temp.getCoordinate();
    double dx=(point.x - context.getX()) / zoomWidth;
    double dy=1 - (point.y - context.getY()) / zoomHeight;
    for (int i=0; i < 360; i++) {
      double xx=dx + Math.sin(i) * 0.005;
      double yy=dy + Math.cos(i) * 0.005;
      gl.glVertex2d(xx,yy);
    }
  }
  gl.glEnd();
  gl.glFlush();
}

Fixed version (ground truth):
public static void renderCircle(OpenGLContext context,float zoomWidth,float zoomHeight,List<Geometry> geometries,Geometry selectedGeometry,float size,Color color){
  GL2 gl=context.getGL().getGL2();
  float[] c=color.brighter().getColorComponents(null);
  gl.glColor3f(c[0],c[1],c[2]);
  gl.glBegin(GL.GL_POINTS);
  for (int ii=0; ii < geometries.size(); ii++) {
    Geometry temp=geometries.get(ii);
    gl.glLineWidth(temp == selectedGeometry ? size * 2 : size);
    gl.glPointSize(temp == selectedGeometry ? size * 2 : size);
    Coordinate point=temp.getCoordinate();
    double dx=(point.x - context.getX()) / zoomWidth;
    double dy=1 - (point.y - context.getY()) / zoomHeight;
    for (int i=0; i < 360; i++) {
      double xx=dx + Math.sin(i) * 0.005;
      double yy=dy + Math.cos(i) * 0.005;
      gl.glVertex2d(xx,yy);
    }
  }
  gl.glEnd();
  gl.glFlush();
}
Program: 175156
Project: 175156
Buggy source:
@Override public void render(OpenGLContext context){
  checkRemoved();
  super.render(context);
  if (!context.isDirty() || glayer == null || !this.edit) {
    return;
  }
  float zoom=context.getZoom(), width=context.getWidth() * zoom, height=context.getHeight() * zoom;
  if (type.equalsIgnoreCase(GeometricLayer.POLYGON) || type.equalsIgnoreCase(GeometricLayer.LINESTRING)) {
    GL2ShapesRender.renderPolygons(context,width,height,glayer.getGeometries(),width * 2,getColor());
  }
  if (editedPoint != null) {
    GL2ShapesRender.renderPoint(context,width,height,editedPoint,width * 3,getColor());
  }
}

Fixed version (ground truth):
@Override public void render(OpenGLContext context){
  checkRemoved();
  super.render(context);
  if (!context.isDirty() || glayer == null || !this.edit) {
    return;
  }
  float zoom=context.getZoom(), width=context.getWidth() * zoom, height=context.getHeight() * zoom;
  if (type.equalsIgnoreCase(GeometricLayer.POLYGON) || type.equalsIgnoreCase(GeometricLayer.LINESTRING)) {
    GL2ShapesRender.renderPolygons(context,width,height,glayer.getGeometries(),2,getColor());
  }
  if (editedPoint != null) {
    GL2ShapesRender.renderPoint(context,width,height,editedPoint,4,getColor());
  }
}
Program: 175157
Project: 175157
Buggy source:
@Override public int[] read(int x,int y,int w,int h,int band){
  int[] data=new int[w * h];
  TIFFImageReadParam t=new TIFFImageReadParam();
  t.setSourceRegion(new Rectangle(x,y,w,h));
  TIFF tiff=getImage(band);
  try {
    int[] img=tiff.getReader().read(0,t).getRaster().getSamples(x,y,w,h,1,(int[])null);
    int[] real=tiff.getReader().read(0,t).getRaster().getSamples(x,y,w,h,0,(int[])null);
    for (int i=0; i < img.length; i++) {
      data[i]=(int)Math.sqrt(real[i] * real[i] + img[i] * img[i]);
    }
  }
 catch (  IOException ex) {
    logger.error(ex.getMessage(),ex);
  }
catch (  ArrayIndexOutOfBoundsException ex) {
    logger.warn(ex.getMessage());
  }
catch (  IllegalArgumentException iae) {
    logger.warn(iae.getMessage());
  }
 finally {
  }
  return data;
}

Fixed version (ground truth):
@Override public int[] read(int x,int y,int w,int h,int band){
  int[] data=new int[w * h];
  TIFFImageReadParam t=new TIFFImageReadParam();
  Rectangle rect=new Rectangle(x,y,w,h);
  rect=rect.intersection(bounds);
  t.setSourceRegion(rect);
  TIFF tiff=getImage(band);
  try {
    int[] img=tiff.getReader().read(0,t).getRaster().getSamples(0,0,w,h,1,(int[])null);
    int[] real=tiff.getReader().read(0,t).getRaster().getSamples(0,0,w,h,0,(int[])null);
    for (int i=0; i < img.length; i++) {
      data[i]=(int)Math.sqrt(real[i] * real[i] + img[i] * img[i]);
    }
  }
 catch (  IOException ex) {
    logger.error(ex.getMessage(),ex);
  }
catch (  ArrayIndexOutOfBoundsException ex) {
    logger.warn(ex.getMessage());
  }
catch (  IllegalArgumentException iae) {
    logger.warn(iae.getMessage());
  }
 finally {
  }
  return data;
}
Program: 175158
Project: 175158
Buggy source:
@Override public int readPixel(int x,int y,int band){
  TIFFImageReadParam t=new TIFFImageReadParam();
  t.setSourceRegion(new Rectangle(x,y,1,1));
  TIFF tiff=getImage(band);
  try {
    int img=tiff.getReader().read(0,t).getRaster().getSample(x,y,1);
    int real=tiff.getReader().read(0,t).getRaster().getSample(x,y,0);
    return (int)Math.sqrt(real * real + img * img);
  }
 catch (  IOException ex) {
    logger.error(ex.getMessage(),ex);
  }
catch (  ArrayIndexOutOfBoundsException ex) {
    logger.warn(ex.getMessage());
  }
catch (  IllegalArgumentException iae) {
    logger.warn(iae.getMessage());
  }
 finally {
  }
  return -1;
}

Fixed version (ground truth):
@Override public int readPixel(int x,int y,int band){
  TIFFImageReadParam t=new TIFFImageReadParam();
  Rectangle rect=new Rectangle(x,y,1,1);
  rect=rect.intersection(bounds);
  t.setSourceRegion(rect);
  TIFF tiff=getImage(band);
  try {
    int img=tiff.getReader().read(0,t).getRaster().getSample(0,0,1);
    int real=tiff.getReader().read(0,t).getRaster().getSample(0,0,0);
    return (int)Math.sqrt(real * real + img * img);
  }
 catch (  IOException ex) {
    logger.error(ex.getMessage(),ex);
  }
catch (  ArrayIndexOutOfBoundsException ex) {
    logger.warn(ex.getMessage());
  }
catch (  IllegalArgumentException iae) {
    logger.warn(iae.getMessage());
  }
 finally {
  }
  return -1;
}