Program: 175136
Project: 175136
Buggy source:
/** 
 */
protected void saveResults(String imageName,IMask[] masks,SarImageReader reader){
  if (layerResults != null) {
    String outfolder=new StringBuilder(params.outputFolder).append(File.separator).append(imageName).toString();
    File folder=new File(outfolder);
    if (!folder.exists())     folder.mkdirs();
    File xmlOutFolder=null;
    xmlOutFolder=new File(params.xmlOutputFolder);
    if (!xmlOutFolder.exists())     xmlOutFolder.mkdirs();
    for (    ComplexEditVDSVectorLayer l : layerResults) {
      StringBuilder outfileName=new StringBuilder(outfolder).append(File.separator).append(reader.getImId()).append("String_Node_Str");
      if (l.getBand().equalsIgnoreCase("String_Node_Str")) {
        outfileName.append(l.getBand());
      }
 else {
        outfileName.append(reader.getBandName(Integer.valueOf(l.getBand())));
      }
      if (reader.isContainsMultipleImage() && reader instanceof CosmoSkymedImage) {
        outfileName=outfileName.append("String_Node_Str").append(((CosmoSkymedImage)reader).getGroup());
      }
      l.save(outfileName.toString() + "String_Node_Str",ComplexEditVDSVectorLayer.OPT_EXPORT_XML_SUMO_OLD,params.epsg);
      File outFile=new File(outfileName.toString() + "String_Node_Str");
      SumoXMLWriter.saveNewXML(outFile,l,params.epsg,reader,params.thresholdArrayValues,params.buffer,params.enl,params.shapeFile,runVersion,runVersionNumber);
      try {
        if (layerResults.size() == 1 || l.getBand().equals("String_Node_Str")) {
          FileUtils.copyFile(outFile,new File(params.xmlOutputFolder + "String_Node_Str" + reader.getImId()+ "String_Node_Str"));
        }
      }
 catch (      Exception e) {
        logger.error("String_Node_Str",e);
      }
      try {
        String bbox=outfolder + "String_Node_Str";
        List<Geometry> ggBbox=new ArrayList<Geometry>();
        try {
          ggBbox.add(reader.getBbox(PlatformConfiguration.getConfigurationInstance().getLandMaskMargin(0)));
          SimpleShapefile.exportGeometriesToShapeFile(ggBbox,new File(bbox),"String_Node_Str",null,null,null);
        }
 catch (        Exception e) {
          logger.error("String_Node_Str" + e.getLocalizedMessage(),e);
        }
        String bboxcsv=params.outputFolder + "String_Node_Str";
        GenericCSVIO.geomCsv(new File(bboxcsv),ggBbox,null,imageName,true);
      }
 catch (      Exception e) {
        logger.error("String_Node_Str" + imageName,e);
      }
      try {
        String targets=outfileName.append("String_Node_Str").toString();
        SimpleShapefile.exportGeometriesToShapeFile(l.getGeometriclayer().getGeometries(),new File(targets),"String_Node_Str",reader.getGeoTransform(),null,null);
      }
 catch (      Exception e) {
        logger.error("String_Node_Str" + e.getLocalizedMessage(),e);
      }
      if (l.getBand().equals("String_Node_Str") || layerResults.size() == 1) {
        try {
          String targetscsv=params.outputFolder + "String_Node_Str";
          List<Geometry> targets=new ArrayList<Geometry>(l.getGeometriclayer().getGeometries());
          List<Geometry> ambi=new ArrayList<>();
          if (l.getGeometriesByTag(ComplexEditVDSVectorLayer.AZIMUTH_AMBIGUITY_TAG) != null)           ambi.addAll(l.getGeometriesByTag(ComplexEditVDSVectorLayer.AZIMUTH_AMBIGUITY_TAG).getGeometries());
          if (l.getGeometriesByTag(ComplexEditVDSVectorLayer.ARTEFACTS_AMBIGUITY_TAG) != null)           ambi.addAll(l.getGeometriesByTag(ComplexEditVDSVectorLayer.ARTEFACTS_AMBIGUITY_TAG).getGeometries());
          if (!ambi.isEmpty()) {
            for (            Geometry geom : targets) {
              if (ambi.contains(geom)) {
                targets.remove(geom);
              }
            }
          }
          GenericCSVIO.geomCsv(new File(targetscsv),targets,null,imageName,true);
        }
 catch (        Exception e) {
          logger.error("String_Node_Str" + imageName,e);
        }
      }
    }
    try {
      String bbox=outfolder + "String_Node_Str";
      List<Geometry> ggBbox=new ArrayList<Geometry>();
      try {
        ggBbox.add(reader.getBbox(PlatformConfiguration.getConfigurationInstance().getLandMaskMargin(0)));
        SimpleShapefile.exportGeometriesToShapeFile(ggBbox,new File(bbox),"String_Node_Str",null,null,null);
      }
 catch (      Exception e) {
        logger.error("String_Node_Str" + e.getLocalizedMessage(),e);
      }
      String bboxcsv=params.outputFolder + "String_Node_Str";
      GenericCSVIO.geomCsv(new File(bboxcsv),ggBbox,null,imageName,true);
    }
 catch (    Exception e) {
      logger.error("String_Node_Str" + imageName,e);
    }
  }
}

Fixed version (ground truth):
/** 
 */
