Program: 11510
Project: 11510
Buggy source:
private void addAbstractedMetadataHeader(Product product,MetadataElement root) throws IOException {
  final MetadataElement absRoot=AbstractMetadata.addAbstractedMetadataHeader(root);
  final String defStr=AbstractMetadata.NO_METADATA_STRING;
  final int defInt=AbstractMetadata.NO_METADATA;
  final MetadataElement globalElem=AbstractMetadata.addOriginalProductMetadata(product.getMetadataRoot()).getElement(NetcdfConstants.GLOBAL_ATTRIBUTES_NAME);
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.PRODUCT,globalElem.getAttributeString("String_Node_Str",defStr));
  final String productType=globalElem.getAttributeString("String_Node_Str",defStr);
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.PRODUCT_TYPE,productType);
  final String mode=globalElem.getAttributeString("String_Node_Str",defStr);
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.SPH_DESCRIPTOR,mode);
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.ACQUISITION_MODE,mode);
  if (mode.contains("String_Node_Str") && productType.contains("String_Node_Str")) {
    throw new IOException("String_Node_Str" + mode + "String_Node_Str");
  }
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.MISSION,globalElem.getAttributeString("String_Node_Str","String_Node_Str"));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.PROC_TIME,ReaderUtils.getTime(globalElem,"String_Node_Str",AbstractMetadata.dateFormat));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.ProcessingSystemIdentifier,globalElem.getAttributeString("String_Node_Str",defStr));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.antenna_pointing,globalElem.getAttributeString("String_Node_Str",defStr).toLowerCase());
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.ABS_ORBIT,globalElem.getAttributeInt("String_Node_Str",defInt));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.PASS,globalElem.getAttributeString("String_Node_Str",defStr));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.SAMPLE_TYPE,getSampleType(globalElem));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.num_output_lines,product.getSceneRasterHeight());
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.num_samples_per_line,product.getSceneRasterWidth());
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.TOT_SIZE,ReaderUtils.getTotalSize(product));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.radar_frequency,globalElem.getAttributeDouble("String_Node_Str",defInt) / Constants.oneMillion);
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.algorithm,globalElem.getAttributeString("String_Node_Str",defStr));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.geo_ref_system,globalElem.getAttributeString("String_Node_Str",defStr));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.range_looks,globalElem.getAttributeDouble("String_Node_Str",defInt));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.azimuth_looks,globalElem.getAttributeDouble("String_Node_Str",defInt));
  if (productType.contains("String_Node_Str")) {
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.map_projection,globalElem.getAttributeString("String_Node_Str",defStr));
  }
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.coregistered_stack,0);
  final String rngSpreadComp=globalElem.getAttributeString("String_Node_Str",defStr);
  if (rngSpreadComp.equals("String_Node_Str"))   AbstractMetadata.setAttribute(absRoot,AbstractMetadata.range_spread_comp_flag,0);
 else   AbstractMetadata.setAttribute(absRoot,AbstractMetadata.range_spread_comp_flag,1);
  final String incAngComp=globalElem.getAttributeString("String_Node_Str",defStr);
  if (incAngComp.equals("String_Node_Str"))   AbstractMetadata.setAttribute(absRoot,AbstractMetadata.inc_angle_comp_flag,0);
 else   AbstractMetadata.setAttribute(absRoot,AbstractMetadata.inc_angle_comp_flag,1);
  final String antElevComp=globalElem.getAttributeString("String_Node_Str",defStr);
  if (antElevComp.equals("String_Node_Str"))   AbstractMetadata.setAttribute(absRoot,AbstractMetadata.ant_elev_corr_flag,0);
 else   AbstractMetadata.setAttribute(absRoot,AbstractMetadata.ant_elev_corr_flag,1);
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.ref_inc_angle,globalElem.getAttributeDouble("String_Node_Str",defInt));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.ref_slant_range,globalElem.getAttributeDouble("String_Node_Str",defInt));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.ref_slant_range_exp,globalElem.getAttributeDouble("String_Node_Str",defInt));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.rescaling_factor,globalElem.getAttributeDouble("String_Node_Str",defInt));
  final MetadataElement s01Elem=globalElem.getElement("String_Node_Str");
  if (s01Elem != null) {
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.pulse_repetition_frequency,s01Elem.getAttributeDouble("String_Node_Str",defInt));
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.range_sampling_rate,s01Elem.getAttributeDouble("String_Node_Str",defInt) / Constants.oneMillion);
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.mds1_tx_rx_polar,s01Elem.getAttributeString("String_Node_Str",defStr));
    final double rangeBW=s01Elem.getAttributeDouble("String_Node_Str");
    final double azimuthBW=s01Elem.getAttributeDouble("String_Node_Str");
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.range_bandwidth,rangeBW / Constants.oneMillion);
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.azimuth_bandwidth,azimuthBW);
  }
  final MetadataElement s02Elem=globalElem.getElement("String_Node_Str");
  if (s02Elem != null) {
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.mds2_tx_rx_polar,s02Elem.getAttributeString("String_Node_Str",defStr));
  }
  if (isComplex) {
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.srgr_flag,0);
  }
 else {
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.srgr_flag,1);
  }
  addOrbitStateVectors(absRoot,globalElem);
}

