nus-yam/ex-repair huggingface dataset:
Program: 175209
Project: 175209
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: 175210
Project: 175210
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: 175211
Project: 175211
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(2.17235,41.31749);
      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=36.950;
    double lon=-3.6315;
    double r[];
    try {
      r=gc.geoFromPixel(4623,7445);
      System.out.println("String_Node_Str" + r[1] + "String_Node_Str"+ r[0]);
    }
 catch (    GeoLocationException e) {
      e.printStackTrace();
    }
  }
 catch (  MathException e1) {
    e1.printStackTrace();
  }
}
Program: 175212
Project: 175212
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(2.17235,41.31749);
      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=36.950;
    double lon=-3.6315;
    double r[];
    try {
      r=gc.geoFromPixel(4623,7445);
      System.out.println("String_Node_Str" + r[1] + "String_Node_Str"+ r[0]);
    }
 catch (    GeoLocationException e) {
      e.printStackTrace();
    }
  }
 catch (  MathException e1) {
    e1.printStackTrace();
  }
}
Program: 175213
Project: 175213
Buggy source:
/** 
 * @param lon
 * @param lat
 * @return the geoid Height for a point (lon,lat)
 */
public static double getGeoidH(final double lon,final double lat){
  double h=0;
  double lonRad=lon * FastMath.PI / 180;
  double latRad=lat * FastMath.PI / 180;
  boolean finded=false;
  for (int row=0; row < geoidPoints.length && !finded; row++) {
    int middle=geoidPoints[0].length / 2;
    Geoid geoRow[]=geoidPoints[row];
    Geoid g=geoRow[middle];
    double middleDist=distance(lonRad,lat,g.lonRad,g.latRad);
    if (middleDist < 110) {
      h=g.h;
    }
 else {
      int left=0;
      int right=geoidPoints[0].length;
      for (; right - left > 1; ) {
        int middleLeft=(left + middle) / 2;
        int middleRight=middle + (right - middle) / 2;
        double middleDistL=distance(lonRad,latRad,geoRow[middleLeft].lonRad,geoRow[middleLeft].latRad);
        double middleDistR=distance(lonRad,latRad,geoRow[middleRight].lonRad,geoRow[middleRight].latRad);
        if (middleDistL < middleDistR) {
          right=middle;
          middle=left + (right - left) / 2;
          middleDist=middleDistL;
        }
 else {
          left=middle;
          middle=left + (right - left) / 2;
          middleDist=middleDistR;
        }
        if (middleDist < 110) {
          h=geoRow[middle].h;
          finded=true;
          break;
        }
      }
    }
  }
  return h;
}

Fixed version (ground truth):
/** 
 * @param lon
 * @param lat
 * @return the geoid Height for a point (lon,lat)
 */
public static double getGeoidH(final double lon,final double lat){
  double h=0;
  double lonRad=lon * FastMath.PI / 180;
  double latRad=lat * FastMath.PI / 180;
  boolean finded=false;
  for (int row=0; row < geoidPoints.length && !finded; row++) {
    int middle=geoidPoints[0].length / 2;
    Geoid geoRow[]=geoidPoints[row];
    Geoid g=geoRow[middle];
    double middleDist=distance(lonRad,latRad,g.lonRad,g.latRad);
    if (middleDist < 50) {
      h=g.h;
    }
 else {
      int left=0;
      int right=geoidPoints[0].length;
      for (; right - left > 1; ) {
        int middleLeft=(left + middle) / 2;
        int middleRight=middle + (right - middle) / 2;
        double middleDistL=distance(lonRad,latRad,geoRow[middleLeft].lonRad,geoRow[middleLeft].latRad);
        double middleDistR=distance(lonRad,latRad,geoRow[middleRight].lonRad,geoRow[middleRight].latRad);
        if (middleDistL < middleDistR) {
          right=middle;
          middle=left + (right - left) / 2;
          middleDist=middleDistL;
        }
 else {
          left=middle;
          middle=left + (right - left) / 2;
          middleDist=middleDistR;
        }
        if (middleDist < 50) {
          h=geoRow[middle].h;
          finded=true;
          break;
        }
      }
    }
  }
  return h;
}
Program: 175215
Project: 175215
Buggy source:
/** 
 * @param lon
 * @param lat
 * @return the geoid Height for a point (lon,lat)
 */
