Program: 174930
Project: 174930
Buggy source:
/** 
 * @param gLayer
 * @param projection
 * @param gir
 * @param thresholds
 * @param buffer
 * @param enl
 * @param landmask
 */
public static void saveNewXML(File output,ComplexEditVDSVectorLayer layer,String projection,SarImageReader gir,float[] thresholds,int buffer,float enl,String landmask,String runVersion,Integer runVersionNumber){
  SimpleDateFormat format=new SimpleDateFormat("String_Node_Str");
  String start=gir.getTimeStampStart();
  start=start.replace("String_Node_Str","String_Node_Str");
  Timestamp tStart=Timestamp.valueOf(start);
  start=roundedMillis(start);
  String stop=gir.getTimeStampStop();
  stop=stop.replace("String_Node_Str","String_Node_Str");
  stop=roundedMillis(stop);
  VdsAnalysis vdsA=new VdsAnalysis();
  vdsA.setAlgorithm("String_Node_Str");
  vdsA.setBuffer(buffer);
  vdsA.setDetectorVersion("String_Node_Str");
  double enlround=Precision.round(enl,2);
  StringBuilder params=new StringBuilder("String_Node_Str").append(enlround).append("String_Node_Str");
  if (thresholds != null && thresholds.length > 0) {
    String th=Arrays.toString(thresholds);
    th=th.substring(1,th.length() - 1);
    params=params.append(th).append("String_Node_Str");
  }
  vdsA.setParameters(params.toString());
  vdsA.setRunTime(format.format(new Date()));
  vdsA.setRunVersion(runVersion);
  vdsA.setRunVersionNum(runVersionNumber);
  vdsA.setLandMaskRead(landmask);
  List<Geometry> ambiguity=new ArrayList<>();
  Additionalgeometries amb=layer.getGeometriesByTag(ComplexEditVDSVectorLayer.AZIMUTH_AMBIGUITY_TAG);
  if (amb != null)   ambiguity=amb.getGeometries();
  Additionalgeometries art=layer.getGeometriesByTag(ComplexEditVDSVectorLayer.ARTEFACTS_AMBIGUITY_TAG);
  List<Geometry> ambiguityArt=new ArrayList<>();
  if (art != null)   ambiguityArt=art.getGeometries();
  int targetNumber=0;
  VdsTarget target=new VdsTarget();
  List<Geometry> gg=layer.getGeometriclayer().getGeometries();
  vdsA.setNrDetections(gg.size());
  for (  Geometry geom : gg) {
    AttributesGeometry att=layer.getGeometriclayer().getAttributes(geom);
    Boat b=new Boat();
    targetNumber++;
    b.setTargetNumber(targetNumber);
    try {
      double[] pos=gir.getGeoTransform().getGeoFromPixel(geom.getCoordinate().x,geom.getCoordinate().y);
      b.setLat(Precision.round(pos[1],6));
      b.setLon(Precision.round(pos[0],6));
    }
 catch (    GeoTransformException e) {
      logger.warn(e);
    }
    double incAngle=gir.getIncidence((int)geom.getCoordinate().x);
    incAngle=Math.toDegrees(incAngle);
    b.setIncAng(Precision.round(incAngle,3));
    b.setXpixel(Precision.round(geom.getCoordinate().x,0));
    b.setYpixel(Precision.round(geom.getCoordinate().y,0));
    b.setDetecttime(format.format(tStart));
    if (ambiguity.contains(geom) || ambiguityArt.contains(geom)) {
      b.setReliability(3);
      if (ambiguity.contains(geom))       b.setFalseAlarmCause("String_Node_Str");
 else       b.setFalseAlarmCause("String_Node_Str");
    }
 else {
      b.setReliability(0);
    }
    int[] max=(int[])att.get(VDSSchema.MAXIMUM_VALUE);
    if (max != null) {
      String s=StringUtils.join(max,',');
      b.setMaxValue(s);
    }
    if (att.get(VDSSchema.ESTIMATED_LENGTH) != null) {
      double lenght=Precision.round((Double)att.get(VDSSchema.ESTIMATED_LENGTH),1);
      b.setLength(lenght);
      b.setWidth(Precision.round((Double)att.get(VDSSchema.ESTIMATED_WIDTH),1));
      b.setSizeClass("String_Node_Str");
      if (lenght > 70 && lenght <= 120)       b.setSizeClass("String_Node_Str");
 else       if (lenght > 120)       b.setSizeClass("String_Node_Str");
    }
    if (att.get(VDSSchema.NUMBER_OF_AGGREGATED_PIXELS) != null)     b.setNrPixels(((Double)att.get(VDSSchema.NUMBER_OF_AGGREGATED_PIXELS)).intValue());
    if (att.get(VDSSchema.ESTIMATED_HEADING) != null)     b.setHeadingNorth(Precision.round((Double)att.get(VDSSchema.ESTIMATED_HEADING),2,BigDecimal.ROUND_FLOOR));
    if (att.get(VDSSchema.SIGNIFICANCE) != null) {
      double[] significance=(double[])att.get(VDSSchema.SIGNIFICANCE);
      if (significance != null)       b.setSignificance(StringUtils.join(significance,','));
    }
    if (att.get(VDSSchema.THRESHOLD) != null) {
      double[] trhtile=(double[])att.get(VDSSchema.THRESHOLD);
      if (trhtile != null)       b.setThresholdTile(StringUtils.join(trhtile,','));
    }
    target.getBoat().add(b);
  }
  SatImageMetadata imageMeta=new SatImageMetadata();
  try {
    imageMeta.setGcps(getCorners(gir));
    imageMeta.setTimestampStart(tStart.toString());
    imageMeta.setTimeStart(format.format(tStart));
    Timestamp tStop=Timestamp.valueOf(stop);
    imageMeta.setTimeStop(format.format(tStop));
    String sensor=gir.getSensor();
    format=new SimpleDateFormat("String_Node_Str");
    String imId=sensor + "String_Node_Str" + format.format(tStart);
    imageMeta.setImId(imId);
    imageMeta.setImageName(((SarImageReader)gir).getImgName());
    imageMeta.setSensor(sensor);
    String pol=gir.getPolarization();
    imageMeta.setPol(pol.trim());
    String polNumeric=pol.replace("String_Node_Str","String_Node_Str");
    polNumeric=polNumeric.replace("String_Node_Str","String_Node_Str");
    polNumeric=polNumeric.replace("String_Node_Str","String_Node_Str");
    polNumeric=polNumeric.replace("String_Node_Str","String_Node_Str");
    if (polNumeric.endsWith("String_Node_Str"))     polNumeric=polNumeric.substring(0,polNumeric.length() - 1);
    polNumeric=polNumeric.replace("String_Node_Str","String_Node_Str").trim();
    imageMeta.setPolnumeric(polNumeric);
  }
 catch (  Exception e) {
    logger.error(e);
  }
  Analysis an=new Analysis();
  an.setSatImageMetadata(imageMeta);
  an.setVdsAnalysis(vdsA);
  an.setVdsTarget(target);
  try {
    javax.xml.bind.JAXBContext jaxbCtx=javax.xml.bind.JAXBContext.newInstance("String_Node_Str");
    OutputStream os=new FileOutputStream(output);
    javax.xml.bind.Marshaller marshaller=jaxbCtx.createMarshaller();
    marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING,"String_Node_Str");
    marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT,Boolean.TRUE);
    marshaller.marshal(an,os);
    os.close();
  }
 catch (  javax.xml.bind.JAXBException|IOException ex) {
    logger.error(ex.getMessage(),ex);
  }
}

