Program: 69948
Project: 69948
Buggy source:
private void processSelectionReportDesignHandle(ReportDesignHandle handle){
  if (handle == null) {
    previewCanvas.clear();
    description.setText("String_Node_Str");
    chkBox.setSelection(false);
    chkBox.setEnabled(false);
    setPageComplete(false);
    directionCombo.setEnabled(false);
    return;
  }
  directionCombo.setEnabled(true);
  String ReprotDescription=handle.getDescription();
  if (ReprotDescription != null && ReprotDescription.trim().length() != 0) {
    if (isPredifinedTemplate(handle.getFileName())) {
      description.setText(Messages.getString(ReprotDescription));
    }
 else {
      description.setText(ReprotDescription);
    }
  }
 else {
    description.setText("String_Node_Str");
  }
  previewPane.layout();
  String key=handle.getIconFile();
  if (key != null && key.trim().length() != 0 && checkExtensions(key) == false) {
    key=null;
  }
  Object img=null;
  if (handle.getThumbnail() != null && handle.getThumbnail().length != 0) {
    byte[] thumbnailData=handle.getThumbnail();
    ByteArrayInputStream inputStream=new ByteArrayInputStream(thumbnailData);
    if (thumbnailImage != null) {
      thumbnailImage.dispose();
      thumbnailImage=null;
    }
    thumbnailImage=new Image(null,inputStream);
    previewCanvas.clear();
    previewCanvas.loadImage(thumbnailImage);
  }
 else   if ((key != null) && (!"String_Node_Str".equals(key.trim()))) {
    URL url=getPreviewImageURL(handle.getFileName(),key);
    if (url != null) {
      try {
        key=FileLocator.resolve(url).getPath();
      }
 catch (      IOException e) {
        logger.log(Level.SEVERE,e.getMessage(),e);
      }
      img=imageMap.get(key);
      if (img == null) {
        try {
          url=new URL("String_Node_Str" + key);
          img=ImageManager.getInstance().loadImage(url);
        }
 catch (        IOException e) {
          logger.log(Level.SEVERE,e.getMessage(),e);
        }
        if (img != null) {
          imageMap.put(key,img);
        }
      }
      if (img != null) {
        previewCanvas.clear();
        previewCanvas.loadImage(((Image)img));
      }
    }
 else {
      key=null;
    }
  }
  if ((handle.getThumbnail() == null || handle.getThumbnail().length == 0) && key == null) {
    if (thumbnailImage != null) {
      thumbnailImage.dispose();
      thumbnailImage=null;
    }
    Rectangle rect=previewCanvas.getBounds();
    thumbnailImage=new Image(null,rect.width,rect.height);
    ReportGraphicsViewPainter painter=new ReportGraphicsViewPainter(handle);
    painter.paint(thumbnailImage,previewCanvas.getDisplay(),rect);
    painter.dispose();
    previewCanvas.clear();
    previewCanvas.loadImage(thumbnailImage);
  }
  if (handle.getCheatSheet() != null && handle.getCheatSheet().trim().length() != 0) {
    chkBox.setEnabled(!(handle.getCheatSheet().equals("String_Node_Str") || handle.getCheatSheet().equals("String_Node_Str")));
    chkBox.setSelection(true);
  }
 else {
    chkBox.setSelection(false);
    chkBox.setEnabled(false);
  }
  setPageComplete(true);
}

Fixed version (ground truth):
private void processSelectionReportDesignHandle(ReportDesignHandle handle){
  if (handle == null) {
    previewCanvas.clear();
    description.setText("String_Node_Str");
    chkBox.setSelection(false);
    chkBox.setEnabled(false);
    setPageComplete(false);
    if (directionCombo != null) {
      directionCombo.setEnabled(false);
    }
    return;
  }
  if (directionCombo != null) {
    directionCombo.setEnabled(true);
  }
  String ReprotDescription=handle.getDescription();
  if (ReprotDescription != null && ReprotDescription.trim().length() != 0) {
    if (isPredifinedTemplate(handle.getFileName())) {
      description.setText(Messages.getString(ReprotDescription));
    }
 else {
      description.setText(ReprotDescription);
    }
  }
 else {
    description.setText("String_Node_Str");
  }
  previewPane.layout();
  String key=handle.getIconFile();
  if (key != null && key.trim().length() != 0 && checkExtensions(key) == false) {
    key=null;
  }
  Object img=null;
  if (handle.getThumbnail() != null && handle.getThumbnail().length != 0) {
    byte[] thumbnailData=handle.getThumbnail();
    ByteArrayInputStream inputStream=new ByteArrayInputStream(thumbnailData);
    if (thumbnailImage != null) {
      thumbnailImage.dispose();
      thumbnailImage=null;
    }
    thumbnailImage=new Image(null,inputStream);
    previewCanvas.clear();
    previewCanvas.loadImage(thumbnailImage);
  }
 else   if ((key != null) && (!"String_Node_Str".equals(key.trim()))) {
    URL url=getPreviewImageURL(handle.getFileName(),key);
    if (url != null) {
      try {
        key=FileLocator.resolve(url).getPath();
      }
 catch (      IOException e) {
        logger.log(Level.SEVERE,e.getMessage(),e);
      }
      img=imageMap.get(key);
      if (img == null) {
        try {
          url=new URL("String_Node_Str" + key);
          img=ImageManager.getInstance().loadImage(url);
        }
 catch (        IOException e) {
          logger.log(Level.SEVERE,e.getMessage(),e);
        }
        if (img != null) {
          imageMap.put(key,img);
        }
      }
      if (img != null) {
        previewCanvas.clear();
        previewCanvas.loadImage(((Image)img));
      }
    }
 else {
      key=null;
    }
  }
  if ((handle.getThumbnail() == null || handle.getThumbnail().length == 0) && key == null) {
    if (thumbnailImage != null) {
      thumbnailImage.dispose();
      thumbnailImage=null;
    }
    Rectangle rect=previewCanvas.getBounds();
    thumbnailImage=new Image(null,rect.width,rect.height);
    ReportGraphicsViewPainter painter=new ReportGraphicsViewPainter(handle);
    painter.paint(thumbnailImage,previewCanvas.getDisplay(),rect);
    painter.dispose();
    previewCanvas.clear();
    previewCanvas.loadImage(thumbnailImage);
  }
  if (handle.getCheatSheet() != null && handle.getCheatSheet().trim().length() != 0) {
    chkBox.setEnabled(!(handle.getCheatSheet().equals("String_Node_Str") || handle.getCheatSheet().equals("String_Node_Str")));
    chkBox.setSelection(true);
  }
 else {
    chkBox.setSelection(false);
    chkBox.setEnabled(false);
  }
  setPageComplete(true);
}