public static double getGeoidH(final double lon,final double lat){
  double h=0;
  double lonRad=lon * FastMath.PI / 180;
  double latRad=lat * FastMath.PI / 180;
  boolean finded=false;
  for (int row=0; row < geoidPoints.length && !finded; row++) {
    int middle=geoidPoints[0].length / 2;
    Geoid geoRow[]=geoidPoints[row];
    Geoid g=geoRow[middle];
    double middleDist=distance(lonRad,lat,g.lonRad,g.latRad);
    if (middleDist < 110) {
      h=g.h;
    }
 else {
      int left=0;
      int right=geoidPoints[0].length;
      for (; right - left > 1; ) {
        int middleLeft=(left + middle) / 2;
        int middleRight=middle + (right - middle) / 2;
        double middleDistL=distance(lonRad,latRad,geoRow[middleLeft].lonRad,geoRow[middleLeft].latRad);
        double middleDistR=distance(lonRad,latRad,geoRow[middleRight].lonRad,geoRow[middleRight].latRad);
        if (middleDistL < middleDistR) {
          right=middle;
          middle=left + (right - left) / 2;
          middleDist=middleDistL;
        }
 else {
          left=middle;
          middle=left + (right - left) / 2;
          middleDist=middleDistR;
        }
        if (middleDist < 110) {
          h=geoRow[middle].h;
          finded=true;
          break;
        }
      }
    }
  }
  return h;
}

Fixed version (ground truth):
/** 
 * @param lon
 * @param lat
 * @return the geoid Height for a point (lon,lat)
 */