Fixed version (ground truth):
private void addAbstractedMetadataHeader(Product product,MetadataElement root) throws IOException {
  final MetadataElement absRoot=AbstractMetadata.addAbstractedMetadataHeader(root);
  final String defStr=AbstractMetadata.NO_METADATA_STRING;
  final int defInt=AbstractMetadata.NO_METADATA;
  final MetadataElement globalElem=AbstractMetadata.addOriginalProductMetadata(product.getMetadataRoot()).getElement(NetcdfConstants.GLOBAL_ATTRIBUTES_NAME);
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.PRODUCT,globalElem.getAttributeString("String_Node_Str",defStr));
  final String productType=globalElem.getAttributeString("String_Node_Str",defStr);
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.PRODUCT_TYPE,productType);
  final String mode=globalElem.getAttributeString("String_Node_Str",defStr);
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.SPH_DESCRIPTOR,mode);
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.ACQUISITION_MODE,mode);
  if (mode.contains("String_Node_Str") && productType.contains("String_Node_Str")) {
    throw new IOException("String_Node_Str" + mode + "String_Node_Str");
  }
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.MISSION,"String_Node_Str");
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.PROC_TIME,ReaderUtils.getTime(globalElem,"String_Node_Str",AbstractMetadata.dateFormat));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.ProcessingSystemIdentifier,globalElem.getAttributeString("String_Node_Str",defStr));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.antenna_pointing,globalElem.getAttributeString("String_Node_Str",defStr).toLowerCase());
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.ABS_ORBIT,globalElem.getAttributeInt("String_Node_Str",defInt));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.PASS,globalElem.getAttributeString("String_Node_Str",defStr));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.SAMPLE_TYPE,getSampleType(globalElem));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.num_output_lines,product.getSceneRasterHeight());
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.num_samples_per_line,product.getSceneRasterWidth());
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.TOT_SIZE,ReaderUtils.getTotalSize(product));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.radar_frequency,globalElem.getAttributeDouble("String_Node_Str",defInt) / Constants.oneMillion);
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.algorithm,globalElem.getAttributeString("String_Node_Str",defStr));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.geo_ref_system,globalElem.getAttributeString("String_Node_Str",defStr));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.range_looks,globalElem.getAttributeDouble("String_Node_Str",defInt));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.azimuth_looks,globalElem.getAttributeDouble("String_Node_Str",defInt));
  if (productType.contains("String_Node_Str")) {
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.map_projection,globalElem.getAttributeString("String_Node_Str",defStr));
  }
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.coregistered_stack,0);
  final String rngSpreadComp=globalElem.getAttributeString("String_Node_Str",defStr);
  if (rngSpreadComp.equals("String_Node_Str"))   AbstractMetadata.setAttribute(absRoot,AbstractMetadata.range_spread_comp_flag,0);
 else   AbstractMetadata.setAttribute(absRoot,AbstractMetadata.range_spread_comp_flag,1);
  final String incAngComp=globalElem.getAttributeString("String_Node_Str",defStr);
  if (incAngComp.equals("String_Node_Str"))   AbstractMetadata.setAttribute(absRoot,AbstractMetadata.inc_angle_comp_flag,0);
 else   AbstractMetadata.setAttribute(absRoot,AbstractMetadata.inc_angle_comp_flag,1);
  final String antElevComp=globalElem.getAttributeString("String_Node_Str",defStr);
  if (antElevComp.equals("String_Node_Str"))   AbstractMetadata.setAttribute(absRoot,AbstractMetadata.ant_elev_corr_flag,0);
 else   AbstractMetadata.setAttribute(absRoot,AbstractMetadata.ant_elev_corr_flag,1);
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.ref_inc_angle,globalElem.getAttributeDouble("String_Node_Str",defInt));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.ref_slant_range,globalElem.getAttributeDouble("String_Node_Str",defInt));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.ref_slant_range_exp,globalElem.getAttributeDouble("String_Node_Str",defInt));
  AbstractMetadata.setAttribute(absRoot,AbstractMetadata.rescaling_factor,globalElem.getAttributeDouble("String_Node_Str",defInt));
  final MetadataElement s01Elem=globalElem.getElement("String_Node_Str");
  if (s01Elem != null) {
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.pulse_repetition_frequency,s01Elem.getAttributeDouble("String_Node_Str",defInt));
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.range_sampling_rate,s01Elem.getAttributeDouble("String_Node_Str",defInt) / Constants.oneMillion);
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.mds1_tx_rx_polar,s01Elem.getAttributeString("String_Node_Str",defStr));
    final double rangeBW=s01Elem.getAttributeDouble("String_Node_Str");
    final double azimuthBW=s01Elem.getAttributeDouble("String_Node_Str");
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.range_bandwidth,rangeBW / Constants.oneMillion);
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.azimuth_bandwidth,azimuthBW);
  }
 else {
    final String prefix="String_Node_Str";
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.pulse_repetition_frequency,globalElem.getAttributeDouble(prefix + "String_Node_Str",defInt));
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.range_sampling_rate,globalElem.getAttributeDouble(prefix + "String_Node_Str",defInt) / Constants.oneMillion);
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.mds1_tx_rx_polar,globalElem.getAttributeString(prefix + "String_Node_Str",defStr));
    final double rangeBW=globalElem.getAttributeDouble(prefix + "String_Node_Str");
    final double azimuthBW=globalElem.getAttributeDouble(prefix + "String_Node_Str");
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.range_bandwidth,rangeBW / Constants.oneMillion);
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.azimuth_bandwidth,azimuthBW);
  }
  final MetadataElement s02Elem=globalElem.getElement("String_Node_Str");
  if (s02Elem != null) {
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.mds2_tx_rx_polar,s02Elem.getAttributeString("String_Node_Str",defStr));
  }
 else {
    final String prefix="String_Node_Str";
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.mds2_tx_rx_polar,globalElem.getAttributeString(prefix + "String_Node_Str",defStr));
  }
  if (isComplex) {
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.srgr_flag,0);
  }
 else {
    AbstractMetadata.setAttribute(absRoot,AbstractMetadata.srgr_flag,1);
  }
  addOrbitStateVectors(absRoot,globalElem);
}