Program: 11414
Project: 11414
Buggy source:
private synchronized void defineDEM() throws IOException {
  if (demDefined)   return;
  Resampling resampling=Resampling.BILINEAR_INTERPOLATION;
  final ElevationModelRegistry elevationModelRegistry;
  final ElevationModelDescriptor demDescriptor;
  if (externalDEMFile == null) {
    elevationModelRegistry=ElevationModelRegistry.getInstance();
    demDescriptor=elevationModelRegistry.getDescriptor(demName);
    if (demDescriptor == null) {
      throw new OperatorException("String_Node_Str" + demName + "String_Node_Str");
    }
    dem=demDescriptor.createDem(resampling);
    if (dem == null) {
      throw new OperatorException("String_Node_Str" + demName + "String_Node_Str");
    }
    demNoDataValue=demDescriptor.getNoDataValue();
    demSamplingLat=demDescriptor.getTileWidthInDegrees() * (1.0f / demDescriptor.getTileWidth()) * Constants.DTOR;
    demSamplingLon=demSamplingLat;
  }
  if (externalDEMFile != null) {
    dem=new FileElevationModel(externalDEMFile,resampling.getName(),externalDEMNoDataValue);
    demName=externalDEMFile.getPath();
    demNoDataValue=externalDEMNoDataValue;
    try {
      demSamplingLat=(dem.getGeoPos(new PixelPos(1,0)).getLat() - dem.getGeoPos(new PixelPos(0,0)).getLat()) * Constants.DTOR;
      demSamplingLon=(dem.getGeoPos(new PixelPos(0,1)).getLat() - dem.getGeoPos(new PixelPos(0,0)).getLat()) * Constants.DTOR;
    }
 catch (    Exception e) {
      throw new OperatorException("String_Node_Str" + demName + "String_Node_Str");
    }
  }
  if (outputElevationBand) {
    Band elevBand=targetProduct.getBand("String_Node_Str");
    if (elevBand != null) {
      elevBand.setNoDataValue(demNoDataValue);
    }
  }
  demDefined=true;
}

Fixed version (ground truth):
private synchronized void defineDEM() throws IOException {
  if (demDefined)   return;
  Resampling resampling=Resampling.BILINEAR_INTERPOLATION;
  final ElevationModelRegistry elevationModelRegistry;
  final ElevationModelDescriptor demDescriptor;
  if (externalDEMFile == null) {
    elevationModelRegistry=ElevationModelRegistry.getInstance();
    demDescriptor=elevationModelRegistry.getDescriptor(demName);
    if (demDescriptor == null) {
      throw new OperatorException("String_Node_Str" + demName + "String_Node_Str");
    }
    dem=demDescriptor.createDem(resampling);
    if (dem == null) {
      throw new OperatorException("String_Node_Str" + demName + "String_Node_Str");
    }
    demNoDataValue=demDescriptor.getNoDataValue();
    demSamplingLat=demDescriptor.getTileWidthInDegrees() * (1.0f / demDescriptor.getTileWidth()) * Constants.DTOR;
    demSamplingLon=demSamplingLat;
  }
  if (externalDEMFile != null) {
    dem=new FileElevationModel(externalDEMFile,resampling.getName(),externalDEMNoDataValue);
    demName=externalDEMFile.getPath();
    demNoDataValue=externalDEMNoDataValue;
    try {
      demSamplingLat=(dem.getGeoPos(new PixelPos(0,1)).getLat() - dem.getGeoPos(new PixelPos(0,0)).getLat()) * Constants.DTOR;
      demSamplingLon=(dem.getGeoPos(new PixelPos(1,0)).getLon() - dem.getGeoPos(new PixelPos(0,0)).getLon()) * Constants.DTOR;
    }
 catch (    Exception e) {
      throw new OperatorException("String_Node_Str" + demName + "String_Node_Str");
    }
  }
  if (outputElevationBand) {
    Band elevBand=targetProduct.getBand("String_Node_Str");
    if (elevBand != null) {
      elevBand.setNoDataValue(demNoDataValue);
    }
  }
  demDefined=true;
}