public static double getGeoidH(final double lon,final double lat){
  double h=0;
  double lonRad=lon * FastMath.PI / 180;
  double latRad=lat * FastMath.PI / 180;
  boolean finded=false;
  for (int row=0; row < geoidPoints.length && !finded; row++) {
    int middle=geoidPoints[0].length / 2;
    Geoid geoRow[]=geoidPoints[row];
    Geoid g=geoRow[middle];
    double middleDist=distance(lonRad,latRad,g.lonRad,g.latRad);
    if (middleDist < 50) {
      h=g.h;
    }
 else {
      int left=0;
      int right=geoidPoints[0].length;
      for (; right - left > 1; ) {
        int middleLeft=(left + middle) / 2;
        int middleRight=middle + (right - middle) / 2;
        double middleDistL=distance(lonRad,latRad,geoRow[middleLeft].lonRad,geoRow[middleLeft].latRad);
        double middleDistR=distance(lonRad,latRad,geoRow[middleRight].lonRad,geoRow[middleRight].latRad);
        if (middleDistL < middleDistR) {
          right=middle;
          middle=left + (right - left) / 2;
          middleDist=middleDistL;
        }
 else {
          left=middle;
          middle=left + (right - left) / 2;
          middleDist=middleDistR;
        }
        if (middleDist < 50) {
          h=geoRow[middle].h;
          finded=true;
          break;
        }
      }
    }
  }
  return h;
}
Program: 175217
Project: 175217
Buggy source:
public static void main(String args[]){
  String metaF="String_Node_Str";
  GeoCoding gc;
  try {
    gc=new S1GeoCodingImpl(metaF);
    double lat=61.77994;
    double lon=-65.66427;
    double r[];
    try {
      r=gc.pixelFromGeo(lon,lat);
      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=36.950;
    double lon=-3.6315;
    double r[];
    try {
      r=gc.geoFromPixel(24223,16704);
      System.out.println("String_Node_Str" + r[1] + "String_Node_Str"+ r[0]);
    }
 catch (    GeoLocationException e) {
      e.printStackTrace();
    }
  }
 catch (  MathException e1) {
    e1.printStackTrace();
  }
}
Program: 175221
Project: 175221
Buggy source:
public static void main(String args[]){
  String metaF="String_Node_Str";
  GeoCoding gc;
  try {
    gc=new S1GeoCodingImpl(metaF);
    double lat=61.77994;
    double lon=-65.66427;
    double r[];
    try {
      r=gc.pixelFromGeo(lon,lat);
      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=36.950;
    double lon=-3.6315;
    double r[];
    try {
      r=gc.geoFromPixel(24223,16704);
      System.out.println("String_Node_Str" + r[1] + "String_Node_Str"+ r[0]);
    }
 catch (    GeoLocationException e) {
      e.printStackTrace();
    }
  }
 catch (  MathException e1) {
    e1.printStackTrace();
  }
}
Program: 175225
Project: 175225
Buggy source:
/** 
 * @param imageFile
 * @param band form files with multiple band
 */
public TIFF(File imageFile,int band){
  this.imageFile=imageFile;
  try {
    Iterator<ImageReader> readers=ImageIO.getImageReadersByFormatName("String_Node_Str");
    boolean worked=false;
    while (readers.hasNext() && !worked) {
      Object obj=readers.next();
      if (obj instanceof TIFFImageReader) {
        reader=(TIFFImageReader)obj;
        ImageInputStream iis=ImageIO.createImageInputStream(imageFile);
        reader.setInput(iis);
        xSize=reader.getWidth(band);
        ySize=reader.getHeight(band);
        bounds=new Rectangle(0,0,xSize,ySize);
        worked=true;
      }
 else {
      }
    }
    if (!worked) {
      logger.warn("String_Node_Str");
    }
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
}

Fixed version (ground truth):
/** 
 * @param imageFile
 * @param band form files with multiple band
 */
public TIFF(File imageFile,int band){
  this.imageFile=imageFile;
  try {
    Iterator<ImageReader> readers=ImageIO.getImageReadersByFormatName("String_Node_Str");
    boolean worked=false;
    while (readers.hasNext() && !worked) {
      Object obj=readers.next();
      if (obj instanceof TIFFImageReader) {
        reader=(TIFFImageReader)obj;
        ImageInputStream iis=ImageIO.createImageInputStream(imageFile);
        reader.setInput(iis);
        try {
          xSize=reader.getWidth(band);
          ySize=reader.getHeight(band);
          bounds=new Rectangle(0,0,xSize,ySize);
        }
 catch (        Exception e) {
          bounds=null;
          logger.warn("String_Node_Str");
        }
        worked=true;
      }
 else {
      }
    }
    if (!worked) {
      logger.warn("String_Node_Str");
    }
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
}
Program: 175227
Project: 175227
Buggy source:
@Override public boolean initialise(){
  try {
    this.displayName=manifestFile.getName();
    setFile(manifestFile);
    parseProductXML(productxml);
    tiffImages=getImages();
    TIFF image=tiffImages.values().iterator().next();
    bounds=new Rectangle(0,0,image.xSize,image.ySize);
    gcps=getGcps();
    if (gcps == null) {
      dispose();
      return false;
    }
    geotransform=GeoTransformFactory.createFromGcps(gcps,"String_Node_Str");
    double radialdist=Math.pow(xposition * xposition + yposition * yposition + zposition * zposition,0.5);
    MathTransform convert;
    double[] latlon=getGeoTransform().getGeoFromPixel(0,0);
    double[] position=new double[3];
    convert=CRS.findMathTransform(DefaultGeographicCRS.WGS84,DefaultGeocentricCRS.CARTESIAN);
    convert.transform(latlon,0,position,0,1);
    double earthradial=Math.pow(position[0] * position[0] + position[1] * position[1] + position[2] * position[2],0.5);
    setSatelliteAltitude(radialdist - earthradial);
    float firstIncidenceangle=(float)(this.gcps.get(0).getAngle());
    float lastIncidenceAngle=(float)(this.gcps.get(this.gcps.size() - 1).getAngle());
    setIncidenceNear(firstIncidenceangle < lastIncidenceAngle ? firstIncidenceangle : lastIncidenceAngle);
    setIncidenceFar(firstIncidenceangle > lastIncidenceAngle ? firstIncidenceangle : lastIncidenceAngle);
  }
 catch (  TransformException|FactoryException|GeoTransformException ex) {
    logger.error(ex.getMessage(),ex);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean initialise(){
  try {
    this.displayName=manifestFile.getName();
    setFile(manifestFile);
    parseProductXML(productxml);
    tiffImages=getImages();
    bounds=new Rectangle(0,0,getMetaWidth(),getMetaHeight());
    gcps=getGcps();
    if (gcps == null) {
      dispose();
      return false;
    }
    geotransform=GeoTransformFactory.createFromGcps(gcps,"String_Node_Str");
    double radialdist=Math.pow(xposition * xposition + yposition * yposition + zposition * zposition,0.5);
    MathTransform convert;
    double[] latlon=getGeoTransform().getGeoFromPixel(0,0);
    double[] position=new double[3];
    convert=CRS.findMathTransform(DefaultGeographicCRS.WGS84,DefaultGeocentricCRS.CARTESIAN);
    convert.transform(latlon,0,position,0,1);
    double earthradial=Math.pow(position[0] * position[0] + position[1] * position[1] + position[2] * position[2],0.5);
    setSatelliteAltitude(radialdist - earthradial);
    float firstIncidenceangle=(float)(this.gcps.get(0).getAngle());
    float lastIncidenceAngle=(float)(this.gcps.get(this.gcps.size() - 1).getAngle());
    setIncidenceNear(firstIncidenceangle < lastIncidenceAngle ? firstIncidenceangle : lastIncidenceAngle);
    setIncidenceFar(firstIncidenceangle > lastIncidenceAngle ? firstIncidenceangle : lastIncidenceAngle);
  }
 catch (  TransformException|FactoryException|GeoTransformException ex) {
    logger.error(ex.getMessage(),ex);
  }
  return true;
}
Program: 175228
Project: 175228
Buggy source:
/** 
 * @return
 */
private Map<String,TIFF> getImages(){
  @SuppressWarnings("String_Node_Str") List<Object> elements=doc.getRootElement().getChild("String_Node_Str").getChildren("String_Node_Str");
  Map<String,TIFF> tiffs=new HashMap<String,TIFF>();
  bands=new Vector<String>();
  for (  Object o : elements) {
    if (o instanceof Element) {
      StringBuilder f=new StringBuilder(productxml.getParent()).append("String_Node_Str").append(((Element)o).getChild("String_Node_Str").getChild("String_Node_Str").getChild("String_Node_Str").getText()).append("String_Node_Str").append(((Element)o).getChild("String_Node_Str").getChild("String_Node_Str").getChild("String_Node_Str").getText());
      String polarisation=((Element)o).getChild("String_Node_Str").getValue();
      tiffs.put(polarisation,new TIFF(new File(f.toString()),0));
      bands.add(polarisation);
    }
  }
  return tiffs;
}

Fixed version (ground truth):
/** 
 * @return
 */
private Map<String,TIFF> getImages(){
  @SuppressWarnings("String_Node_Str") List<Object> elements=doc.getRootElement().getChild("String_Node_Str").getChildren("String_Node_Str");
  Map<String,TIFF> tiffs=new HashMap<String,TIFF>();
  bands=new Vector<String>();
  for (  Object o : elements) {
    if (o instanceof Element) {
      StringBuilder f=new StringBuilder(productxml.getParent()).append("String_Node_Str").append(((Element)o).getChild("String_Node_Str").getChild("String_Node_Str").getChild("String_Node_Str").getText()).append("String_Node_Str").append(((Element)o).getChild("String_Node_Str").getChild("String_Node_Str").getChild("String_Node_Str").getText());
      String polarisation=((Element)o).getChild("String_Node_Str").getValue();
      TIFF t=new TIFF(new File(f.toString()),0);
      t.setxSize(getMetaWidth());
      t.setySize(getMetaHeight());
      tiffs.put(polarisation,t);
      bands.add(polarisation);
    }
  }
  return tiffs;
}
Program: 175229
Project: 175229
Buggy source:
/** 
 * @param imageFile
 * @param band form files with multiple band
 */
public TIFF(File imageFile,int band){
  this.imageFile=imageFile;
  try {
    Iterator<ImageReader> readers=ImageIO.getImageReadersByFormatName("String_Node_Str");
    boolean worked=false;
    while (readers.hasNext() && !worked) {
      Object obj=readers.next();
      if (obj instanceof TIFFImageReader) {
        reader=(TIFFImageReader)obj;
        ImageInputStream iis=ImageIO.createImageInputStream(imageFile);
        reader.setInput(iis);
        xSize=reader.getWidth(band);
        ySize=reader.getHeight(band);
        bounds=new Rectangle(0,0,xSize,ySize);
        worked=true;
      }
 else {
      }
    }
    if (!worked) {
      logger.warn("String_Node_Str");
    }
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
}

Fixed version (ground truth):
/** 
 * @param imageFile
 * @param band form files with multiple band
 */
public TIFF(File imageFile,int band){
  this.imageFile=imageFile;
  try {
    Iterator<ImageReader> readers=ImageIO.getImageReadersByFormatName("String_Node_Str");
    boolean worked=false;
    while (readers.hasNext() && !worked) {
      Object obj=readers.next();
      if (obj instanceof TIFFImageReader) {
        reader=(TIFFImageReader)obj;
        ImageInputStream iis=ImageIO.createImageInputStream(imageFile);
        reader.setInput(iis);
        try {
          xSize=reader.getWidth(band);
          ySize=reader.getHeight(band);
          bounds=new Rectangle(0,0,xSize,ySize);
        }
 catch (        Exception e) {
          bounds=null;
          logger.warn("String_Node_Str");
        }
        worked=true;
      }
 else {
      }
    }
    if (!worked) {
      logger.warn("String_Node_Str");
    }
  }
 catch (  Exception ex) {
    logger.error(ex.getMessage(),ex);
  }
}
Program: 175231
Project: 175231
Buggy source:
@Override public boolean initialise(){
  try {
    this.displayName=manifestFile.getName();
    setFile(manifestFile);
    parseProductXML(productxml);
    tiffImages=getImages();
    TIFF image=tiffImages.values().iterator().next();
    bounds=new Rectangle(0,0,image.xSize,image.ySize);
    gcps=getGcps();
    if (gcps == null) {
      dispose();
      return false;
    }
    geotransform=GeoTransformFactory.createFromGcps(gcps,"String_Node_Str");
    double radialdist=Math.pow(xposition * xposition + yposition * yposition + zposition * zposition,0.5);
    MathTransform convert;
    double[] latlon=getGeoTransform().getGeoFromPixel(0,0);
    double[] position=new double[3];
    convert=CRS.findMathTransform(DefaultGeographicCRS.WGS84,DefaultGeocentricCRS.CARTESIAN);
    convert.transform(latlon,0,position,0,1);
    double earthradial=Math.pow(position[0] * position[0] + position[1] * position[1] + position[2] * position[2],0.5);
    setSatelliteAltitude(radialdist - earthradial);
    float firstIncidenceangle=(float)(this.gcps.get(0).getAngle());
    float lastIncidenceAngle=(float)(this.gcps.get(this.gcps.size() - 1).getAngle());
    setIncidenceNear(firstIncidenceangle < lastIncidenceAngle ? firstIncidenceangle : lastIncidenceAngle);
    setIncidenceFar(firstIncidenceangle > lastIncidenceAngle ? firstIncidenceangle : lastIncidenceAngle);
  }
 catch (  TransformException|FactoryException|GeoTransformException ex) {
    logger.error(ex.getMessage(),ex);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean initialise(){
  try {
    this.displayName=manifestFile.getName();
    setFile(manifestFile);
    parseProductXML(productxml);
    tiffImages=getImages();
    bounds=new Rectangle(0,0,getMetaWidth(),getMetaHeight());
    gcps=getGcps();
    if (gcps == null) {
      dispose();
      return false;
    }
    geotransform=GeoTransformFactory.createFromGcps(gcps,"String_Node_Str");
    double radialdist=Math.pow(xposition * xposition + yposition * yposition + zposition * zposition,0.5);
    MathTransform convert;
    double[] latlon=getGeoTransform().getGeoFromPixel(0,0);
    double[] position=new double[3];
    convert=CRS.findMathTransform(DefaultGeographicCRS.WGS84,DefaultGeocentricCRS.CARTESIAN);
    convert.transform(latlon,0,position,0,1);
    double earthradial=Math.pow(position[0] * position[0] + position[1] * position[1] + position[2] * position[2],0.5);
    setSatelliteAltitude(radialdist - earthradial);
    float firstIncidenceangle=(float)(this.gcps.get(0).getAngle());
    float lastIncidenceAngle=(float)(this.gcps.get(this.gcps.size() - 1).getAngle());
    setIncidenceNear(firstIncidenceangle < lastIncidenceAngle ? firstIncidenceangle : lastIncidenceAngle);
    setIncidenceFar(firstIncidenceangle > lastIncidenceAngle ? firstIncidenceangle : lastIncidenceAngle);
  }
 catch (  TransformException|FactoryException|GeoTransformException ex) {
    logger.error(ex.getMessage(),ex);
  }
  return true;
}
Program: 175232
Project: 175232
Buggy source:
/** 
 * @return
 */
private Map<String,TIFF> getImages(){
  @SuppressWarnings("String_Node_Str") List<Object> elements=doc.getRootElement().getChild("String_Node_Str").getChildren("String_Node_Str");
  Map<String,TIFF> tiffs=new HashMap<String,TIFF>();
  bands=new Vector<String>();
  for (  Object o : elements) {
    if (o instanceof Element) {
      StringBuilder f=new StringBuilder(productxml.getParent()).append("String_Node_Str").append(((Element)o).getChild("String_Node_Str").getChild("String_Node_Str").getChild("String_Node_Str").getText()).append("String_Node_Str").append(((Element)o).getChild("String_Node_Str").getChild("String_Node_Str").getChild("String_Node_Str").getText());
      String polarisation=((Element)o).getChild("String_Node_Str").getValue();
      tiffs.put(polarisation,new TIFF(new File(f.toString()),0));
      bands.add(polarisation);
    }
  }
  return tiffs;
}

Fixed version (ground truth):
/** 
 * @return
 */
private Map<String,TIFF> getImages(){
  @SuppressWarnings("String_Node_Str") List<Object> elements=doc.getRootElement().getChild("String_Node_Str").getChildren("String_Node_Str");
  Map<String,TIFF> tiffs=new HashMap<String,TIFF>();
  bands=new Vector<String>();
  for (  Object o : elements) {
    if (o instanceof Element) {
      StringBuilder f=new StringBuilder(productxml.getParent()).append("String_Node_Str").append(((Element)o).getChild("String_Node_Str").getChild("String_Node_Str").getChild("String_Node_Str").getText()).append("String_Node_Str").append(((Element)o).getChild("String_Node_Str").getChild("String_Node_Str").getChild("String_Node_Str").getText());
      String polarisation=((Element)o).getChild("String_Node_Str").getValue();
      TIFF t=new TIFF(new File(f.toString()),0);
      t.setxSize(getMetaWidth());
      t.setySize(getMetaHeight());
      tiffs.put(polarisation,t);
      bands.add(polarisation);
    }
  }
  return tiffs;
}
Program: 175233
Project: 175233
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;
    double r[];
    try {
      r=gc.geoFromPixel(4756,2655);
      System.out.println("String_Node_Str" + r[1] + "String_Node_Str"+ r[0]);
      r=gc.pixelFromGeo(9.6081,40.9034);
      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=61.77994;
    double lon=-65.66427;
    double r[];
    try {
      r=gc.pixelFromGeo(lon,lat);
      System.out.println("String_Node_Str" + r[1] + "String_Node_Str"+ r[0]);
    }
 catch (    GeoLocationException e) {
      e.printStackTrace();
    }
  }
 catch (  MathException e1) {
    e1.printStackTrace();
  }
}
Program: 175236
Project: 175236
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;
    double r[];
    try {
      r=gc.geoFromPixel(4756,2655);
      System.out.println("String_Node_Str" + r[1] + "String_Node_Str"+ r[0]);
      r=gc.pixelFromGeo(9.6081,40.9034);
      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=61.77994;
    double lon=-65.66427;
    double r[];
    try {
      r=gc.pixelFromGeo(lon,lat);
      System.out.println("String_Node_Str" + r[1] + "String_Node_Str"+ r[0]);
    }
 catch (    GeoLocationException e) {
      e.printStackTrace();
    }
  }
 catch (  MathException e1) {
    e1.printStackTrace();
  }
}
Program: 175241
Project: 175241
Buggy source:
@RequiresPermissions(value="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.GET) @ResponseBody public JsonResult<String> getInputType(){
  JsonObject listObject=new JsonObject();
  JsonArray jsonArray=new JsonArray();
  for (  FieldInputType fieldInputType : FieldInputType.values()) {
    JsonObject jsonObject=new JsonObject();
    jsonObject.addProperty("String_Node_Str",fieldInputType.getKey());
    jsonObject.addProperty("String_Node_Str",fieldInputType.getDesc());
    jsonArray.add(jsonObject);
  }
  listObject.add("String_Node_Str",jsonArray);
  return JsonResult.success(listObject.toString());
}

Fixed version (ground truth):
@RequiresPermissions(value="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.GET) @ResponseBody public JsonResult<String> getInputType(){
  JsonObject listObject=new JsonObject();
  JsonArray jsonArray=new JsonArray();
  for (  FieldInputType fieldInputType : FieldInputType.values()) {
    JsonObject jsonObject=new JsonObject();
    jsonObject.addProperty("String_Node_Str",fieldInputType.name());
    jsonObject.addProperty("String_Node_Str",fieldInputType.getDesc());
    jsonArray.add(jsonObject);
  }
  listObject.add("String_Node_Str",jsonArray);
  return JsonResult.success(listObject.toString());
}
Program: 175242
Project: 175242
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions("String_Node_Str") public JsonResult<PaginationResult<FieldPo>> fieldList(HttpSession session,@RequestBody Integer columnId){
  Search search=SearchHelper.getSearchParam(URI,session);
  PaginationResult<FieldPo> paginationResult=fieldService.getFieldListByColumnId(search,columnId);
  return JsonResult.success(paginationResult);
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions("String_Node_Str") public JsonResult<PaginationResult<FieldPo>> fieldList(HttpSession session,@RequestBody Integer tabId){
  Search search=SearchHelper.getSearchParam(URI,session);
  PaginationResult<FieldPo> paginationResult=fieldService.getFieldListByTabId(search,tabId);
  return JsonResult.success(paginationResult);
}
Program: 175243
Project: 175243
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<OrgBo> saveForUpdated(@Validated @RequestBody OrgBo orgBo){
  UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
  if (orgBo.getId() == null) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  orgService.save(orgBo);
  return get(orgBo.getId());
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<OrgBo> saveForUpdated(@Validated @RequestBody OrgBo orgBo){
  UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
  if (orgBo.getId() == null) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  if (orgService.getOrgByNo(orgBo.getNo()).getId() != orgBo.getId()) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  orgService.save(orgBo);
  return get(orgBo.getId());
}
Program: 175244
Project: 175244
Buggy source:
private static String parse(String all){
  String comment=null;
  int index=all.indexOf("String_Node_Str");
  if (index < 0) {
    return "String_Node_Str";
  }
  comment=all.substring(index + 9);
  comment=comment.substring(0,comment.length() - 1);
  try {
    comment=new String(comment.getBytes("String_Node_Str"));
  }
 catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
  }
  return comment;
}

Fixed version (ground truth):
private static String parse(String all){
  String comment=null;
  int index=all.indexOf("String_Node_Str");
  if (index < 0) {
    return "String_Node_Str";
  }
  comment=all.substring(index + 9);
  comment=comment.substring(0,comment.length() - 1);
  try {
    comment=new String(comment.getBytes("String_Node_Str"),"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
  }
  return comment;
}
Program: 175245
Project: 175245
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<TableMetaDataBo> getTableInfo(String tableName){
  TableMetaDataBo tableMetaDataBo=tableService.getTableDescription(tableName);
  return JsonResult.success(tableMetaDataBo);
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<TableMetaDataBo> getTableInfo(String tableName,HttpSession session){
  UserResource userResource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
  if (tableName == null && tableName.equals("String_Node_Str")) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),userResource.getMessage("String_Node_Str"));
  }
  if (tableService.findExistTableByName(tableName)) {
    TableMetaDataBo tableMetaDataBo=tableService.getTableDescription(tableName);
    return JsonResult.success(tableMetaDataBo);
  }
 else {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),userResource.getMessage("String_Node_Str"));
  }
}
Program: 175246
Project: 175246
Buggy source:
/** 
 * @param languageBo
 * @return
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<LanguageBo> saveForUpdated(@RequestBody LanguageBo languageBo){
  UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
  if (languageBo.getCode() == null || languageBo.getCode().isEmpty()) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  languageService.save(languageBo);
  return get(languageBo.getCode());
}

Fixed version (ground truth):
/** 
 * @param languageBo
 * @return
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<LanguageBo> saveForUpdated(@RequestBody LanguageBo languageBo){
  UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
  if (languageBo.getCode() == null || languageBo.getCode().isEmpty()) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  if (languageService.findExistLanguageByName(languageBo.getName())) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  languageService.save(languageBo);
  return get(languageBo.getCode());
}
Program: 175247
Project: 175247
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<LanguageBo> saveForCreated(@RequestBody LanguageBo languageBo){
  UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
  if (languageService.findExistLanguage(languageBo.getCode())) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  languageService.save(languageBo);
  return get(languageBo.getCode());
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<LanguageBo> saveForCreated(@RequestBody LanguageBo languageBo){
  UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
  if (languageService.findExistLanguage(languageBo.getCode())) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  if (languageService.findExistLanguageByName(languageBo.getName())) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  languageService.save(languageBo);
  return get(languageBo.getCode());
}
Program: 175248
Project: 175248
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<RoleBo> saveForUpdated(@RequestBody RoleBo roleBo,HttpSession session){
  UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
  if (roleService.findExistRole(roleBo.getName())) {
    RoleBo role=roleService.getRoleBo(roleBo.getId());
    role.setIsactive(roleBo.getIsactive());
    role.setRoleOrgAccessBoList(roleBo.getRoleOrgAccessBoList());
    role.setModuleRoleBoList(roleBo.getModuleRoleBoList());
    role.setRemark(roleBo.getRemark());
    roleService.save(role);
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  roleService.save(roleBo);
  return get(roleBo.getId(),session);
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<RoleBo> saveForUpdated(@RequestBody RoleBo roleBo,HttpSession session){
  UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
  if (roleService.findExistRole(roleBo.getName())) {
    if (roleService.findExistRoleByName(roleBo.getName()).getId() == roleBo.getId()) {
      roleService.save(roleBo);
    }
 else {
      return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
    }
  }
 else {
    roleService.save(roleBo);
  }
  return get(roleBo.getId(),session);
}
Program: 175249
Project: 175249
Buggy source:
/** 
 * @param clientBo
 * @return
 */
@RequiresPermissions("String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public JsonResult<ClientBo> saveForCreate(@Validated @RequestBody ClientBo clientBo){
  if (clientService.findExistClient(clientBo.getNo())) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),getMessage("String_Node_Str"));
  }
  clientService.save(clientBo);
  return get(clientBo.getId());
}

Fixed version (ground truth):
/** 
 * @param clientBo
 * @return
 */
@RequiresPermissions("String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public JsonResult<ClientBo> saveForCreate(@Validated @RequestBody ClientBo clientBo){
  if (clientService.findExistClient(clientBo.getNo())) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),getMessage("String_Node_Str"));
  }
  if (clientService.findExistClientByName(clientBo.getName())) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),getMessage("String_Node_Str"));
  }
  clientService.save(clientBo);
  return get(clientBo.getId());
}
Program: 175250
Project: 175250
Buggy source:
@RequiresPermissions("String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public JsonResult<ClientBo> saveForUpdate(@Validated @RequestBody ClientBo clientBo){
  if (clientBo.getId() == null) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),getMessage("String_Node_Str"));
  }
  clientService.save(clientBo);
  return get(clientBo.getId());
}

