Program: 11402
Project: 11402
Buggy source:
/** 
 * Add user selected bands to target product.
 */
private void addSelectedBands(){
  final Band[] sourceBands=OperatorUtils.getSourceBands(sourceProduct,sourceBandNames,true);
  final MetadataElement absRoot=AbstractMetadata.getAbstractedMetadata(sourceProduct);
  String gamma0BandName, sigma0BandName=null;
  String tgtUnit;
  for (  final Band srcBand : sourceBands) {
    final String srcBandName=srcBand.getName();
    boolean valid=false;
    for (    String validPrefix : BAND_PREFIX) {
      if (srcBandName.startsWith(validPrefix)) {
        valid=true;
        break;
      }
    }
    if (!valid) {
      continue;
    }
    if (isPolSar) {
      if (targetProduct.getBand(srcBandName) == null) {
        Band tgtBand=targetProduct.addBand(srcBandName,ProductData.TYPE_FLOAT32);
        tgtBand.setUnit(srcBand.getUnit());
        tgtBand.setNoDataValue(srcBand.getNoDataValue());
        tgtBand.setNoDataValueUsed(srcBand.isNoDataValueUsed());
        tgtBand.setDescription(srcBand.getDescription());
        targetBandToSourceBandMap.put(tgtBand,srcBand);
      }
    }
 else {
      final String unit=srcBand.getUnit();
      if (unit == null) {
        throw new OperatorException("String_Node_Str" + srcBandName + "String_Node_Str");
      }
      if (unit.contains(Unit.DB)) {
        throw new OperatorException("String_Node_Str");
      }
 else       if (unit.contains(Unit.PHASE)) {
        continue;
      }
 else       if (unit.contains(Unit.REAL) || unit.contains(Unit.IMAGINARY)) {
        gamma0BandName="String_Node_Str" + srcBandName;
        tgtUnit=unit;
        if (outputSigma0) {
          sigma0BandName="String_Node_Str" + srcBandName;
        }
      }
 else {
        final String pol=OperatorUtils.getBandPolarization(srcBandName,absRoot);
        gamma0BandName="String_Node_Str";
        sigma0BandName="String_Node_Str";
        if (pol != null && !pol.isEmpty()) {
          gamma0BandName="String_Node_Str" + pol.toUpperCase();
          sigma0BandName="String_Node_Str" + pol.toUpperCase();
        }
        tgtUnit=Unit.INTENSITY;
      }
      if (targetProduct.getBand(gamma0BandName) == null) {
        Band tgtBand=targetProduct.addBand(gamma0BandName,ProductData.TYPE_FLOAT32);
        tgtBand.setUnit(tgtUnit);
        targetBandToSourceBandMap.put(tgtBand,srcBand);
      }
      if (outputSigma0 && targetProduct.getBand(sigma0BandName) == null) {
        Band tgtBand=targetProduct.addBand(sigma0BandName,ProductData.TYPE_FLOAT32);
        tgtBand.setUnit(tgtUnit);
        targetBandToSourceBandMap.put(tgtBand,srcBand);
      }
    }
  }
  if (targetProduct.getNumBands() == 0) {
    throw new OperatorException("String_Node_Str");
  }
  if (outputSimulatedImage) {
    Band tgtBand=targetProduct.addBand("String_Node_Str",ProductData.TYPE_FLOAT32);
    tgtBand.setUnit("String_Node_Str");
  }
  targetBands=targetProduct.getBands();
  if (!isPolSar) {
    for (int i=0; i < targetBands.length; ++i) {
      if (targetBands[i].getUnit().equals(Unit.REAL)) {
        final String trgBandName=targetBands[i].getName();
        final int idx=trgBandName.indexOf("String_Node_Str");
        String suffix="String_Node_Str";
        if (idx != -1) {
          suffix=trgBandName.substring(trgBandName.indexOf("String_Node_Str"));
        }
        ReaderUtils.createVirtualIntensityBand(targetProduct,targetBands[i],targetBands[i + 1],"String_Node_Str",suffix);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Add user selected bands to target product.
 */
private void addSelectedBands(){
  final Band[] sourceBands=OperatorUtils.getSourceBands(sourceProduct,sourceBandNames,true);
  final MetadataElement absRoot=AbstractMetadata.getAbstractedMetadata(sourceProduct);
  String gamma0BandName, sigma0BandName=null;
  String tgtUnit;
  for (  final Band srcBand : sourceBands) {
    final String srcBandName=srcBand.getName();
    boolean valid=false;
    for (    String validPrefix : BAND_PREFIX) {
      if (srcBandName.startsWith(validPrefix)) {
        valid=true;
        break;
      }
    }
    if (!valid) {
      continue;
    }
    if (isPolSar) {
      if (targetProduct.getBand(srcBandName) == null) {
        Band tgtBand=targetProduct.addBand(srcBandName,ProductData.TYPE_FLOAT32);
        tgtBand.setUnit(srcBand.getUnit());
        tgtBand.setNoDataValue(srcBand.getNoDataValue());
        tgtBand.setNoDataValueUsed(srcBand.isNoDataValueUsed());
        tgtBand.setDescription(srcBand.getDescription());
        targetBandToSourceBandMap.put(tgtBand,srcBand);
      }
    }
 else {
      final String unit=srcBand.getUnit();
      if (unit == null) {
        throw new OperatorException("String_Node_Str" + srcBandName + "String_Node_Str");
      }
      if (unit.contains(Unit.DB)) {
        throw new OperatorException("String_Node_Str");
      }
 else       if (unit.contains(Unit.PHASE)) {
        continue;
      }
 else       if (unit.contains(Unit.REAL) || unit.contains(Unit.IMAGINARY)) {
        gamma0BandName="String_Node_Str" + srcBandName;
        tgtUnit=unit;
        if (outputSigma0) {
          sigma0BandName="String_Node_Str" + srcBandName;
        }
      }
 else {
        gamma0BandName=srcBandName.replaceFirst("String_Node_Str","String_Node_Str");
        sigma0BandName=srcBandName.replaceFirst("String_Node_Str","String_Node_Str");
        tgtUnit=Unit.INTENSITY;
      }
      if (targetProduct.getBand(gamma0BandName) == null) {
        Band tgtBand=targetProduct.addBand(gamma0BandName,ProductData.TYPE_FLOAT32);
        tgtBand.setUnit(tgtUnit);
        targetBandToSourceBandMap.put(tgtBand,srcBand);
      }
      if (outputSigma0 && targetProduct.getBand(sigma0BandName) == null) {
        Band tgtBand=targetProduct.addBand(sigma0BandName,ProductData.TYPE_FLOAT32);
        tgtBand.setUnit(tgtUnit);
        targetBandToSourceBandMap.put(tgtBand,srcBand);
      }
    }
  }
  if (targetProduct.getNumBands() == 0) {
    throw new OperatorException("String_Node_Str");
  }
  if (outputSimulatedImage) {
    Band tgtBand=targetProduct.addBand("String_Node_Str",ProductData.TYPE_FLOAT32);
    tgtBand.setUnit("String_Node_Str");
  }
  targetBands=targetProduct.getBands();
  if (!isPolSar) {
    for (int i=0; i < targetBands.length; ++i) {
      if (targetBands[i].getUnit().equals(Unit.REAL)) {
        final String trgBandName=targetBands[i].getName();
        final int idx=trgBandName.indexOf("String_Node_Str");
        String suffix="String_Node_Str";
        if (idx != -1) {
          suffix=trgBandName.substring(trgBandName.indexOf("String_Node_Str"));
        }
        ReaderUtils.createVirtualIntensityBand(targetProduct,targetBands[i],targetBands[i + 1],"String_Node_Str",suffix);
      }
    }
  }
}