Program: 11184
Project: 11184
Buggy source:
private void openDataset(File file){
  fileOpen=file != null;
  if (!fileOpen) {
    infoText.setText("String_Node_Str");
    gdalFileField.setText("String_Node_Str");
    mapnikFileField.setText("String_Node_Str");
    previewCanvas.setIcon(null);
    bandCount=0;
    dataset=null;
    sector=null;
    mapFile=null;
  }
 else {
    try {
      gdalFileField.setText(file.getAbsolutePath());
      mapnikFileField.setText(file.getAbsolutePath());
      if (gdalRadio.isSelected()) {
        final Dataset dataset=GDALUtil.open(file);
        final Sector sector=GDALUtil.getSector(dataset);
        this.sector=sector;
        this.dataset=dataset;
        final int width=dataset.getRasterXSize();
        final int height=dataset.getRasterYSize();
        if (sector.getMinLongitude() == 0 && sector.getMinLatitude() == 0 && sector.getMaxLongitude() == width && sector.getMaxLatitude() == height) {
          throw new TilerException("String_Node_Str" + file + "String_Node_Str");
        }
        bandCount=dataset.getRasterCount();
        if (bandCount == 0) {
          throw new TilerException("String_Node_Str");
        }
        String projection=dataset.GetProjection();
        SpatialReference spatialReference=(projection == null || projection.length() == 0 || !GDALUtil.isProjectionsSupported()) ? null : new SpatialReference(projection);
        String[] dataTypes=new String[bandCount];
        int[] dataTypeSizes=new int[bandCount];
        for (int i=0; i < bandCount; i++) {
          Band band=dataset.GetRasterBand(i + 1);
          int dataType=band.getDataType();
          dataTypes[i]=gdal.GetDataTypeName(dataType);
          dataTypeSizes[i]=gdal.GetDataTypeSize(dataType);
        }
        StringBuilder info=new StringBuilder();
        info.append("String_Node_Str");
        info.append("String_Node_Str" + width + "String_Node_Str"+ height+ "String_Node_Str");
        info.append("String_Node_Str" + (sector.getDeltaLongitude() / width) + "String_Node_Str"+ (sector.getDeltaLatitude() / height)+ "String_Node_Str");
        info.append("String_Node_Str" + sector.getMinLongitude() + "String_Node_Str"+ sector.getMinLatitude()+ "String_Node_Str");
        info.append("String_Node_Str" + sector.getMaxLongitude() + "String_Node_Str"+ sector.getMaxLatitude()+ "String_Node_Str");
        info.append("String_Node_Str" + bandCount + "String_Node_Str");
        for (int i=0; i < bandCount; i++) {
          info.append("String_Node_Str" + (i + 1) + "String_Node_Str"+ dataTypes[i]+ "String_Node_Str"+ dataTypeSizes[i]+ "String_Node_Str");
        }
        if (spatialReference != null) {
          info.append("String_Node_Str");
          info.append(spatialReference.ExportToPrettyWkt() + "String_Node_Str");
        }
        String text=info.substring(0,info.length() - 1);
        infoText.setText(text);
        infoText.select(0,0);
        Thread thread=new Thread(new Runnable(){
          public void run(){
            logger.fine("String_Node_Str");
            try {
              int w=400;
              int h=w;
              if (width > height) {
                h=w * height / width;
              }
 else {
                w=h * width / height;
              }
              GDALTile tile=new GDALTile(dataset,w,h,sector.getMinLatitude(),sector.getMinLongitude(),sector.getMaxLatitude(),sector.getMaxLongitude());
              BufferedImage image=tile.getAsImage();
              ImageIcon icon=new ImageIcon(image);
              previewCanvas.setIcon(icon);
              logger.fine("String_Node_Str");
            }
 catch (            Exception e) {
              logger.warning(e.getMessage());
            }
          }
        }
);
        thread.setDaemon(true);
        thread.start();
      }
 else {
        infoText.setText("String_Node_Str");
        this.bandCount=0;
        this.mapFile=file;
        Sector sect=MapnikUtil.getSector(mapFile);
        if (sect == null) {
          sect=Sector.FULL_SPHERE;
          logger.warning("String_Node_Str");
        }
        this.sector=sect;
        minLatitudeField.setValue(sect.getMinLatitude());
        minLongitudeField.setValue(sect.getMinLongitude());
        maxLatitudeField.setValue(sect.getMaxLatitude());
        maxLongitudeField.setValue(sect.getMaxLongitude());
        Thread thread=new Thread(new Runnable(){
          public void run(){
            logger.fine("String_Node_Str");
            try {
              File dst=File.createTempFile("String_Node_Str","String_Node_Str");
              dst.deleteOnExit();
              MapnikUtil.tile(sector,previewCanvas.getWidth(),previewCanvas.getHeight(),mapFile,dst,logger);
              BufferedImage image=ImageIO.read(dst);
              ImageIcon icon=new ImageIcon(image);
              previewCanvas.setIcon(icon);
              logger.fine("String_Node_Str");
            }
 catch (            Exception e) {
              logger.warning(e.toString());
            }
          }
        }
);
        thread.setDaemon(true);
        thread.start();
      }
      logger.info("String_Node_Str" + file + "String_Node_Str");
    }
 catch (    Exception e) {
      logger.severe(e.getMessage());
      openDataset(null);
      return;
    }
  }
  bandCountChanged();
  tileTypeChanged();
  imageFormatChanged();
  recalculateTiles();
  frame.doLayout();
}