Fixed version (ground truth):
@RequiresPermissions("String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public JsonResult<ClientBo> saveForUpdate(@Validated @RequestBody ClientBo clientBo){
  if (clientBo.getId() == null) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),getMessage("String_Node_Str"));
  }
  if (clientService.findExistClientByName(clientBo.getName())) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),getMessage("String_Node_Str"));
  }
  clientService.save(clientBo);
  return get(clientBo.getId());
}
Program: 175251
Project: 175251
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<SearchBo> saveForUpdated(@RequestBody @Validated SearchBo searchBo,HttpSession session){
  UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
  if (searchBo.getId() == null) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  searchBo=searchService.saveSearchBo(searchBo);
  return get(searchBo.getId());
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<SearchBo> saveForUpdated(@RequestBody @Validated SearchBo searchBo,HttpSession session){
  UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
  if (searchBo.getId() == null) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  if (searchService.getSearchBoByUri(searchBo.getUri()) != null) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  searchBo=searchService.saveSearchBo(searchBo);
  return get(searchBo.getId());
}
Program: 175252
Project: 175252
Buggy source:
/** 
 * @param searchBo
 * @return
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<SearchBo> saveForCreated(@RequestBody @Validated SearchBo searchBo){
  searchBo=searchService.saveSearchBo(searchBo);
  return get(searchBo.getId());
}

Fixed version (ground truth):
/** 
 * @param searchBo
 * @return
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<SearchBo> saveForCreated(@RequestBody @Validated SearchBo searchBo,HttpSession session){
  UserResource userResource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
  if (searchService.getSearchBoByUri(searchBo.getUri()) != null) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),userResource.getMessage("String_Node_Str"));
  }
  searchBo=searchService.saveSearchBo(searchBo);
  return get(searchBo.getId());
}
Program: 175253
Project: 175253
Buggy source:
boolean findExistClientByName(String clientName);

Fixed version (ground truth):
ClientBo findExistClientByName(String clientName);
Program: 175254
Project: 175254
Buggy source:
@Override public boolean findExistClientByName(String clientName){
  Search search=new Search();
  search.addFilterEqual("String_Node_Str",clientName);
  List<ClientPo> clientPoList=clientDao.search(search);
  if (clientPoList != null && clientPoList.size() > 0) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public ClientBo findExistClientByName(String clientName){
  Search search=new Search();
  search.addFilterEqual("String_Node_Str",clientName);
  ClientPo clientPo=clientDao.searchUnique(search);
  ClientBo clientBo=modelMapper.map(clientPo,ClientBo.class);
  return clientBo;
}
Program: 175255
Project: 175255
Buggy source:
boolean findExistLanguageByName(String languageName);

Fixed version (ground truth):
LanguageBo findExistLanguageByName(String languageName);
Program: 175256
Project: 175256
Buggy source:
@Override public boolean findExistLanguageByName(String languageName){
  Search search=new Search();
  search.addFilterEqual("String_Node_Str",languageName);
  List<LanguagePo> languagePoList=languageDao.search(search);
  if (languagePoList != null && languagePoList.size() > 0) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public LanguageBo findExistLanguageByName(String languageName){
  Search search=new Search();
  search.addFilterEqual("String_Node_Str",languageName);
  LanguagePo languagePo=languageDao.searchUnique(search);
  LanguageBo languageBo=modelMapper.map(languagePo,LanguageBo.class);
  return languageBo;
}
Program: 175257
Project: 175257
Buggy source:
/** 
 * @param clientBo
 * @return
 */
@RequiresPermissions("String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public JsonResult<ClientBo> saveForCreate(@Validated @RequestBody ClientBo clientBo){
  if (clientService.findExistClient(clientBo.getNo())) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),getMessage("String_Node_Str"));
  }
  if (clientService.findExistClientByName(clientBo.getName())) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),getMessage("String_Node_Str"));
  }
  clientService.save(clientBo);
  return get(clientBo.getId());
}