protected void saveResults(String imageName,IMask[] masks,SarImageReader reader){
  if (layerResults != null) {
    String outfolder=new StringBuilder(params.outputFolder).append(File.separator).append(imageName).toString();
    File folder=new File(outfolder);
    if (!folder.exists())     folder.mkdirs();
    File xmlOutFolder=null;
    xmlOutFolder=new File(params.xmlOutputFolder);
    if (!xmlOutFolder.exists())     xmlOutFolder.mkdirs();
    for (    ComplexEditVDSVectorLayer l : layerResults) {
      StringBuilder outfileName=new StringBuilder(outfolder).append(File.separator).append(reader.getImId()).append("String_Node_Str");
      if (l.getBand().equalsIgnoreCase("String_Node_Str")) {
        outfileName.append(l.getBand());
      }
 else {
        outfileName.append(reader.getBandName(Integer.valueOf(l.getBand())));
      }
      if (reader.isContainsMultipleImage() && reader instanceof CosmoSkymedImage) {
        outfileName=outfileName.append("String_Node_Str").append(((CosmoSkymedImage)reader).getGroup());
      }
      l.save(outfileName.toString() + "String_Node_Str",ComplexEditVDSVectorLayer.OPT_EXPORT_XML_SUMO_OLD,params.epsg);
      File outFile=new File(outfileName.toString() + "String_Node_Str");
      SumoXMLWriter.saveNewXML(outFile,l,params.epsg,reader,params.thresholdArrayValues,params.buffer,params.enl,params.shapeFile,runVersion,runVersionNumber);
      try {
        if (layerResults.size() == 1 || l.getBand().equals("String_Node_Str")) {
          FileUtils.copyFile(outFile,new File(params.xmlOutputFolder + "String_Node_Str" + reader.getImId()+ "String_Node_Str"));
        }
      }
 catch (      Exception e) {
        logger.error("String_Node_Str",e);
      }
      try {
        String bbox=outfolder + "String_Node_Str";
        List<Geometry> ggBbox=new ArrayList<Geometry>();
        try {
          ggBbox.add(reader.getBbox(PlatformConfiguration.getConfigurationInstance().getLandMaskMargin(0)));
          SimpleShapefile.exportGeometriesToShapeFile(ggBbox,new File(bbox),"String_Node_Str",reader.getGeoTransform(),null,null);
        }
 catch (        Exception e) {
          logger.error("String_Node_Str" + e.getLocalizedMessage(),e);
        }
        String bboxcsv=params.outputFolder + "String_Node_Str";
        GenericCSVIO.geomCsv(new File(bboxcsv),ggBbox,null,imageName,true);
      }
 catch (      Exception e) {
        logger.error("String_Node_Str" + imageName,e);
      }
      try {
        String targets=outfileName.append("String_Node_Str").toString();
        SimpleShapefile.exportGeometriesToShapeFile(l.getGeometriclayer().getGeometries(),new File(targets),"String_Node_Str",reader.getGeoTransform(),null,null);
      }
 catch (      Exception e) {
        logger.error("String_Node_Str" + e.getLocalizedMessage(),e);
      }
      if (l.getBand().equals("String_Node_Str") || layerResults.size() == 1) {
        try {
          String targetscsv=params.outputFolder + "String_Node_Str";
          List<Geometry> targets=new ArrayList<Geometry>(l.getGeometriclayer().getGeometries());
          List<Geometry> ambi=new ArrayList<>();
          if (l.getGeometriesByTag(ComplexEditVDSVectorLayer.AZIMUTH_AMBIGUITY_TAG) != null)           ambi.addAll(l.getGeometriesByTag(ComplexEditVDSVectorLayer.AZIMUTH_AMBIGUITY_TAG).getGeometries());
          if (l.getGeometriesByTag(ComplexEditVDSVectorLayer.ARTEFACTS_AMBIGUITY_TAG) != null)           ambi.addAll(l.getGeometriesByTag(ComplexEditVDSVectorLayer.ARTEFACTS_AMBIGUITY_TAG).getGeometries());
          List<Geometry> toRemove=new ArrayList<>();
          if (!ambi.isEmpty()) {
            for (            Geometry geom : targets) {
              if (ambi.contains(geom)) {
                toRemove.add(geom);
              }
            }
          }
          targets.removeAll(toRemove);
          GenericCSVIO.geomCsv(new File(targetscsv),targets,reader.getGeoTransform(),imageName,true);
        }
 catch (        Exception e) {
          logger.error("String_Node_Str" + imageName,e);
        }
      }
    }
    try {
      String bbox=outfolder + "String_Node_Str";
      List<Geometry> ggBbox=new ArrayList<Geometry>();
      try {
        ggBbox.add(reader.getBbox(PlatformConfiguration.getConfigurationInstance().getLandMaskMargin(0)));
        SimpleShapefile.exportGeometriesToShapeFile(ggBbox,new File(bbox),"String_Node_Str",null,null,null);
      }
 catch (      Exception e) {
        logger.error("String_Node_Str" + e.getLocalizedMessage(),e);
      }
      String bboxcsv=params.outputFolder + "String_Node_Str";
      GenericCSVIO.geomCsv(new File(bboxcsv),ggBbox,null,imageName,true);
    }
 catch (    Exception e) {
      logger.error("String_Node_Str" + imageName,e);
    }
  }
}