Program: 11423
Project: 11423
Buggy source:
private void computeExtendedAmount(final int x0,final int y0,final int w,final int h,final double[] extendedAmount) throws Exception {
  final GeoPos geoPos=new GeoPos();
  final PositionData posData=new PositionData();
  double azExtendedAmountMax=-Double.MAX_VALUE;
  double azExtendedAmountMin=Double.MAX_VALUE;
  double rgExtendedAmountMax=-Double.MAX_VALUE;
  double rgExtendedAmountMin=Double.MAX_VALUE;
  for (int y=y0; y < y0 + h; y+=20) {
    final int burstIndex=getBurstIndex(y);
    for (int x=x0; x < x0 + w; x+=20) {
      final double azTime=getAzimuthTime(y,burstIndex);
      final double rgTime=getSlantRangeTime(x);
      final double lat=mSU.getLatitude(azTime,rgTime,subSwathIndex);
      final double lon=mSU.getLongitude(azTime,rgTime,subSwathIndex);
      geoPos.setLocation(lat,lon);
      final double alt=dem.getElevation(geoPos);
      if (alt == demNoDataValue) {
        continue;
      }
      GeoUtils.geo2xyzWGS84(geoPos.getLat(),geoPos.getLon(),alt,posData.earthPoint);
      if (getPosition(subSwathIndex,burstIndex,mSU,mOrbit,posData)) {
        double azExtendedAmount=posData.azimuthIndex - y;
        double rgExtendedAmount=posData.rangeIndex - x;
        if (azExtendedAmount > azExtendedAmountMax) {
          azExtendedAmountMax=azExtendedAmount;
        }
        if (azExtendedAmount < azExtendedAmountMin) {
          azExtendedAmountMin=azExtendedAmount;
        }
        if (rgExtendedAmount > rgExtendedAmountMax) {
          rgExtendedAmountMax=rgExtendedAmount;
        }
        if (rgExtendedAmount < rgExtendedAmountMin) {
          rgExtendedAmountMin=rgExtendedAmount;
        }
      }
    }
  }
  if (azExtendedAmountMin != Double.MAX_VALUE && azExtendedAmountMin < 0.0) {
    extendedAmount[0]=azExtendedAmountMin;
  }
 else {
    extendedAmount[0]=0.0;
  }
  if (azExtendedAmountMax != -Double.MAX_VALUE && azExtendedAmountMax > 0.0) {
    extendedAmount[1]=azExtendedAmountMax;
  }
 else {
    extendedAmount[1]=0.0;
  }
  if (rgExtendedAmountMin != Double.MAX_VALUE && rgExtendedAmountMin < 0.0) {
    extendedAmount[2]=rgExtendedAmountMin;
  }
 else {
    extendedAmount[2]=0.0;
  }
  if (rgExtendedAmountMax != -Double.MAX_VALUE && rgExtendedAmountMax > 0.0) {
    extendedAmount[3]=rgExtendedAmountMax;
  }
 else {
    extendedAmount[3]=0.0;
  }
}

Fixed version (ground truth):
private void computeExtendedAmount(final int x0,final int y0,final int w,final int h,final double[] extendedAmount) throws Exception {
  final EarthGravitationalModel96 egm=EarthGravitationalModel96.instance();
  final GeoPos geoPos=new GeoPos();
  final PositionData posData=new PositionData();
  double azExtendedAmountMax=-Double.MAX_VALUE;
  double azExtendedAmountMin=Double.MAX_VALUE;
  double rgExtendedAmountMax=-Double.MAX_VALUE;
  double rgExtendedAmountMin=Double.MAX_VALUE;
  for (int y=y0; y < y0 + h; y+=20) {
    final int burstIndex=getBurstIndex(y);
    for (int x=x0; x < x0 + w; x+=20) {
      final double azTime=getAzimuthTime(y,burstIndex);
      final double rgTime=getSlantRangeTime(x);
      final double lat=mSU.getLatitude(azTime,rgTime,subSwathIndex);
      final double lon=mSU.getLongitude(azTime,rgTime,subSwathIndex);
      geoPos.setLocation(lat,lon);
      double alt=dem.getElevation(geoPos);
      if (alt == demNoDataValue) {
        alt=egm.getEGM(lat,lon);
      }
      GeoUtils.geo2xyzWGS84(geoPos.getLat(),geoPos.getLon(),alt,posData.earthPoint);
      if (getPosition(subSwathIndex,burstIndex,mSU,mOrbit,posData)) {
        double azExtendedAmount=posData.azimuthIndex - y;
        double rgExtendedAmount=posData.rangeIndex - x;
        if (azExtendedAmount > azExtendedAmountMax) {
          azExtendedAmountMax=azExtendedAmount;
        }
        if (azExtendedAmount < azExtendedAmountMin) {
          azExtendedAmountMin=azExtendedAmount;
        }
        if (rgExtendedAmount > rgExtendedAmountMax) {
          rgExtendedAmountMax=rgExtendedAmount;
        }
        if (rgExtendedAmount < rgExtendedAmountMin) {
          rgExtendedAmountMin=rgExtendedAmount;
        }
      }
    }
  }
  if (azExtendedAmountMin != Double.MAX_VALUE && azExtendedAmountMin < 0.0) {
    extendedAmount[0]=azExtendedAmountMin;
  }
 else {
    extendedAmount[0]=0.0;
  }
  if (azExtendedAmountMax != -Double.MAX_VALUE && azExtendedAmountMax > 0.0) {
    extendedAmount[1]=azExtendedAmountMax;
  }
 else {
    extendedAmount[1]=0.0;
  }
  if (rgExtendedAmountMin != Double.MAX_VALUE && rgExtendedAmountMin < 0.0) {
    extendedAmount[2]=rgExtendedAmountMin;
  }
 else {
    extendedAmount[2]=0.0;
  }
  if (rgExtendedAmountMax != -Double.MAX_VALUE && rgExtendedAmountMax > 0.0) {
    extendedAmount[3]=rgExtendedAmountMax;
  }
 else {
    extendedAmount[3]=0.0;
  }
}