Program: 11032
Project: 11032
Buggy source:
/** 
 * Calculate the sector of the given dataset.
 * @param dataset
 * @param performCoordinateTransformation Should the dataset extent coordinates be transformed to geographic coordinates (lat/lon)?
 * @return Sector of the dataset
 * @throws TilerException
 */
public static Sector getSector(Dataset dataset,boolean performCoordinateTransformation) throws TilerException {
  double[] geoTransformArray=new double[6];
  dataset.GetGeoTransform(geoTransformArray);
  if (geoTransformArray[0] == 0 && geoTransformArray[1] == 0 && geoTransformArray[2] == 0 && geoTransformArray[3] == 0 && geoTransformArray[4] == 0 && geoTransformArray[5] == 0) {
    throw new TilerException("String_Node_Str");
  }
  int width=dataset.getRasterXSize();
  int height=dataset.getRasterYSize();
  double minlon=geoTransformArray[0];
  double maxlat=geoTransformArray[3];
  double maxlon=geoTransformArray[0] + geoTransformArray[1] * width + geoTransformArray[2] * height;
  double minlat=geoTransformArray[3] + geoTransformArray[4] * width + geoTransformArray[5] * height;
  if (performCoordinateTransformation) {
    String projection=dataset.GetProjectionRef();
    if (projection != null && projection.length() > 0) {
      SpatialReference proj=new SpatialReference(projection);
      if (proj != null) {
        SpatialReference geog=proj.CloneGeogCS();
        if (geog != null) {
          CoordinateTransformation transform=new CoordinateTransformation(proj,geog);
          if (transform != null) {
            double[] transPoint=new double[3];
            transform.TransformPoint(transPoint,minlon,minlat,0);
            minlon=transPoint[0];
            minlat=transPoint[1];
            transform.TransformPoint(transPoint,maxlon,maxlat,0);
            maxlon=transPoint[0];
            maxlat=transPoint[1];
            transform.delete();
          }
          geog.delete();
        }
        proj.delete();
      }
    }
  }
  if (minlat > maxlat) {
    double temp=minlat;
    minlat=maxlat;
    maxlat=temp;
  }
  if (minlon > maxlon) {
    double temp=minlon;
    minlon=maxlon;
    maxlon=temp;
  }
  return new Sector(minlat,minlon,maxlat,maxlon);
}

Fixed version (ground truth):
/** 
 * Calculate the sector of the given dataset.
 * @param dataset
 * @param performCoordinateTransformation Should the dataset extent coordinates be transformed to geographic coordinates (lat/lon)?
 * @return Sector of the dataset
 * @throws TilerException
 */
public static Sector getSector(Dataset dataset,boolean performCoordinateTransformation) throws TilerException {
  double[] geoTransformArray=new double[6];
  dataset.GetGeoTransform(geoTransformArray);
  if (geoTransformArray[0] == 0 && geoTransformArray[1] == 0 && geoTransformArray[2] == 0 && geoTransformArray[3] == 0 && geoTransformArray[4] == 0 && geoTransformArray[5] == 0) {
    throw new TilerException("String_Node_Str");
  }
  int width=dataset.getRasterXSize();
  int height=dataset.getRasterYSize();
  double minlon=geoTransformArray[0];
  double maxlat=geoTransformArray[3];
  double maxlon=geoTransformArray[0] + geoTransformArray[1] * width + geoTransformArray[2] * height;
  double minlat=geoTransformArray[3] + geoTransformArray[4] * width + geoTransformArray[5] * height;
  if (performCoordinateTransformation) {
    String projection=dataset.GetProjectionRef();
    if (projection != null && projection.length() > 0) {
      SpatialReference proj=new SpatialReference(projection);
      if (proj != null) {
        SpatialReference geog=proj.CloneGeogCS();
        if (geog != null) {
          gdal.PushErrorHandler("String_Node_Str");
          CoordinateTransformation transform=new CoordinateTransformation(proj,geog);
          gdal.PopErrorHandler();
          if (gdal.GetLastErrorMsg().indexOf("String_Node_Str") != -1)           transform=null;
          if (transform != null) {
            double[] transPoint=new double[3];
            transform.TransformPoint(transPoint,minlon,minlat,0);
            minlon=transPoint[0];
            minlat=transPoint[1];
            transform.TransformPoint(transPoint,maxlon,maxlat,0);
            maxlon=transPoint[0];
            maxlat=transPoint[1];
            transform.delete();
          }
          geog.delete();
        }
        proj.delete();
      }
    }
  }
  if (minlat > maxlat) {
    double temp=minlat;
    minlat=maxlat;
    maxlat=temp;
  }
  if (minlon > maxlon) {
    double temp=minlon;
    minlon=maxlon;
    maxlon=temp;
  }
  return new Sector(minlat,minlon,maxlat,maxlon);
}