Fixed version (ground truth):
private void openDataset(File file){
  fileOpen=file != null;
  if (!fileOpen) {
    infoText.setText("String_Node_Str");
    gdalFileField.setText("String_Node_Str");
    mapnikFileField.setText("String_Node_Str");
    previewCanvas.setIcon(null);
    bandCount=0;
    dataset=null;
    sector=null;
    mapFile=null;
  }
 else {
    try {
      gdalFileField.setText(file.getAbsolutePath());
      mapnikFileField.setText(file.getAbsolutePath());
      if (gdalRadio.isSelected()) {
        final Dataset dataset=GDALUtil.open(file);
        final Sector sector=GDALUtil.getSector(dataset);
        this.sector=sector;
        this.dataset=dataset;
        final int width=dataset.getRasterXSize();
        final int height=dataset.getRasterYSize();
        if (sector.getMinLongitude() == 0 && sector.getMinLatitude() == 0 && sector.getMaxLongitude() == width && sector.getMaxLatitude() == height) {
          throw new TilerException("String_Node_Str" + file + "String_Node_Str");
        }
        bandCount=dataset.getRasterCount();
        if (bandCount == 0) {
          throw new TilerException("String_Node_Str");
        }
        String projection=dataset.GetProjection();
        SpatialReference spatialReference=(projection == null || projection.length() == 0 || !GDALUtil.isProjectionsSupported()) ? null : new SpatialReference(projection);
        String[] dataTypes=new String[bandCount];
        int[] dataTypeSizes=new int[bandCount];
        Double[] nodata=new Double[bandCount];
        for (int i=0; i < bandCount; i++) {
          Band band=dataset.GetRasterBand(i + 1);
          int dataType=band.getDataType();
          dataTypes[i]=gdal.GetDataTypeName(dataType);
          dataTypeSizes[i]=gdal.GetDataTypeSize(dataType);
          Double[] nodataValue=new Double[1];
          band.GetNoDataValue(nodataValue);
          nodata[i]=nodataValue[0];
        }
        StringBuilder info=new StringBuilder();
        info.append("String_Node_Str");
        info.append("String_Node_Str" + width + "String_Node_Str"+ height+ "String_Node_Str");
        info.append("String_Node_Str" + (sector.getDeltaLongitude() / width) + "String_Node_Str"+ (sector.getDeltaLatitude() / height)+ "String_Node_Str");
        info.append("String_Node_Str" + sector.getMinLongitude() + "String_Node_Str"+ sector.getMinLatitude()+ "String_Node_Str");
        info.append("String_Node_Str" + sector.getMaxLongitude() + "String_Node_Str"+ sector.getMaxLatitude()+ "String_Node_Str");
        info.append("String_Node_Str" + bandCount + "String_Node_Str");
        for (int i=0; i < bandCount; i++) {
          info.append("String_Node_Str" + (i + 1) + "String_Node_Str"+ dataTypes[i]+ "String_Node_Str"+ dataTypeSizes[i]+ "String_Node_Str"+ nodata[i]+ "String_Node_Str");
        }
        if (spatialReference != null) {
          info.append("String_Node_Str");
          info.append(spatialReference.ExportToPrettyWkt() + "String_Node_Str");
        }
        String text=info.substring(0,info.length() - 1);
        infoText.setText(text);
        infoText.select(0,0);
        Thread thread=new Thread(new Runnable(){
          public void run(){
            logger.fine("String_Node_Str");
            try {
              int w=400;
              int h=w;
              if (width > height) {
                h=w * height / width;
              }
 else {
                w=h * width / height;
              }
              GDALTile tile=new GDALTile(dataset,w,h,sector.getMinLatitude(),sector.getMinLongitude(),sector.getMaxLatitude(),sector.getMaxLongitude());
              BufferedImage image=tile.getAsImage();
              ImageIcon icon=new ImageIcon(image);
              previewCanvas.setIcon(icon);
              logger.fine("String_Node_Str");
            }
 catch (            Exception e) {
              logger.warning(e.getMessage());
            }
          }
        }
);
        thread.setDaemon(true);
        thread.start();
      }
 else {
        infoText.setText("String_Node_Str");
        this.bandCount=0;
        this.mapFile=file;
        Sector sect=MapnikUtil.getSector(mapFile);
        if (sect == null) {
          sect=Sector.FULL_SPHERE;
          logger.warning("String_Node_Str");
        }
        this.sector=sect;
        minLatitudeField.setValue(sect.getMinLatitude());
        minLongitudeField.setValue(sect.getMinLongitude());
        maxLatitudeField.setValue(sect.getMaxLatitude());
        maxLongitudeField.setValue(sect.getMaxLongitude());
        Thread thread=new Thread(new Runnable(){
          public void run(){
            logger.fine("String_Node_Str");
            try {
              File dst=File.createTempFile("String_Node_Str","String_Node_Str");
              dst.deleteOnExit();
              MapnikUtil.tile(sector,previewCanvas.getWidth(),previewCanvas.getHeight(),mapFile,dst,logger);
              BufferedImage image=ImageIO.read(dst);
              ImageIcon icon=new ImageIcon(image);
              previewCanvas.setIcon(icon);
              logger.fine("String_Node_Str");
            }
 catch (            Exception e) {
              logger.warning(e.toString());
            }
          }
        }
);
        thread.setDaemon(true);
        thread.start();
      }
      logger.info("String_Node_Str" + file + "String_Node_Str");
    }
 catch (    Exception e) {
      logger.severe(e.getMessage());
      openDataset(null);
      return;
    }
  }
  bandCountChanged();
  tileTypeChanged();
  imageFormatChanged();
  recalculateTiles();
  frame.doLayout();
}