nus-yam/ex-repair huggingface dataset:
Program: 175159
Project: 175159
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: 175163
Project: 175163
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: 175164
Project: 175164
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: 175165
Project: 175165
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: 175167
Project: 175167
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: 175168
Project: 175168
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: 175169
Project: 175169
Buggy source:
@Override public Geometry transformGeometryGeoFromPixel(Geometry geom) throws GeoTransformException {
  try {
    Coordinate[] coords=geom.getCoordinates();
    List<double[]> coordsConv=pGeo.parallelGeoFromPixel(coords);
    for (int i=0; i < coords.length; i++) {
      coords[i].x=coordsConv.get(i)[0];
      coords[i].y=coordsConv.get(i)[1];
    }
    return geom;
  }
 catch (  InterruptedException|ExecutionException ge) {
    throw new GeoTransformException(ge.getMessage());
  }
}

Fixed version (ground truth):
@Override public Geometry transformGeometryGeoFromPixel(final Geometry geom) throws GeoTransformException {
  try {
    Coordinate[] coords=geom.getCoordinates();
    List<double[]> coordsConv=pGeo.parallelGeoFromPixel(coords);
    for (int i=0; i < coords.length; i++) {
      coords[i].x=coordsConv.get(i)[0];
      coords[i].y=coordsConv.get(i)[1];
    }
    return geom;
  }
 catch (  InterruptedException|ExecutionException ge) {
    throw new GeoTransformException(ge.getMessage());
  }
}
Program: 175170
Project: 175170
Buggy source:
/** 
 * @param args
 */