Fixed version (ground truth):
/** 
 * @param clientBo
 * @return
 */
@RequiresPermissions("String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public JsonResult<ClientBo> saveForCreate(@Validated @RequestBody ClientBo clientBo){
  if (clientService.findExistClient(clientBo.getNo())) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),getMessage("String_Node_Str"));
  }
  if (clientService.findExistClientName(clientBo.getName())) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),getMessage("String_Node_Str"));
  }
  clientService.save(clientBo);
  return get(clientBo.getId());
}
Program: 175258
Project: 175258
Buggy source:
@RequiresPermissions("String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public JsonResult<ClientBo> saveForUpdate(@Validated @RequestBody ClientBo clientBo){
  if (clientBo.getId() == null) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),getMessage("String_Node_Str"));
  }
  if (clientService.findExistClientByName(clientBo.getName())) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),getMessage("String_Node_Str"));
  }
  clientService.save(clientBo);
  return get(clientBo.getId());
}

Fixed version (ground truth):
@RequiresPermissions("String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public JsonResult<ClientBo> saveForUpdate(@Validated @RequestBody ClientBo clientBo){
  if (clientBo.getId() == null) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),getMessage("String_Node_Str"));
  }
  if (clientService.findExistClientName(clientBo.getName())) {
    if (clientService.findExistClientByName(clientBo.getName()).getId() == clientBo.getId()) {
      clientService.save(clientBo);
    }
 else {
      return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),getMessage("String_Node_Str"));
    }
  }
 else {
    clientService.save(clientBo);
  }
  return get(clientBo.getId());
}