Fixed version (ground truth):
/** 
 * @param gLayer
 * @param projection
 * @param gir
 * @param thresholds
 * @param buffer
 * @param enl
 * @param landmask
 */
public static void saveNewXML(File output,ComplexEditVDSVectorLayer layer,String projection,SarImageReader gir,float[] thresholds,int buffer,float enl,String landmask,String runVersion,Integer runVersionNumber){
  SimpleDateFormat format=new SimpleDateFormat("String_Node_Str");
  String start=gir.getTimeStampStart();
  start=start.replace("String_Node_Str","String_Node_Str");
  Timestamp tStart=Timestamp.valueOf(start);
  start=roundedMillis(start);
  String stop=gir.getTimeStampStop();
  stop=stop.replace("String_Node_Str","String_Node_Str");
  stop=roundedMillis(stop);
  VdsAnalysis vdsA=new VdsAnalysis();
  vdsA.setAlgorithm("String_Node_Str");
  vdsA.setBuffer(buffer);
  vdsA.setDetectorVersion("String_Node_Str");
  double enlround=Precision.round(enl,2);
  StringBuilder params=new StringBuilder("String_Node_Str").append(enlround).append("String_Node_Str");
  if (thresholds != null && thresholds.length > 0) {
    String th=Arrays.toString(thresholds);
    th=th.substring(1,th.length() - 1);
    params=params.append(th).append("String_Node_Str");
  }
  vdsA.setParameters(params.toString());
  vdsA.setRunTime(format.format(new Date()));
  vdsA.setRunVersion(runVersion);
  vdsA.setRunVersionNum(runVersionNumber);
  vdsA.setLandMaskRead(landmask);
  List<Geometry> ambiguity=new ArrayList<>();
  Additionalgeometries amb=layer.getGeometriesByTag(ComplexEditVDSVectorLayer.AZIMUTH_AMBIGUITY_TAG);
  if (amb != null)   ambiguity=amb.getGeometries();
  Additionalgeometries art=layer.getGeometriesByTag(ComplexEditVDSVectorLayer.ARTEFACTS_AMBIGUITY_TAG);
  List<Geometry> ambiguityArt=new ArrayList<>();
  if (art != null)   ambiguityArt=art.getGeometries();
  int targetNumber=0;
  VdsTarget target=new VdsTarget();
  List<Geometry> gg=layer.getGeometriclayer().getGeometries();
  vdsA.setNrDetections(gg.size());
  for (  Geometry geom : gg) {
    AttributesGeometry att=layer.getGeometriclayer().getAttributes(geom);
    Boat b=new Boat();
    targetNumber++;
    b.setTargetNumber(targetNumber);
    try {
      double[] pos=gir.getGeoTransform().getGeoFromPixel(geom.getCoordinate().x,geom.getCoordinate().y);
      b.setLat(Precision.round(pos[1],6));
      b.setLon(Precision.round(pos[0],6));
    }
 catch (    GeoTransformException e) {
      logger.warn(e);
    }
    double incAngle=gir.getIncidence((int)geom.getCoordinate().x);
    incAngle=Math.toDegrees(incAngle);
    b.setIncAng(Precision.round(incAngle,3));
    b.setXpixel(Precision.round(geom.getCoordinate().x,0));
    b.setYpixel(Precision.round(geom.getCoordinate().y,0));
    b.setDetecttime(format.format(tStart));
    if (ambiguity.contains(geom) || ambiguityArt.contains(geom)) {
      b.setReliability(3);
      if (ambiguity.contains(geom))       b.setFalseAlarmCause("String_Node_Str");
 else       b.setFalseAlarmCause("String_Node_Str");
    }
 else {
      b.setReliability(0);
    }
    int[] max=(int[])att.get(VDSSchema.MAXIMUM_VALUE);
    if (max != null) {
      String s=StringUtils.join(max,',');
      b.setMaxValue(s);
    }
    if (att.get(VDSSchema.ESTIMATED_LENGTH) != null) {
      double lenght=Precision.round((Double)att.get(VDSSchema.ESTIMATED_LENGTH),1);
      b.setLength(lenght);
      b.setWidth(Precision.round((Double)att.get(VDSSchema.ESTIMATED_WIDTH),1));
      b.setSizeClass("String_Node_Str");
      if (lenght > 70 && lenght <= 120)       b.setSizeClass("String_Node_Str");
 else       if (lenght > 120)       b.setSizeClass("String_Node_Str");
    }
    if (att.get(VDSSchema.NUMBER_OF_AGGREGATED_PIXELS) != null)     b.setNrPixels(((Double)att.get(VDSSchema.NUMBER_OF_AGGREGATED_PIXELS)).intValue());
    if (att.get(VDSSchema.ESTIMATED_HEADING) != null)     b.setHeadingRange(Precision.round((Double)att.get(VDSSchema.ESTIMATED_HEADING),2,BigDecimal.ROUND_FLOOR) - 90);
    b.setHeadingNorth(0);
    if (att.get(VDSSchema.SIGNIFICANCE) != null) {
      double[] significance=(double[])att.get(VDSSchema.SIGNIFICANCE);
      if (significance != null)       b.setSignificance(StringUtils.join(significance,','));
    }
    if (att.get(VDSSchema.THRESHOLD) != null) {
      double[] trhtile=(double[])att.get(VDSSchema.THRESHOLD);
      if (trhtile != null)       b.setThresholdTile(StringUtils.join(trhtile,','));
    }
    target.getBoat().add(b);
  }
  SatImageMetadata imageMeta=new SatImageMetadata();
  try {
    imageMeta.setGcps(getCorners(gir));
    imageMeta.setTimestampStart(tStart.toString());
    imageMeta.setTimeStart(format.format(tStart));
    Timestamp tStop=Timestamp.valueOf(stop);
    imageMeta.setTimeStop(format.format(tStop));
    String sensor=gir.getSensor();
    format=new SimpleDateFormat("String_Node_Str");
    String imId=sensor + "String_Node_Str" + format.format(tStart);
    imageMeta.setImId(imId);
    imageMeta.setImageName(((SarImageReader)gir).getImgName());
    imageMeta.setSensor(sensor);
    String pol=gir.getPolarization();
    imageMeta.setPol(pol.trim());
    String polNumeric=pol.replace("String_Node_Str","String_Node_Str");
    polNumeric=polNumeric.replace("String_Node_Str","String_Node_Str");
    polNumeric=polNumeric.replace("String_Node_Str","String_Node_Str");
    polNumeric=polNumeric.replace("String_Node_Str","String_Node_Str");
    if (polNumeric.endsWith("String_Node_Str"))     polNumeric=polNumeric.substring(0,polNumeric.length() - 1);
    polNumeric=polNumeric.replace("String_Node_Str","String_Node_Str").trim();
    imageMeta.setPolnumeric(polNumeric);
  }
 catch (  Exception e) {
    logger.error(e);
  }
  Analysis an=new Analysis();
  an.setSatImageMetadata(imageMeta);
  an.setVdsAnalysis(vdsA);
  an.setVdsTarget(target);
  try {
    javax.xml.bind.JAXBContext jaxbCtx=javax.xml.bind.JAXBContext.newInstance("String_Node_Str");
    OutputStream os=new FileOutputStream(output);
    javax.xml.bind.Marshaller marshaller=jaxbCtx.createMarshaller();
    marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING,"String_Node_Str");
    marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT,Boolean.TRUE);
    marshaller.marshal(an,os);
    os.close();
  }
 catch (  javax.xml.bind.JAXBException|IOException ex) {
    logger.error(ex.getMessage(),ex);
  }
}