private void addShapeFile(String[] args){
  File file=null;
  if (args.length >= 2) {
    file=new File(args[2].split("String_Node_Str")[1].replace("String_Node_Str","String_Node_Str"));
  }
 else {
    file=selectFile();
  }
  ImageLayer imgLayer=LayerManager.getIstanceManager().getCurrentImageLayer();
  if (imgLayer != null) {
    try {
      Polygon imageP=((SarImageReader)imgLayer.getImageReader()).getBbox(PlatformConfiguration.getConfigurationInstance().getLandMaskMargin(0));
      GeometricLayer gl=SimpleShapefile.createIntersectedLayer(file,imageP,((SarImageReader)imgLayer.getImageReader()).getGeoTransform());
      if (args.length == 3) {
        if (gl != null) {
          gl.setName(args[3]);
        }
      }
      done=LayerManager.addLayerInThread(FactoryLayer.TYPE_NON_COMPLEX,gl,imgLayer);
    }
 catch (    Exception ex) {
      logger.error(ex.getMessage(),ex);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param args
 */
private void addShapeFile(String[] args){
  File file=null;
  if (args.length >= 2) {
    file=new File(args[2].split("String_Node_Str")[1].replace("String_Node_Str","String_Node_Str"));
  }
 else {
    file=selectFile();
  }
  ImageLayer imgLayer=LayerManager.getIstanceManager().getCurrentImageLayer();
  if (imgLayer != null) {
    try {
      Polygon imageP=((SarImageReader)imgLayer.getImageReader()).getBbox(PlatformConfiguration.getConfigurationInstance().getLandMaskMargin(0));
      long start=System.currentTimeMillis();
      GeometricLayer gl=SimpleShapefile.createIntersectedLayer(file,imageP,((SarImageReader)imgLayer.getImageReader()).getGeoTransform());
      long end=System.currentTimeMillis();
      System.out.println("String_Node_Str" + (end - start));
      if (args.length == 3) {
        if (gl != null) {
          gl.setName(args[3]);
        }
      }
      done=LayerManager.addLayerInThread(FactoryLayer.TYPE_NON_COMPLEX,gl,imgLayer);
    }
 catch (    Exception ex) {
      logger.error(ex.getMessage(),ex);
    }
  }
}
Program: 175172
Project: 175172
Buggy source:
/** 
 * @param shpInput
 * @param bbox
 * @param transform
 * @return
 */
public static GeometricLayer createIntersectedLayer(File shpInput,Polygon bbox,GeoTransform transform){
  GeometricLayer glout=null;
  DataStore dataStore=null;
  try {
    if (shpInput != null) {
      Map<String,Serializable> params=new HashMap<String,Serializable>();
      params.put("String_Node_Str",shpInput.toURI().toURL());
      dataStore=DataStoreFinder.getDataStore(params);
      SimpleFeatureSource featureSource=(SimpleFeatureSource)dataStore.getFeatureSource(dataStore.getTypeNames()[0]);
      Polygon imageP=bbox;
      ClipProcess clip=new ClipProcess();
      SimpleFeatureCollection fc=clip.execute(featureSource.getFeatures(),imageP,true);
      if (fc.isEmpty()) {
        return null;
      }
      String[] schema=createSchema(fc.getSchema().getDescriptors());
      String[] types=createTypes(fc.getSchema().getDescriptors());
      String geoName=fc.getSchema().getGeometryDescriptor().getType().getName().toString();
      GeometricLayer out=GeometricLayer.createFromSimpleGeometry(imageP,geoName,fc,schema,types);
      out.setName(shpInput.getName());
      glout=GeometricLayer.createImageProjectedLayer(out,transform,null);
    }
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
 finally {
    if (dataStore != null)     dataStore.dispose();
  }
  return glout;
}

Fixed version (ground truth):
/** 
 * @param shpInput
 * @param bbox
 * @param transform
 * @return
 */
public static GeometricLayer createIntersectedLayer(File shpInput,Polygon bbox,GeoTransform transform){
  GeometricLayer glout=null;
  DataStore dataStore=null;
  try {
    if (shpInput != null) {
      Map<String,Serializable> params=new HashMap<String,Serializable>();
      params.put("String_Node_Str",shpInput.toURI().toURL());
      dataStore=DataStoreFinder.getDataStore(params);
      SimpleFeatureSource featureSource=(SimpleFeatureSource)dataStore.getFeatureSource(dataStore.getTypeNames()[0]);
      Polygon imageP=bbox;
      ClipProcess clip=new ClipProcess();
      SimpleFeatureCollection fc=clip.execute(featureSource.getFeatures(),imageP,true);
      if (fc.isEmpty()) {
        return null;
      }
      String[] schema=createSchema(fc.getSchema().getDescriptors());
      String[] types=createTypes(fc.getSchema().getDescriptors());
      String geoName=fc.getSchema().getGeometryDescriptor().getType().getName().toString();
      boolean applayT=false;
      if (transform != null)       applayT=true;
      glout=GeometricLayer.createFromSimpleGeometry(imageP,geoName,fc,schema,types,applayT,transform);
      glout.setName(shpInput.getName());
    }
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
 finally {
    if (dataStore != null)     dataStore.dispose();
  }
  return glout;
}
Program: 175173
Project: 175173
Buggy source:
/** 
 * Modify the GeometricLayer so the layer coordinate system matches the image coordinate system ("pixel" projection).
 */
public static GeometricLayer createImageProjectedLayer(GeometricLayer oldPositions,AffineTransform geoTransform){
  GeometricLayer positions=oldPositions.clone();
  for (  Geometry geom : positions.geoms) {
    for (    Coordinate pos : geom.getCoordinates()) {
      Point2D.Double temp=new Point2D.Double();
      try {
        geoTransform.inverseTransform(new Point2D.Double(pos.x,pos.y),temp);
      }
 catch (      NoninvertibleTransformException e) {
        e.printStackTrace();
      }
      pos.x=temp.x;
      pos.y=temp.y;
    }
  }
  return positions;
}

Fixed version (ground truth):
/** 
 * Modify the GeometricLayer so the layer coordinate system matches the image coordinate system ("pixel" projection).
 */
public static GeometricLayer createImageProjectedLayer(GeometricLayer layer,AffineTransform geoTransform){
  for (  Geometry geom : layer.geoms) {
    for (    Coordinate pos : geom.getCoordinates()) {
      Point2D.Double temp=new Point2D.Double();
      try {
        geoTransform.inverseTransform(new Point2D.Double(pos.x,pos.y),temp);
      }
 catch (      NoninvertibleTransformException e) {
        e.printStackTrace();
      }
      pos.x=temp.x;
      pos.y=temp.y;
    }
  }
  return layer;
}
Program: 175175
Project: 175175
Buggy source:
public static void main(String args[]){
  String metaF="String_Node_Str";
  GeoCoding gc;
  try {
    gc=new S1GeoCodingImpl(metaF);
    double lat=60;
    double lon=15;
    double r[];
    try {
      System.out.println("String_Node_Str" + GeoUtils.getGeoidH(lon,lat));
      r=gc.pixelFromGeo(lon,lat);
      System.out.println("String_Node_Str" + r[1] + "String_Node_Str"+ r[0]);
      r=gc.geoFromPixel(r[1],r[0]);
      System.out.println("String_Node_Str" + r[1] + "String_Node_Str"+ r[0]);
    }
 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";
  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: 175178
Project: 175178
Buggy source:
@Override public Geometry transformGeometryGeoFromPixel(Geometry geom) throws GeoTransformException {
  try {
    Coordinate[] coords=geom.getCoordinates();
    List<double[]> coordsConv=pGeo.parallelGeoFromPixel(coords);
    for (int i=0; i < coords.length; i++) {
      coords[i].x=coordsConv.get(i)[0];
      coords[i].y=coordsConv.get(i)[1];
    }
    return geom;
  }
 catch (  InterruptedException|ExecutionException ge) {
    throw new GeoTransformException(ge.getMessage());
  }
}

Fixed version (ground truth):
@Override public Geometry transformGeometryGeoFromPixel(final Geometry geom) throws GeoTransformException {
  try {
    Coordinate[] coords=geom.getCoordinates();
    List<double[]> coordsConv=pGeo.parallelGeoFromPixel(coords);
    for (int i=0; i < coords.length; i++) {
      coords[i].x=coordsConv.get(i)[0];
      coords[i].y=coordsConv.get(i)[1];
    }
    return geom;
  }
 catch (  InterruptedException|ExecutionException ge) {
    throw new GeoTransformException(ge.getMessage());
  }
}
Program: 175179
Project: 175179
Buggy source:
/** 
 * @param args
 */
private void addShapeFile(String[] args){
  File file=null;
  if (args.length >= 2) {
    file=new File(args[2].split("String_Node_Str")[1].replace("String_Node_Str","String_Node_Str"));
  }
 else {
    file=selectFile();
  }
  ImageLayer imgLayer=LayerManager.getIstanceManager().getCurrentImageLayer();
  if (imgLayer != null) {
    try {
      Polygon imageP=((SarImageReader)imgLayer.getImageReader()).getBbox(PlatformConfiguration.getConfigurationInstance().getLandMaskMargin(0));
      GeometricLayer gl=SimpleShapefile.createIntersectedLayer(file,imageP,((SarImageReader)imgLayer.getImageReader()).getGeoTransform());
      if (args.length == 3) {
        if (gl != null) {
          gl.setName(args[3]);
        }
      }
      done=LayerManager.addLayerInThread(FactoryLayer.TYPE_NON_COMPLEX,gl,imgLayer);
    }
 catch (    Exception ex) {
      logger.error(ex.getMessage(),ex);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param args
 */
private void addShapeFile(String[] args){
  File file=null;
  if (args.length >= 2) {
    file=new File(args[2].split("String_Node_Str")[1].replace("String_Node_Str","String_Node_Str"));
  }
 else {
    file=selectFile();
  }
  ImageLayer imgLayer=LayerManager.getIstanceManager().getCurrentImageLayer();
  if (imgLayer != null) {
    try {
      Polygon imageP=((SarImageReader)imgLayer.getImageReader()).getBbox(PlatformConfiguration.getConfigurationInstance().getLandMaskMargin(0));
      long start=System.currentTimeMillis();
      GeometricLayer gl=SimpleShapefile.createIntersectedLayer(file,imageP,((SarImageReader)imgLayer.getImageReader()).getGeoTransform());
      long end=System.currentTimeMillis();
      System.out.println("String_Node_Str" + (end - start));
      if (args.length == 3) {
        if (gl != null) {
          gl.setName(args[3]);
        }
      }
      done=LayerManager.addLayerInThread(FactoryLayer.TYPE_NON_COMPLEX,gl,imgLayer);
    }
 catch (    Exception ex) {
      logger.error(ex.getMessage(),ex);
    }
  }
}
Program: 175181
Project: 175181
Buggy source:
/** 
 * @param shpInput
 * @param bbox
 * @param transform
 * @return
 */
public static GeometricLayer createIntersectedLayer(File shpInput,Polygon bbox,GeoTransform transform){
  GeometricLayer glout=null;
  DataStore dataStore=null;
  try {
    if (shpInput != null) {
      Map<String,Serializable> params=new HashMap<String,Serializable>();
      params.put("String_Node_Str",shpInput.toURI().toURL());
      dataStore=DataStoreFinder.getDataStore(params);
      SimpleFeatureSource featureSource=(SimpleFeatureSource)dataStore.getFeatureSource(dataStore.getTypeNames()[0]);
      Polygon imageP=bbox;
      ClipProcess clip=new ClipProcess();
      SimpleFeatureCollection fc=clip.execute(featureSource.getFeatures(),imageP,true);
      if (fc.isEmpty()) {
        return null;
      }
      String[] schema=createSchema(fc.getSchema().getDescriptors());
      String[] types=createTypes(fc.getSchema().getDescriptors());
      String geoName=fc.getSchema().getGeometryDescriptor().getType().getName().toString();
      GeometricLayer out=GeometricLayer.createFromSimpleGeometry(imageP,geoName,fc,schema,types);
      out.setName(shpInput.getName());
      glout=GeometricLayer.createImageProjectedLayer(out,transform,null);
    }
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
 finally {
    if (dataStore != null)     dataStore.dispose();
  }
  return glout;
}

Fixed version (ground truth):
/** 
 * @param shpInput
 * @param bbox
 * @param transform
 * @return
 */
public static GeometricLayer createIntersectedLayer(File shpInput,Polygon bbox,GeoTransform transform){
  GeometricLayer glout=null;
  DataStore dataStore=null;
  try {
    if (shpInput != null) {
      Map<String,Serializable> params=new HashMap<String,Serializable>();
      params.put("String_Node_Str",shpInput.toURI().toURL());
      dataStore=DataStoreFinder.getDataStore(params);
      SimpleFeatureSource featureSource=(SimpleFeatureSource)dataStore.getFeatureSource(dataStore.getTypeNames()[0]);
      Polygon imageP=bbox;
      ClipProcess clip=new ClipProcess();
      SimpleFeatureCollection fc=clip.execute(featureSource.getFeatures(),imageP,true);
      if (fc.isEmpty()) {
        return null;
      }
      String[] schema=createSchema(fc.getSchema().getDescriptors());
      String[] types=createTypes(fc.getSchema().getDescriptors());
      String geoName=fc.getSchema().getGeometryDescriptor().getType().getName().toString();
      boolean applayT=false;
      if (transform != null)       applayT=true;
      glout=GeometricLayer.createFromSimpleGeometry(imageP,geoName,fc,schema,types,applayT,transform);
      glout.setName(shpInput.getName());
    }
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
 finally {
    if (dataStore != null)     dataStore.dispose();
  }
  return glout;
}
Program: 175182
Project: 175182
Buggy source:
/** 
 * Modify the GeometricLayer so the layer coordinate system matches the image coordinate system ("pixel" projection).
 */
public static GeometricLayer createImageProjectedLayer(GeometricLayer oldPositions,AffineTransform geoTransform){
  GeometricLayer positions=oldPositions.clone();
  for (  Geometry geom : positions.geoms) {
    for (    Coordinate pos : geom.getCoordinates()) {
      Point2D.Double temp=new Point2D.Double();
      try {
        geoTransform.inverseTransform(new Point2D.Double(pos.x,pos.y),temp);
      }
 catch (      NoninvertibleTransformException e) {
        e.printStackTrace();
      }
      pos.x=temp.x;
      pos.y=temp.y;
    }
  }
  return positions;
}

Fixed version (ground truth):
/** 
 * Modify the GeometricLayer so the layer coordinate system matches the image coordinate system ("pixel" projection).
 */
public static GeometricLayer createImageProjectedLayer(GeometricLayer layer,AffineTransform geoTransform){
  for (  Geometry geom : layer.geoms) {
    for (    Coordinate pos : geom.getCoordinates()) {
      Point2D.Double temp=new Point2D.Double();
      try {
        geoTransform.inverseTransform(new Point2D.Double(pos.x,pos.y),temp);
      }
 catch (      NoninvertibleTransformException e) {
        e.printStackTrace();
      }
      pos.x=temp.x;
      pos.y=temp.y;
    }
  }
  return layer;
}
Program: 175184
Project: 175184
Buggy source:
public static void main(String args[]){
  String metaF="String_Node_Str";
  GeoCoding gc;
  try {
    gc=new S1GeoCodingImpl(metaF);
    double lat=60;
    double lon=15;
    double r[];
    try {
      System.out.println("String_Node_Str" + GeoUtils.getGeoidH(lon,lat));
      r=gc.pixelFromGeo(lon,lat);
      System.out.println("String_Node_Str" + r[1] + "String_Node_Str"+ r[0]);
      r=gc.geoFromPixel(r[1],r[0]);
      System.out.println("String_Node_Str" + r[1] + "String_Node_Str"+ r[0]);
    }
 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";
  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: 175187
Project: 175187
Buggy source:
/** 
 * calculate new statistics using tile centered around pixel
 * @param cornerx
 * @param cornery
 * @param width
 * @param height
 * @param bands
 * @param data
 * @param kdist
 * @return
 */
public static double[][] calculateImagemapStatistics(int cornerx,int cornery,int width,int height,int[] bands,int data[][],KDistributionEstimation kdist){
  int numberofbands=bands.length;
  double[][] imagestat=new double[numberofbands][5];
  for (int i=0; i < numberofbands; i++) {
    int band=bands[i];
    kdist.setImageData(cornerx,cornery,width,height,0,0,band);
    kdist.estimate(null,data[i]);
    double[] thresh=kdist.getDetectThresh();
    imagestat[i][0]=thresh[0];
    imagestat[i][1]=thresh[1] / thresh[5];
    imagestat[i][2]=thresh[2] / thresh[5];
    imagestat[i][3]=thresh[3] / thresh[5];
    imagestat[i][4]=thresh[4] / thresh[5];
  }
  return imagestat;
}

Fixed version (ground truth):
/** 
 * calculate new statistics using tile centered around pixel
 * @param cornerx
 * @param cornery
 * @param width
 * @param height
 * @param bands
 * @param data
 * @param kdist
 * @return
 */
public static double[][] calculateImagemapStatistics(int cornerx,int cornery,int width,int height,int row,int col,int[] bands,int data[][],KDistributionEstimation kdist){
  int numberofbands=bands.length;
  double[][] imagestat=new double[numberofbands][5];
  for (int i=0; i < numberofbands; i++) {
    int band=bands[i];
    kdist.setImageData(cornerx,cornery,width,height,row,col,band);
    kdist.estimate(null,data[i]);
    double[] thresh=kdist.getDetectThresh();
    imagestat[i][0]=thresh[0];
    imagestat[i][1]=thresh[1] / thresh[5];
    imagestat[i][2]=thresh[2] / thresh[5];
    imagestat[i][3]=thresh[3] / thresh[5];
    imagestat[i][4]=thresh[4] / thresh[5];
  }
  return imagestat;
}
Program: 175189
Project: 175189
Buggy source:
/** 
 * @param gir
 * @param mask
 * @param enlf
 * @param thresholdHH
 * @param thresholdHV
 * @param thresholdVH
 * @param thresholdVV
 * @param progressBar
 */
public VDSAnalysis(SarImageReader gir,IMask[] mask,float enlf,float thresholdHH,float thresholdHV,float thresholdVH,float thresholdVV){
  this.enl="String_Node_Str" + (int)(enlf * 10);
  if (this.enl.length() == 2) {
    this.enl="String_Node_Str" + this.enl;
  }
  thresholdsBandParams.put("String_Node_Str",thresholdHH);
  thresholdsBandParams.put("String_Node_Str",thresholdHV);
  thresholdsBandParams.put("String_Node_Str",thresholdVH);
  thresholdsBandParams.put("String_Node_Str",thresholdVV);
  this.gir=gir;
  this.mask=mask;
  this.tileSize=(int)(ConstantVDSAnalysis.TILESIZE / gir.getPixelsize()[0]);
  if (this.tileSize < ConstantVDSAnalysis.TILESIZEPIXELS)   this.tileSize=ConstantVDSAnalysis.TILESIZEPIXELS;
  this.verTiles=gir.getHeight() / this.tileSize;
  this.horTiles=gir.getWidth() / this.tileSize;
  progressListener=new ArrayList<ProgressListener>();
}

Fixed version (ground truth):
/** 
 * @param gir
 * @param mask
 * @param enlf
 * @param thresholdHH
 * @param thresholdHV
 * @param thresholdVH
 * @param thresholdVV
 * @param progressBar
 */
public VDSAnalysis(SarImageReader gir,IMask[] mask,float enlf,Map<String,Float> trhresholdMap){
  this.enl="String_Node_Str" + (int)(enlf * 10);
  if (this.enl.length() == 2) {
    this.enl="String_Node_Str" + this.enl;
  }
  this.thresholdsBandParams=trhresholdMap;
  this.gir=gir;
  this.mask=mask;
  this.tileSize=(int)(ConstantVDSAnalysis.TILESIZE / gir.getPixelsize()[0]);
  if (this.tileSize < ConstantVDSAnalysis.TILESIZEPIXELS)   this.tileSize=ConstantVDSAnalysis.TILESIZEPIXELS;
  this.verTiles=gir.getHeight() / this.tileSize;
  this.horTiles=gir.getWidth() / this.tileSize;
  progressListener=new ArrayList<ProgressListener>();
}
Program: 175191
Project: 175191
Buggy source:
/** 
 * run analysis for 1 image
 */
public void analizeImage(SarImageReader reader,IMask[] masks,AnalysisParams params){
  analysis=new VDSAnalysis(reader,masks,params.enl,params.thresholdArrayValues[0],params.thresholdArrayValues[1],params.thresholdArrayValues[2],params.thresholdArrayValues[3]);
  final String[] thresholds={"String_Node_Str" + params.thresholdArrayValues[0],"String_Node_Str" + params.thresholdArrayValues[1],"String_Node_Str" + params.thresholdArrayValues[2],"String_Node_Str" + params.thresholdArrayValues[3]};
  layerResults=runBatchAnalysis(reader,params.enl,analysis,masks,thresholds,params.buffer);
}

Fixed version (ground truth):
/** 
 * run analysis for 1 image
 */
public void analizeImage(SarImageReader reader,IMask[] masks,AnalysisParams params){
  java.util.HashMap<String,Float> thresholdsMap=new java.util.HashMap<>();
  thresholdsMap.put("String_Node_Str",params.thresholdArrayValues[0]);
  thresholdsMap.put("String_Node_Str",params.thresholdArrayValues[1]);
  thresholdsMap.put("String_Node_Str",params.thresholdArrayValues[2]);
  thresholdsMap.put("String_Node_Str",params.thresholdArrayValues[3]);
  analysis=new VDSAnalysis(reader,masks,params.enl,thresholdsMap);
  final String[] thresholds={"String_Node_Str" + params.thresholdArrayValues[0],"String_Node_Str" + params.thresholdArrayValues[1],"String_Node_Str" + params.thresholdArrayValues[2],"String_Node_Str" + params.thresholdArrayValues[3]};
  layerResults=runBatchAnalysis(reader,params.enl,analysis,masks,thresholds,params.buffer);
}
Program: 175192
Project: 175192
Buggy source:
/** 
 * calculate new statistics using tile centered around pixel
 * @param cornerx
 * @param cornery
 * @param width
 * @param height
 * @param bands
 * @param data
 * @param kdist
 * @return
 */
public static double[][] calculateImagemapStatistics(int cornerx,int cornery,int width,int height,int[] bands,int data[][],KDistributionEstimation kdist){
  int numberofbands=bands.length;
  double[][] imagestat=new double[numberofbands][5];
  for (int i=0; i < numberofbands; i++) {
    int band=bands[i];
    kdist.setImageData(cornerx,cornery,width,height,0,0,band);
    kdist.estimate(null,data[i]);
    double[] thresh=kdist.getDetectThresh();
    imagestat[i][0]=thresh[0];
    imagestat[i][1]=thresh[1] / thresh[5];
    imagestat[i][2]=thresh[2] / thresh[5];
    imagestat[i][3]=thresh[3] / thresh[5];
    imagestat[i][4]=thresh[4] / thresh[5];
  }
  return imagestat;
}

Fixed version (ground truth):
/** 
 * calculate new statistics using tile centered around pixel
 * @param cornerx
 * @param cornery
 * @param width
 * @param height
 * @param bands
 * @param data
 * @param kdist
 * @return
 */
public static double[][] calculateImagemapStatistics(int cornerx,int cornery,int width,int height,int row,int col,int[] bands,int data[][],KDistributionEstimation kdist){
  int numberofbands=bands.length;
  double[][] imagestat=new double[numberofbands][5];
  for (int i=0; i < numberofbands; i++) {
    int band=bands[i];
    kdist.setImageData(cornerx,cornery,width,height,row,col,band);
    kdist.estimate(null,data[i]);
    double[] thresh=kdist.getDetectThresh();
    imagestat[i][0]=thresh[0];
    imagestat[i][1]=thresh[1] / thresh[5];
    imagestat[i][2]=thresh[2] / thresh[5];
    imagestat[i][3]=thresh[3] / thresh[5];
    imagestat[i][4]=thresh[4] / thresh[5];
  }
  return imagestat;
}
Program: 175194
Project: 175194
Buggy source:
/** 
 * @param gir
 * @param mask
 * @param enlf
 * @param thresholdHH
 * @param thresholdHV
 * @param thresholdVH
 * @param thresholdVV
 * @param progressBar
 */
public VDSAnalysis(SarImageReader gir,IMask[] mask,float enlf,float thresholdHH,float thresholdHV,float thresholdVH,float thresholdVV){
  this.enl="String_Node_Str" + (int)(enlf * 10);
  if (this.enl.length() == 2) {
    this.enl="String_Node_Str" + this.enl;
  }
  thresholdsBandParams.put("String_Node_Str",thresholdHH);
  thresholdsBandParams.put("String_Node_Str",thresholdHV);
  thresholdsBandParams.put("String_Node_Str",thresholdVH);
  thresholdsBandParams.put("String_Node_Str",thresholdVV);
  this.gir=gir;
  this.mask=mask;
  this.tileSize=(int)(ConstantVDSAnalysis.TILESIZE / gir.getPixelsize()[0]);
  if (this.tileSize < ConstantVDSAnalysis.TILESIZEPIXELS)   this.tileSize=ConstantVDSAnalysis.TILESIZEPIXELS;
  this.verTiles=gir.getHeight() / this.tileSize;
  this.horTiles=gir.getWidth() / this.tileSize;
  progressListener=new ArrayList<ProgressListener>();
}

Fixed version (ground truth):
/** 
 * @param gir
 * @param mask
 * @param enlf
 * @param thresholdHH
 * @param thresholdHV
 * @param thresholdVH
 * @param thresholdVV
 * @param progressBar
 */
public VDSAnalysis(SarImageReader gir,IMask[] mask,float enlf,Map<String,Float> trhresholdMap){
  this.enl="String_Node_Str" + (int)(enlf * 10);
  if (this.enl.length() == 2) {
    this.enl="String_Node_Str" + this.enl;
  }
  this.thresholdsBandParams=trhresholdMap;
  this.gir=gir;
  this.mask=mask;
  this.tileSize=(int)(ConstantVDSAnalysis.TILESIZE / gir.getPixelsize()[0]);
  if (this.tileSize < ConstantVDSAnalysis.TILESIZEPIXELS)   this.tileSize=ConstantVDSAnalysis.TILESIZEPIXELS;
  this.verTiles=gir.getHeight() / this.tileSize;
  this.horTiles=gir.getWidth() / this.tileSize;
  progressListener=new ArrayList<ProgressListener>();
}
Program: 175196
Project: 175196
Buggy source:
/** 
 * run analysis for 1 image
 */
public void analizeImage(SarImageReader reader,IMask[] masks,AnalysisParams params){
  analysis=new VDSAnalysis(reader,masks,params.enl,params.thresholdArrayValues[0],params.thresholdArrayValues[1],params.thresholdArrayValues[2],params.thresholdArrayValues[3]);
  final String[] thresholds={"String_Node_Str" + params.thresholdArrayValues[0],"String_Node_Str" + params.thresholdArrayValues[1],"String_Node_Str" + params.thresholdArrayValues[2],"String_Node_Str" + params.thresholdArrayValues[3]};
  layerResults=runBatchAnalysis(reader,params.enl,analysis,masks,thresholds,params.buffer);
}

Fixed version (ground truth):
/** 
 * run analysis for 1 image
 */
public void analizeImage(SarImageReader reader,IMask[] masks,AnalysisParams params){
  java.util.HashMap<String,Float> thresholdsMap=new java.util.HashMap<>();
  thresholdsMap.put("String_Node_Str",params.thresholdArrayValues[0]);
  thresholdsMap.put("String_Node_Str",params.thresholdArrayValues[1]);
  thresholdsMap.put("String_Node_Str",params.thresholdArrayValues[2]);
  thresholdsMap.put("String_Node_Str",params.thresholdArrayValues[3]);
  analysis=new VDSAnalysis(reader,masks,params.enl,thresholdsMap);
  final String[] thresholds={"String_Node_Str" + params.thresholdArrayValues[0],"String_Node_Str" + params.thresholdArrayValues[1],"String_Node_Str" + params.thresholdArrayValues[2],"String_Node_Str" + params.thresholdArrayValues[3]};
  layerResults=runBatchAnalysis(reader,params.enl,analysis,masks,thresholds,params.buffer);
}
Program: 175197
Project: 175197
Buggy source:
/** 
 * in Matlab is reverse
 * @param lat
 * @param lon
 */
public abstract double[] pixelFromGeo(double lat,double lon) throws GeoLocationException ;

Fixed version (ground truth):
/** 
 * in Matlab is reverse
 * @param lat
 * @param lon
 */
public abstract double[] pixelFromGeo(double lon,double lat) throws GeoLocationException ;
Program: 175198
Project: 175198
Buggy source:
public static void main(String args[]){
  String metaF="String_Node_Str";
  GeoCoding gc;
  try {
    gc=new S1GeoCodingImpl(metaF);
    double lat=36.950;
    double lon=-3.6315;
    double r[];
    try {
      r=gc.pixelFromGeo(55.55,-21.12);
      System.out.println("String_Node_Str" + r[1] + "String_Node_Str"+ r[0]);
      r=gc.geoFromPixel(2907.080,19312.507);
      System.out.println("String_Node_Str" + r[1] + "String_Node_Str"+ r[0]);
    }
 catch (    GeoLocationException e) {
      e.printStackTrace();
    }
  }
 catch (  MathException e1) {
    e1.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String args[]){
  String metaF="String_Node_Str";
  GeoCoding gc;
  try {
    gc=new S1GeoCodingImpl(metaF);
    double lat=-27.49984;
    double lon=30.69116;
    double pixel=370.5;
    double line=16482.2;
    double r[];
    try {
      r=gc.geoFromPixel(line,pixel);
      System.out.println("String_Node_Str" + r[1] + "String_Node_Str"+ r[0]);
    }
 catch (    GeoLocationException e) {
      e.printStackTrace();
    }
  }
 catch (  MathException e1) {
    e1.printStackTrace();
  }
}
Program: 175201
Project: 175201
Buggy source:
/** 
 * AG inserted a test to filter boats by length
 * @param list
 */
protected void computeBoatsAttributesAndStatistics(List<BoatConnectedPixelMap> list){
  List<Boat> boatsTemp=new ArrayList<Boat>();
  for (  BoatConnectedPixelMap boatPxMap : list) {
    boatPxMap.computeValues(pixsam,pixrec);
    if (boatPxMap.getBoatlength() > this.filterminSize && boatPxMap.getBoatlength() < this.filtermaxSize) {
      Boat b=new Boat(boatPxMap.getId(),(int)boatPxMap.getBoatposition()[0],(int)boatPxMap.getBoatposition()[1],(int)boatPxMap.getBoatnumberofpixels(),(int)boatPxMap.getBoatlength(),(int)boatPxMap.getBoatwidth(),(int)boatPxMap.getBoatheading());
      List<Double> thresholdsTile=boatPxMap.getThresholdValue();
      double max=boatPxMap.getMaximumValue();
      for (      Double t : thresholdsTile) {
      }
      boatsTemp.add(b);
    }
  }
  boatsTemp.clear();
  boatsTemp=sortBoats(boatsTemp);
  boatArray=boatsTemp.toArray(new Boat[0]);
}

Fixed version (ground truth):
/** 
 * AG inserted a test to filter boats by length
 * @param list
 */
protected void computeBoatsAttributesAndStatistics(List<BoatConnectedPixelMap> list){
  List<Boat> boatsTemp=new ArrayList<Boat>();
  for (  BoatConnectedPixelMap boatPxMap : list) {
    boatPxMap.computeValues(pixsam,pixrec);
    if (boatPxMap.getBoatlength() > this.filterminSize && boatPxMap.getBoatlength() < this.filtermaxSize) {
      Boat b=new Boat(boatPxMap.getId(),(int)boatPxMap.getBoatposition()[0],(int)boatPxMap.getBoatposition()[1],(int)boatPxMap.getBoatnumberofpixels(),(int)boatPxMap.getBoatlength(),(int)boatPxMap.getBoatwidth(),(int)boatPxMap.getBoatheading());
      List<Double> thresholdsTile=boatPxMap.getThresholdValue();
      double max=boatPxMap.getMaximumValue();
      for (      Double t : thresholdsTile) {
      }
      boatsTemp.add(b);
    }
  }
  boatsTemp=sortBoats(boatsTemp);
  boatArray=boatsTemp.toArray(new Boat[0]);
}
Program: 175202
Project: 175202
Buggy source:
public static void renderCross(OpenGLContext context,float zoomWidth,float zoomHeight,List<Geometry> geometries,Geometry selectedGeometry,float renderWidth,Color color){
  GL2 gl=context.getGL().getGL2();
  float[] c=color.brighter().getColorComponents(null);
  gl.glColor3f(c[0],c[1],c[2]);
  for (  Geometry temp : geometries) {
    gl.glLineWidth(temp == selectedGeometry ? renderWidth * 2 : renderWidth);
    Coordinate point=new Coordinate(temp.getCoordinate());
    point.x=(point.x - context.getX()) / zoomWidth;
    point.y=1 - (point.y - context.getY()) / zoomHeight;
    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();
  }
}

Fixed version (ground truth):
public static void renderCross(OpenGLContext context,float zoomWidth,float zoomHeight,List<Geometry> geometries,Geometry selectedGeometry,float renderWidth,Color color){
  GL2 gl=context.getGL().getGL2();
  float[] c=color.brighter().getColorComponents(null);
  gl.glColor3f(c[0],c[1],c[2]);
  if (geometries != null) {
    for (    Geometry temp : geometries) {
      gl.glLineWidth(temp == selectedGeometry ? renderWidth * 2 : renderWidth);
      Coordinate point=new Coordinate(temp.getCoordinate());
      point.x=(point.x - context.getX()) / zoomWidth;
      point.y=1 - (point.y - context.getY()) / zoomHeight;
      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();
    }
  }
}
Program: 175203
Project: 175203
Buggy source:
public static void renderTriangle(OpenGLContext context,float zoomWidth,float zoomHeight,List<Geometry> geometries,Geometry selectedGeometry,float renderWidth,Color color){
  GL2 gl=context.getGL().getGL2();
  float[] c=color.brighter().getColorComponents(null);
  gl.glColor3f(c[0],c[1],c[2]);
  for (  Geometry temp : geometries) {
    gl.glLineWidth(temp == selectedGeometry ? renderWidth * 2 : renderWidth);
    Coordinate point=new Coordinate(temp.getCoordinate());
    point.x=(point.x - context.getX()) / zoomWidth;
    point.y=1 - (point.y - context.getY()) / zoomHeight;
    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();
  }
}

Fixed version (ground truth):
public static void renderTriangle(OpenGLContext context,float zoomWidth,float zoomHeight,List<Geometry> geometries,Geometry selectedGeometry,float renderWidth,Color color){
  GL2 gl=context.getGL().getGL2();
  float[] c=color.brighter().getColorComponents(null);
  gl.glColor3f(c[0],c[1],c[2]);
  if (geometries != null) {
    for (    Geometry temp : geometries) {
      gl.glLineWidth(temp == selectedGeometry ? renderWidth * 2 : renderWidth);
      Coordinate point=new Coordinate(temp.getCoordinate());
      point.x=(point.x - context.getX()) / zoomWidth;
      point.y=1 - (point.y - context.getY()) / zoomHeight;
      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();
    }
  }
}
Program: 175204
Project: 175204
Buggy source:
/** 
 * in Matlab is reverse
 * @param lat
 * @param lon
 */
public abstract double[] pixelFromGeo(double lat,double lon) throws GeoLocationException ;

Fixed version (ground truth):
/** 
 * in Matlab is reverse
 * @param lat
 * @param lon
 */
public abstract double[] pixelFromGeo(double lon,double lat) throws GeoLocationException ;
Program: 175205
Project: 175205
Buggy source:
public static void main(String args[]){
  String metaF="String_Node_Str";
  GeoCoding gc;
  try {
    gc=new S1GeoCodingImpl(metaF);
    double lat=36.950;
    double lon=-3.6315;
    double r[];
    try {
      r=gc.pixelFromGeo(55.55,-21.12);
      System.out.println("String_Node_Str" + r[1] + "String_Node_Str"+ r[0]);
      r=gc.geoFromPixel(2907.080,19312.507);
      System.out.println("String_Node_Str" + r[1] + "String_Node_Str"+ r[0]);
    }
 catch (    GeoLocationException e) {
      e.printStackTrace();
    }
  }
 catch (  MathException e1) {
    e1.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String args[]){
  String metaF="String_Node_Str";
  GeoCoding gc;
  try {
    gc=new S1GeoCodingImpl(metaF);
    double lat=-27.49984;
    double lon=30.69116;
    double pixel=370.5;
    double line=16482.2;
    double r[];
    try {
      r=gc.geoFromPixel(line,pixel);
      System.out.println("String_Node_Str" + r[1] + "String_Node_Str"+ r[0]);
    }
 catch (    GeoLocationException e) {
      e.printStackTrace();
    }
  }
 catch (  MathException e1) {
    e1.printStackTrace();
  }
}
Program: 175208
Project: 175208
Buggy source:
/** 
 * AG inserted a test to filter boats by length
 * @param list
 */
protected void computeBoatsAttributesAndStatistics(List<BoatConnectedPixelMap> list){
  List<Boat> boatsTemp=new ArrayList<Boat>();
  for (  BoatConnectedPixelMap boatPxMap : list) {
    boatPxMap.computeValues(pixsam,pixrec);
    if (boatPxMap.getBoatlength() > this.filterminSize && boatPxMap.getBoatlength() < this.filtermaxSize) {
      Boat b=new Boat(boatPxMap.getId(),(int)boatPxMap.getBoatposition()[0],(int)boatPxMap.getBoatposition()[1],(int)boatPxMap.getBoatnumberofpixels(),(int)boatPxMap.getBoatlength(),(int)boatPxMap.getBoatwidth(),(int)boatPxMap.getBoatheading());
      List<Double> thresholdsTile=boatPxMap.getThresholdValue();
      double max=boatPxMap.getMaximumValue();
      for (      Double t : thresholdsTile) {
      }
      boatsTemp.add(b);
    }
  }
  boatsTemp.clear();
  boatsTemp=sortBoats(boatsTemp);
  boatArray=boatsTemp.toArray(new Boat[0]);
}

Fixed version (ground truth):
/** 
 * AG inserted a test to filter boats by length
 * @param list
 */
protected void computeBoatsAttributesAndStatistics(List<BoatConnectedPixelMap> list){
  List<Boat> boatsTemp=new ArrayList<Boat>();
  for (  BoatConnectedPixelMap boatPxMap : list) {
    boatPxMap.computeValues(pixsam,pixrec);
    if (boatPxMap.getBoatlength() > this.filterminSize && boatPxMap.getBoatlength() < this.filtermaxSize) {
      Boat b=new Boat(boatPxMap.getId(),(int)boatPxMap.getBoatposition()[0],(int)boatPxMap.getBoatposition()[1],(int)boatPxMap.getBoatnumberofpixels(),(int)boatPxMap.getBoatlength(),(int)boatPxMap.getBoatwidth(),(int)boatPxMap.getBoatheading());
      List<Double> thresholdsTile=boatPxMap.getThresholdValue();
      double max=boatPxMap.getMaximumValue();
      for (      Double t : thresholdsTile) {
      }
      boatsTemp.add(b);
    }
  }
  boatsTemp=sortBoats(boatsTemp);
  boatArray=boatsTemp.toArray(new Boat[0]);
}