nus-yam/ex-repair huggingface dataset:
Program: 70802
Project: 70802
Buggy source:
protected void updatePreview(Object handle){
  if (handle != null) {
    String familyValue=provider.getFontFamily(handle);
    int sizeValue=provider.getFontSize(handle);
    previewLabel.setFontFamily(familyValue);
    previewLabel.setFontSize(sizeValue);
    previewLabel.setBold(provider.isBold(handle));
    previewLabel.setItalic(provider.isItalic(handle));
    previewLabel.setForeground(provider.getColor(handle));
    previewLabel.setBackground(provider.getBackgroundColor(handle));
    previewLabel.setUnderline(provider.isUnderline(handle));
    previewLabel.setLinethrough(provider.isLinethrough(handle));
    previewLabel.setOverline(provider.isOverline(handle));
    previewLabel.updateView();
    if (provider.getBackgroundColor(handle) == null && isFormStyle()) {
      FormWidgetFactory.getInstance().paintFormStyle(previewLabel);
      FormWidgetFactory.getInstance().adapt(previewLabel);
    }
  }
 else {
    previewLabel.restoreDefaultState();
    previewLabel.setForeground(ColorManager.getColor(-1));
    previewLabel.setBackground(ColorManager.getColor(-1));
    previewLabel.updateView();
    if (isFormStyle()) {
      FormWidgetFactory.getInstance().paintFormStyle(previewLabel);
      FormWidgetFactory.getInstance().adapt(previewLabel);
    }
  }
}

Fixed version (ground truth):
protected void updatePreview(Object handle){
  if (handle != null && highlightProvider != null) {
    String familyValue=highlightProvider.getFontFamily(handle);
    int sizeValue=highlightProvider.getFontSize(handle);
    previewLabel.setFontFamily(familyValue);
    previewLabel.setFontSize(sizeValue);
    previewLabel.setBold(highlightProvider.isBold(handle));
    previewLabel.setItalic(highlightProvider.isItalic(handle));
    previewLabel.setForeground(highlightProvider.getColor(handle));
    previewLabel.setBackground(highlightProvider.getBackgroundColor(handle));
    previewLabel.setUnderline(highlightProvider.isUnderline(handle));
    previewLabel.setLinethrough(highlightProvider.isLinethrough(handle));
    previewLabel.setOverline(highlightProvider.isOverline(handle));
    previewLabel.updateView();
    if (highlightProvider.getBackgroundColor(handle) == null && isFormStyle()) {
      FormWidgetFactory.getInstance().paintFormStyle(previewLabel);
      FormWidgetFactory.getInstance().adapt(previewLabel);
    }
  }
 else {
    previewLabel.restoreDefaultState();
    previewLabel.setForeground(ColorManager.getColor(-1));
    previewLabel.setBackground(ColorManager.getColor(-1));
    previewLabel.updateView();
    if (isFormStyle()) {
      FormWidgetFactory.getInstance().paintFormStyle(previewLabel);
      FormWidgetFactory.getInstance().adapt(previewLabel);
    }
  }
}
Program: 70803
Project: 70803
Buggy source:
public void setDescriptorProvider(IDescriptorProvider provider){
  super.setDescriptorProvider(provider);
  if (provider instanceof HighlightDescriptorProvider)   this.provider=(HighlightDescriptorProvider)provider;
}

Fixed version (ground truth):
public void setDescriptorProvider(IDescriptorProvider provider){
  super.setDescriptorProvider(provider);
  if (provider instanceof HighlightDescriptorProvider)   this.highlightProvider=(HighlightDescriptorProvider)provider;
}
Program: 70804
Project: 70804
Buggy source:
protected void updatePreview(Object handle){
  if (handle != null) {
    previewLabel.setText(provider.getDisplayText(handle));
    previewLabel.updateView();
  }
 else {
    previewLabel.restoreDefaultState();
    previewLabel.setForeground(ColorManager.getColor(-1));
    previewLabel.setBackground(ColorManager.getColor(-1));
    previewLabel.setText("String_Node_Str");
    previewLabel.updateView();
    if (isFormStyle()) {
      FormWidgetFactory.getInstance().paintFormStyle(previewLabel);
      FormWidgetFactory.getInstance().adapt(previewLabel);
    }
  }
}

Fixed version (ground truth):
protected void updatePreview(Object handle){
  if (handle != null && mapProvider != null) {
    previewLabel.setText(mapProvider.getDisplayText(handle));
    previewLabel.updateView();
  }
 else {
    previewLabel.restoreDefaultState();
    previewLabel.setForeground(ColorManager.getColor(-1));
    previewLabel.setBackground(ColorManager.getColor(-1));
    previewLabel.setText("String_Node_Str");
    previewLabel.updateView();
    if (isFormStyle()) {
      FormWidgetFactory.getInstance().paintFormStyle(previewLabel);
      FormWidgetFactory.getInstance().adapt(previewLabel);
    }
  }
}
Program: 70805
Project: 70805
Buggy source:
public void setDescriptorProvider(IDescriptorProvider provider){
  super.setDescriptorProvider(provider);
  if (provider instanceof MapDescriptorProvider)   this.provider=(MapDescriptorProvider)provider;
}

Fixed version (ground truth):
public void setDescriptorProvider(IDescriptorProvider provider){
  super.setDescriptorProvider(provider);
  if (provider instanceof MapDescriptorProvider)   this.mapProvider=(MapDescriptorProvider)provider;
}
Program: 70806
Project: 70806
Buggy source:
public void load(){
  String value=marignProvider.load().toString();
  deMesurementValue=value;
  if (value == null) {
    valueCombo.deselectAll();
    valueCombo.setEnabled(false);
    unitCombo.deselectAll();
    unitCombo.setEnabled(false);
    return;
  }
  boolean stateFlag=((value == null) == valueCombo.getEnabled());
  if (stateFlag) {
    valueCombo.setEnabled(value != null);
    unitCombo.setEnabled(value != null);
  }
  if (marignProvider != null) {
    valueCombo.setItems(marignProvider.getValueItems());
    unitCombo.setItems(marignProvider.getUnitItems());
    String valueName=marignProvider.getValueName(value);
    if (valueName != null) {
      valueCombo.setText(valueName);
      deMesurementValue=valueName;
      unitCombo.deselectAll();
      unitCombo.setEnabled(false);
      return;
    }
    try {
      deUnitValue=marignProvider.getUnit();
    }
 catch (    Exception e) {
      ExceptionHandler.handle(e);
    }
    String unitName=marignProvider.getUnitName(deUnitValue);
    if (unitName != null) {
      unitCombo.setText(unitName);
      deUnitValue=unitName;
    }
    deMesurementValue=marignProvider.getMeasureValue();
    valueCombo.setText(deMesurementValue);
  }
}

Fixed version (ground truth):
public void load(){
  if (marignProvider != null) {
    String value=marignProvider.load().toString();
    deMesurementValue=value;
    if (value == null) {
      valueCombo.deselectAll();
      valueCombo.setEnabled(false);
      unitCombo.deselectAll();
      unitCombo.setEnabled(false);
      return;
    }
    boolean stateFlag=((value == null) == valueCombo.getEnabled());
    if (stateFlag) {
      valueCombo.setEnabled(value != null);
      unitCombo.setEnabled(value != null);
    }
    valueCombo.setItems(marignProvider.getValueItems());
    unitCombo.setItems(marignProvider.getUnitItems());
    String valueName=marignProvider.getValueName(value);
    if (valueName != null) {
      valueCombo.setText(valueName);
      deMesurementValue=valueName;
      unitCombo.deselectAll();
      unitCombo.setEnabled(false);
      return;
    }
    try {
      deUnitValue=marignProvider.getUnit();
    }
 catch (    Exception e) {
      ExceptionHandler.handle(e);
    }
    String unitName=marignProvider.getUnitName(deUnitValue);
    if (unitName != null) {
      unitCombo.setText(unitName);
      deUnitValue=unitName;
    }
    deMesurementValue=marignProvider.getMeasureValue();
    valueCombo.setText(deMesurementValue);
  }
}
Program: 70807
Project: 70807
Buggy source:
public void elementChanged(DesignElementHandle focus,NotificationEvent ev){
  if (fTableViewer.getContentProvider() == null) {
    return;
  }
  if (fTableViewer != null) {
    fTableViewer.setInput(input);
    refreshTableItemView();
  }
}

Fixed version (ground truth):
public void elementChanged(DesignElementHandle focus,NotificationEvent ev){
  if (fTableViewer != null) {
    if (fTableViewer.getContentProvider() == null) {
      return;
    }
    fTableViewer.setInput(input);
    refreshTableItemView();
  }
}
Program: 70808
Project: 70808
Buggy source:
protected boolean performInsert(Object model,SlotHandle slotHandle,String type,String position,Map extendData) throws Exception {
  if (type == ReportDesignConstants.CASCADING_PARAMETER_GROUP_ELEMENT) {
    DesignElementHandle handle=super.createElement(type);
    slotHandle.add(handle);
    CascadingParametersDialog dialog=new CascadingParametersDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),Messages.getString("String_Node_Str"));
    dialog.setInput(handle);
    return (dialog.open() == Dialog.OK);
  }
  return super.performInsert(model,slotHandle,type,position,extendData);
}

Fixed version (ground truth):
protected boolean performInsert(Object model,SlotHandle slotHandle,String type,String position,Map extendData) throws Exception {
  if (ReportDesignConstants.CASCADING_PARAMETER_GROUP_ELEMENT.equals(type)) {
    DesignElementHandle handle=super.createElement(type);
    slotHandle.add(handle);
    CascadingParametersDialog dialog=new CascadingParametersDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),Messages.getString("String_Node_Str"));
    dialog.setInput(handle);
    return (dialog.open() == Dialog.OK);
  }
  return super.performInsert(model,slotHandle,type,position,extendData);
}
Program: 70809
Project: 70809
Buggy source:
protected DesignElementHandle createElement(String type) throws Exception {
  DesignElementHandle handle=super.createElement(type);
  BaseDialog dialog=null;
  if (ReportDesignConstants.PARAMETER_GROUP_ELEMENT.equals(type)) {
    dialog=new ParameterGroupDialog(Display.getCurrent().getActiveShell(),Messages.getString("String_Node_Str"));
    ((ParameterGroupDialog)dialog).setInput(handle);
  }
 else   if (ReportDesignConstants.SCALAR_PARAMETER_ELEMENT.equals(type)) {
    dialog=new ParameterDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),Messages.getString("String_Node_Str"));
    ((ParameterDialog)dialog).setInput(handle);
  }
  if (dialog.open() == Dialog.CANCEL) {
    return null;
  }
  return (DesignElementHandle)dialog.getResult();
}

Fixed version (ground truth):
protected DesignElementHandle createElement(String type) throws Exception {
  DesignElementHandle handle=super.createElement(type);
  BaseDialog dialog=null;
  if (ReportDesignConstants.PARAMETER_GROUP_ELEMENT.equals(type)) {
    dialog=new ParameterGroupDialog(Display.getCurrent().getActiveShell(),Messages.getString("String_Node_Str"));
    ((ParameterGroupDialog)dialog).setInput(handle);
  }
 else   if (ReportDesignConstants.SCALAR_PARAMETER_ELEMENT.equals(type)) {
    dialog=new ParameterDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),Messages.getString("String_Node_Str"));
    ((ParameterDialog)dialog).setInput(handle);
  }
  if (dialog == null)   return null;
  if (dialog.open() == Dialog.CANCEL) {
    return null;
  }
  return (DesignElementHandle)dialog.getResult();
}
Program: 70810
Project: 70810
Buggy source:
/** 
 * Notifies this listener that the selection has changed. <p> This method is called when the selection changes from one to a <code>non-null</code> value, but not when the selection changes to <code>null</code>. If there is a requirement to be notified in the latter scenario, implement <code>INullSelectionListener</code>. The event will be posted through this method. </p>
 * @param part the workbench part containing the selection
 * @param selection the current selection. This may be <code>null</code> if <code>INullSelectionListener</code> is implemented.
 */
public void selectionChanged(IWorkbenchPart part,ISelection selection){
  if (SessionHandleAdapter.getInstance().getReportDesignHandle() != null) {
    if (part != null && !ReportPlugin.getDefault().containIgnoreViewID(part.getSite().getId())) {
      selection=new StructuredSelection();
      handleSelectionChanged(selection);
    }
  }
}

Fixed version (ground truth):
/** 
 * Notifies this listener that the selection has changed. <p> This method is called when the selection changes from one to a <code>non-null</code> value, but not when the selection changes to <code>null</code>. If there is a requirement to be notified in the latter scenario, implement <code>INullSelectionListener</code>. The event will be posted through this method. </p>
 * @param part the workbench part containing the selection
 * @param selection the current selection. This may be <code>null</code> if <code>INullSelectionListener</code> is implemented.
 */
public void selectionChanged(IWorkbenchPart part,ISelection selection){
  if (SessionHandleAdapter.getInstance().getReportDesignHandle() != null) {
    if (part != null && !ReportPlugin.getDefault().containIgnoreViewID(part.getSite().getId())) {
      handleSelectionChanged(new StructuredSelection());
    }
  }
}
Program: 70811
Project: 70811
Buggy source:
/** 
 * Returns a new instance of specified category page.
 * @param categoryId
 * @return
 */
public static ICategoryPage getCategory(String categoryId){
  if (containCategory(categoryId)) {
    return new CategoryPage(categoryId,categoryMap.get(categoryId).toString(),paneClassMap.get(categoryId));
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns a new instance of specified category page.
 * @param categoryId
 * @return
 */
public static ICategoryPage getCategory(String categoryId){
  if (containCategory(categoryId)) {
    return new CategoryPage(categoryId,categoryMap.get(categoryId),paneClassMap.get(categoryId));
  }
  return null;
}
Program: 70812
Project: 70812
Buggy source:
public static String getCategoryDisplayName(String categoryId){
  if (containCategory(categoryId)) {
    return categoryMap.get(categoryId).toString();
  }
  return categoryId;
}

Fixed version (ground truth):
public static String getCategoryDisplayName(String categoryId){
  if (containCategory(categoryId)) {
    return categoryMap.get(categoryId);
  }
  return categoryId;
}
Program: 70813
Project: 70813
Buggy source:
protected MementoElement[] createItemPath(TreeItem item){
  MementoElement tempMemento=null;
  while (item.getParentItem() != null) {
    TreeItem parent=item.getParentItem();
    for (int i=0; i < parent.getItemCount(); i++) {
      if (parent.getItem(i) == item) {
        MementoElement memento=new MementoElement(item.getText(),new Integer(i),MementoElement.Type_Element);
        if (tempMemento != null)         memento.addChild(tempMemento);
        tempMemento=memento;
        item=parent;
        break;
      }
    }
  }
  MementoElement memento=new MementoElement(item.getText(),new Integer(0),MementoElement.Type_Element);
  if (tempMemento != null)   memento.addChild(tempMemento);
  return PropertyMementoUtil.getNodePath(memento);
}

Fixed version (ground truth):
protected MementoElement[] createItemPath(TreeItem item){
  MementoElement tempMemento=null;
  while (item.getParentItem() != null) {
    TreeItem parent=item.getParentItem();
    for (int i=0; i < parent.getItemCount(); i++) {
      if (parent.getItem(i) == item) {
        MementoElement memento=new MementoElement(item.getText(),Integer.valueOf(i),MementoElement.Type_Element);
        if (tempMemento != null)         memento.addChild(tempMemento);
        tempMemento=memento;
        item=parent;
        break;
      }
    }
  }
  MementoElement memento=new MementoElement(item.getText(),Integer.valueOf(0),MementoElement.Type_Element);
  if (tempMemento != null)   memento.addChild(tempMemento);
  return PropertyMementoUtil.getNodePath(memento);
}
Program: 70814
Project: 70814
Buggy source:
public void handleSelectionChanged(ISelection selection){
  if (this.selection != null && this.selection.equals(selection))   return;
  this.selection=selection;
  deRegisterListeners();
  list=getModelList(selection);
  GroupElementHandle handle=DEUtil.getMultiSelectionHandle(list);
  if (handle != null && !handle.isSameType()) {
    viewer.setInput(null);
    setTitleDisplayName(null);
    return;
  }
  viewer.setInput(handle);
  setTitleDisplayName(handle);
  registerListeners();
  Object element=handle.getElements().get(0);
  if (element instanceof DesignElementHandle) {
    IMemento memento=viewerMemento.getChild(PropertyMementoUtil.getElementType((DesignElementHandle)element));
    if (memento == null) {
      expandToDefaultLevel();
      if (viewer.getTree().getItemCount() > 0) {
        Memento elementMemento=(Memento)viewerMemento.createChild(PropertyMementoUtil.getElementType((DesignElementHandle)element),MementoElement.Type_Element);
        elementMemento.getMementoElement().setValue(new Integer(0));
      }
    }
 else     if (memento instanceof Memento) {
      expandToDefaultLevel();
      expandTreeFromMemento((Memento)memento);
    }
  }
}

Fixed version (ground truth):
public void handleSelectionChanged(ISelection selection){
  if (this.selection != null && this.selection.equals(selection))   return;
  this.selection=selection;
  deRegisterListeners();
  list=getModelList(selection);
  GroupElementHandle handle=DEUtil.getMultiSelectionHandle(list);
  if (handle != null && !handle.isSameType()) {
    viewer.setInput(null);
    setTitleDisplayName(null);
    return;
  }
  viewer.setInput(handle);
  setTitleDisplayName(handle);
  registerListeners();
  if (handle != null && DEUtil.getInputSize(handle) > 0) {
    Object element=handle.getElements().get(0);
    if (element instanceof DesignElementHandle) {
      IMemento memento=viewerMemento.getChild(PropertyMementoUtil.getElementType((DesignElementHandle)element));
      if (memento == null) {
        expandToDefaultLevel();
        if (viewer.getTree().getItemCount() > 0) {
          Memento elementMemento=(Memento)viewerMemento.createChild(PropertyMementoUtil.getElementType((DesignElementHandle)element),MementoElement.Type_Element);
          elementMemento.getMementoElement().setValue(Integer.valueOf(0));
        }
      }
 else       if (memento instanceof Memento) {
        expandToDefaultLevel();
        expandTreeFromMemento((Memento)memento);
      }
    }
  }
}
Program: 70815
Project: 70815
Buggy source:
protected void refresh(){
  viewer.refresh(true);
  if (!viewer.getTree().isDisposed() && viewer.getInput() != null && viewer.getInput() instanceof GroupElementHandle) {
    GroupElementHandle handle=(GroupElementHandle)viewer.getInput();
    Object obj=handle.getElements().get(0);
    if (obj instanceof DesignElementHandle) {
      IMemento memento=viewerMemento.getChild(PropertyMementoUtil.getElementType((DesignElementHandle)obj));
      if (memento == null) {
        expandToDefaultLevel();
        if (viewer.getTree().getItemCount() > 0) {
          Memento elementMemento=(Memento)viewerMemento.createChild(PropertyMementoUtil.getElementType((DesignElementHandle)obj),MementoElement.Type_Element);
          elementMemento.getMementoElement().setValue(new Integer(0));
        }
      }
      if (memento != null && memento instanceof Memento) {
        expandToDefaultLevel();
        expandTreeFromMemento((Memento)memento);
      }
    }
  }
  changed=false;
}

Fixed version (ground truth):
protected void refresh(){
  viewer.refresh(true);
  if (!viewer.getTree().isDisposed() && viewer.getInput() != null && viewer.getInput() instanceof GroupElementHandle) {
    GroupElementHandle handle=(GroupElementHandle)viewer.getInput();
    Object obj=handle.getElements().get(0);
    if (obj instanceof DesignElementHandle) {
      IMemento memento=viewerMemento.getChild(PropertyMementoUtil.getElementType((DesignElementHandle)obj));
      if (memento == null) {
        expandToDefaultLevel();
        if (viewer.getTree().getItemCount() > 0) {
          Memento elementMemento=(Memento)viewerMemento.createChild(PropertyMementoUtil.getElementType((DesignElementHandle)obj),MementoElement.Type_Element);
          elementMemento.getMementoElement().setValue(Integer.valueOf(0));
        }
      }
      if (memento != null && memento instanceof Memento) {
        expandToDefaultLevel();
        expandTreeFromMemento((Memento)memento);
      }
    }
  }
  changed=false;
}
Program: 70816
Project: 70816
Buggy source:
public void elementChanged(DesignElementHandle focus,NotificationEvent ev){
  if (!viewer.getTree().isDisposed()) {
    if (getControl().isFocusControl()) {
      IMemento memento=viewerMemento.getChild(PropertyMementoUtil.getElementType(focus));
      if (memento == null) {
        expandToDefaultLevel();
        if (viewer.getTree().getItemCount() > 0) {
          Memento elementMemento=(Memento)viewerMemento.createChild(PropertyMementoUtil.getElementType(focus),MementoElement.Type_Element);
          elementMemento.getMementoElement().setValue(new Integer(0));
        }
      }
      if (memento != null && memento instanceof Memento) {
        expandToDefaultLevel();
        expandTreeFromMemento((Memento)memento);
      }
      changed=false;
    }
 else {
      changed=true;
      if (changed == true)       refresh();
    }
  }
}

Fixed version (ground truth):
public void elementChanged(DesignElementHandle focus,NotificationEvent ev){
  if (!viewer.getTree().isDisposed()) {
    if (getControl().isFocusControl()) {
      IMemento memento=viewerMemento.getChild(PropertyMementoUtil.getElementType(focus));
      if (memento == null) {
        expandToDefaultLevel();
        if (viewer.getTree().getItemCount() > 0) {
          Memento elementMemento=(Memento)viewerMemento.createChild(PropertyMementoUtil.getElementType(focus),MementoElement.Type_Element);
          elementMemento.getMementoElement().setValue(Integer.valueOf(0));
        }
      }
      if (memento != null && memento instanceof Memento) {
        expandToDefaultLevel();
        expandTreeFromMemento((Memento)memento);
      }
      changed=false;
    }
 else {
      changed=true;
      if (changed == true)       refresh();
    }
  }
}
Program: 70817
Project: 70817
Buggy source:
/** 
 * Returns all font names for current system. NOTES: Java 1.4 only support true type fonts.
 * @param comparator Sort comparator.
 * @return font names.
 */
public static String[] getSystemFontNames(Comparator comparator){
  if (scalable_system_fonts == null) {
    FontData[] fontDatas=Display.getCurrent().getFontList(null,true);
    scalable_system_fonts=new ArrayList<String>();
    for (    FontData fd : fontDatas) {
      scalable_system_fonts.add(fd.getName());
    }
  }
  if (non_scalable_system_fonts == null) {
    FontData[] fontDatas=Display.getCurrent().getFontList(null,false);
    non_scalable_system_fonts=new ArrayList<String>();
    for (    FontData fd : fontDatas) {
      non_scalable_system_fonts.add(fd.getName());
    }
  }
  SortedSet<String> set=new TreeSet<String>(comparator);
  for (  String fontName : scalable_system_fonts) {
    set.add(fontName);
  }
  for (  String fontName : non_scalable_system_fonts) {
    set.add(fontName);
  }
  return set.toArray(new String[set.size()]);
}

Fixed version (ground truth):
/** 
 * Returns all font names for current system. NOTES: Java 1.4 only support true type fonts.
 * @param comparator Sort comparator.
 * @return font names.
 */
synchronized public static String[] getSystemFontNames(Comparator comparator){
  if (scalable_system_fonts == null) {
    FontData[] fontDatas=Display.getCurrent().getFontList(null,true);
    scalable_system_fonts=new ArrayList<String>();
    for (    FontData fd : fontDatas) {
      scalable_system_fonts.add(fd.getName());
    }
  }
  if (non_scalable_system_fonts == null) {
    FontData[] fontDatas=Display.getCurrent().getFontList(null,false);
    non_scalable_system_fonts=new ArrayList<String>();
    for (    FontData fd : fontDatas) {
      non_scalable_system_fonts.add(fd.getName());
    }
  }
  SortedSet<String> set=new TreeSet<String>(comparator);
  for (  String fontName : scalable_system_fonts) {
    set.add(fontName);
  }
  for (  String fontName : non_scalable_system_fonts) {
    set.add(fontName);
  }
  return set.toArray(new String[set.size()]);
}
Program: 70818
Project: 70818
Buggy source:
public Object getAdapter(Object adaptableObject,Class adapterType){
  if (IPathEditorInputFactory.class.equals(adapterType)) {
    return new IPathEditorInputFactory(){
      public IEditorInput create(      IPath path){
        return new PathEditorInput(path);
      }
    }
;
  }
  return null;
}

Fixed version (ground truth):
public Object getAdapter(Object adaptableObject,Class adapterType){
  if (IPathEditorInputFactory.class.equals(adapterType)) {
    return new IPathEditorInputFactory(){
      public IEditorInput create(      IPath path){
        final IFile file=ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
        if (file != null) {
          return new FileEditorInput(file);
        }
        return new PathEditorInput(path);
      }
    }
;
  }
  return null;
}
Program: 70819
Project: 70819
Buggy source:
public IEditorInput create(IPath path){
  return new PathEditorInput(path);
}

Fixed version (ground truth):
public IEditorInput create(IPath path){
  final IFile file=ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
  if (file != null) {
    return new FileEditorInput(file);
  }
  return new PathEditorInput(path);
}
Program: 70820
Project: 70820
Buggy source:
public boolean equals(Object obj){
  if (obj instanceof ElementAdapter) {
    return this.getId().equals(((ElementAdapter)obj).getId());
  }
  return super.equals(obj);
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj == this) {
    return true;
  }
  if (!(obj instanceof ElementAdapter)) {
    return false;
  }
  return this.getId().equals(((ElementAdapter)obj).getId());
}
Program: 70821
Project: 70821
Buggy source:
public Object getAdapter(Object adaptableObject,Class adapterType){
  if (!(adaptableObject instanceof TabularCubeHandle)) {
    return null;
  }
  TabularCubeHandle cube=(TabularCubeHandle)adaptableObject;
  if (cube == null) {
    return null;
  }
  return new CubePageGenerator();
}

Fixed version (ground truth):
public Object getAdapter(Object adaptableObject,Class adapterType){
  if (!(adaptableObject instanceof TabularCubeHandle)) {
    return null;
  }
  return new CubePageGenerator();
}
Program: 70822
Project: 70822
Buggy source:
protected void setColumnList(DesignElementHandle handle){
  try {
    DataSetHandle dataset=null;
    if (handle instanceof TabularCubeHandle) {
      dataset=((TabularCubeHandle)handle).getDataSet();
    }
 else     if (handle instanceof TabularDimensionHandle) {
      TabularHierarchyHandle hierarchy=(TabularHierarchyHandle)((TabularDimensionHandle)handle).getDefaultHierarchy();
      if (hierarchy.getDataSet() != null)       dataset=hierarchy.getDataSet();
 else       dataset=((TabularHierarchyHandle)handle).getDataSet();
    }
 else     if (handle instanceof TabularHierarchyHandle) {
      TabularHierarchyHandle hierarchy=(TabularHierarchyHandle)handle;
      if (hierarchy.getDataSet() != null)       dataset=hierarchy.getDataSet();
 else       dataset=((TabularHierarchyHandle)handle).getDataSet();
    }
    if (dataset != null)     columnList=DataUtil.getColumnList(dataset);
 else     columnList=Collections.EMPTY_LIST;
  }
 catch (  SemanticException e) {
    ExceptionHandler.handle(e);
  }
}

Fixed version (ground truth):
protected void setColumnList(DesignElementHandle handle){
  try {
    DataSetHandle dataset=null;
    if (handle instanceof TabularCubeHandle) {
      dataset=((TabularCubeHandle)handle).getDataSet();
    }
 else     if (handle instanceof TabularDimensionHandle) {
      TabularHierarchyHandle hierarchy=(TabularHierarchyHandle)((TabularDimensionHandle)handle).getDefaultHierarchy();
      if (hierarchy != null)       dataset=hierarchy.getDataSet();
    }
 else     if (handle instanceof TabularHierarchyHandle) {
      TabularHierarchyHandle hierarchy=(TabularHierarchyHandle)handle;
      if (hierarchy != null)       dataset=hierarchy.getDataSet();
    }
    if (dataset != null)     columnList=DataUtil.getColumnList(dataset);
 else     columnList=Collections.EMPTY_LIST;
  }
 catch (  SemanticException e) {
    ExceptionHandler.handle(e);
  }
}
Program: 70823
Project: 70823
Buggy source:
private void updateBindingParameters(){
  if (provider instanceof FilterHandleProvider) {
    ParamBindingHandle[] bindingParams=null;
    if (inputList.get(0) instanceof ReportItemHandle) {
      ReportItemHandle inputHandle=(ReportItemHandle)inputList.get(0);
      List list=new ArrayList();
      for (Iterator iterator=inputHandle.paramBindingsIterator(); iterator.hasNext(); ) {
        ParamBindingHandle handle=(ParamBindingHandle)iterator.next();
        list.add(handle);
      }
      bindingParams=new ParamBindingHandle[list.size()];
      list.toArray(bindingParams);
    }
    ((FilterHandleProvider)provider).setBindingParams(bindingParams);
  }
}

Fixed version (ground truth):
private void updateBindingParameters(){
  ParamBindingHandle[] bindingParams=null;
  if (inputList.get(0) instanceof ReportItemHandle) {
    ReportItemHandle inputHandle=(ReportItemHandle)inputList.get(0);
    List list=new ArrayList();
    for (Iterator iterator=inputHandle.paramBindingsIterator(); iterator.hasNext(); ) {
      ParamBindingHandle handle=(ParamBindingHandle)iterator.next();
      list.add(handle);
    }
    bindingParams=new ParamBindingHandle[list.size()];
    list.toArray(bindingParams);
  }
  provider.setBindingParams(bindingParams);
}
Program: 70825
Project: 70825
Buggy source:
/** 
 * @param root:The Query model object
 * @param editPart:The edit part currently selected
 * @param selectedObject:The selected Object
 */
public DeleteJoinAction(JoinConditionEditPart editPart,Object selectedObject){
  super(selectedObject);
  if (editPart instanceof JoinConditionEditPart) {
    this.editPart=editPart;
  }
}

Fixed version (ground truth):
/** 
 * @param root : The Query model object
 * @param editPart : The edit part currently selected
 * @param selectedObject : The selected Object
 */
public DeleteJoinAction(JoinConditionEditPart editPart,Object selectedObject){
  super(selectedObject);
  this.editPart=editPart;
}
Program: 70826
Project: 70826
Buggy source:
/** 
 * There is a content start from the offset, which parent start from the parentOffset. update the index for that object. 
 * @param parentOffset
 * @param offset
 * @throws IOException
 */
protected void updateIndex(IContent content) throws IOException {
  long index=cntOffset;
  long parent=-1;
  long previous=-1;
  IContent pContent=(IContent)content.getParent();
  if (pContent != null) {
    DocumentExtension pDocExt=(DocumentExtension)pContent.getExtension(IContent.DOCUMENT_EXTENSION);
    if (pDocExt != null) {
      parent=pDocExt.getIndex();
      long lastChild=pDocExt.getLastChild();
      if (lastChild != -1) {
        previous=lastChild;
      }
      pDocExt.setLastChild(index);
    }
 else {
      previous=rootOffset;
      rootOffset=index;
    }
  }
 else {
    previous=rootOffset;
    rootOffset=index;
  }
  DocumentExtension docExt=new DocumentExtension(index);
  docExt.setParent(parent);
  docExt.setPrevious(previous);
  content.setExtension(IContent.DOCUMENT_EXTENSION,docExt);
  cntStream.seek(VERSION_SIZE + index);
  cntStream.writeLong(parent);
  cntStream.writeLong(-1);
  cntStream.writeLong(-1);
  cntOffset+=INDEX_ENTRY_SIZE;
  if (previous == -1) {
    if (parent != -1) {
      cntStream.seek(VERSION_SIZE + parent + OFFSET_CHILD);
      cntStream.writeLong(index);
    }
  }
 else {
    cntStream.seek(VERSION_SIZE + previous + OFFSET_NEXT);
    cntStream.writeLong(index);
  }
}

Fixed version (ground truth):
/** 
 * There is a content start from the offset, which parent start from the parentOffset. update the index for that object. 
 * @param parentOffset
 * @param offset
 * @throws IOException
 */
protected void updateIndex(IContent content) throws IOException {
  long index=cntOffset;
  long previous=-1;
  DocumentExtension pDocExt=null;
  DocumentExtension docExt=new DocumentExtension(index);
  docExt.setContentId(content.getInstanceID().getUniqueID());
  content.setExtension(IContent.DOCUMENT_EXTENSION,docExt);
  IContent pContent=(IContent)content.getParent();
  if (pContent != null) {
    pDocExt=(DocumentExtension)pContent.getExtension(IContent.DOCUMENT_EXTENSION);
    if (pDocExt != null) {
      pDocExt.add(docExt);
      previous=docExt.getPrevious();
    }
 else {
      previous=rootOffset;
      rootOffset=index;
    }
  }
 else {
    previous=rootOffset;
    rootOffset=index;
  }
  cntStream.seek(VERSION_SIZE + index);
  cntStream.writeLong(docExt.getParent());
  cntStream.writeLong(docExt.getNext());
  cntStream.writeLong(-1);
  cntOffset+=INDEX_ENTRY_SIZE;
  if (previous == -1) {
    if (docExt.getParent() != -1) {
      cntStream.seek(VERSION_SIZE + docExt.getParent() + OFFSET_CHILD);
      cntStream.writeLong(index);
    }
  }
 else {
    cntStream.seek(VERSION_SIZE + previous + OFFSET_NEXT);
    cntStream.writeLong(index);
  }
}
Program: 70827
Project: 70827
Buggy source:
public void setHyperlinkDef(HyperlinkDef def){
  this.hyperLink=def;
}

Fixed version (ground truth):
public void setHyperlinkDef(HyperlinkDef def){
  this.hyperLink=def;
  if (hyperLink != null) {
    style.setProperty(StyleConstant.COLOR_PROP,HYPERLINK_COLOR);
    style.setProperty(StyleConstant.TEXT_UNDERLINE_PROP,HYPERLINK_UNDERLINE);
  }
}
Program: 70828
Project: 70828
Buggy source:
/** 
 * @param dimAxisIndex
 * @return
 */
private int caculateOffset(int dimAxisIndex,boolean isStart){
  EdgeInfo edgeInfo=findCurrentEdgeInfo(relationMap.mirrorStartPosition - 1);
  int start=findOuterMostChildEdgeInfoIndex(relationMap.mirrorStartPosition - 1,edgeInfo);
  if (start < 0)   return start;
  for (int i=relationMap.mirrorStartPosition; i < this.dimAxis.length; i++) {
    start=start * this.relationMap.mirrorLength[i];
  }
  for (int k=relationMap.mirrorStartPosition; k <= dimAxisIndex; k++) {
    int offset=1;
    for (int i=k + 1; i < this.dimAxis.length; i++) {
      if (k == dimAxisIndex && !isStart)       offset=offset * (this.dimensionCursorPosition[k] + 1) * relationMap.mirrorLength[i];
 else       offset=offset * this.dimensionCursorPosition[k] * relationMap.mirrorLength[i];
    }
    if (k + 1 < this.dimAxis.length)     start+=offset;
  }
  return start;
}

Fixed version (ground truth):
/** 
 * @param dimAxisIndex
 * @return
 */
private int caculateOffset(int dimAxisIndex,boolean isStart){
  EdgeInfo edgeInfo=findCurrentEdgeInfo(relationMap.mirrorStartPosition - 1);
  int start=findOuterMostChildEdgeInfoIndex(relationMap.mirrorStartPosition - 1,edgeInfo);
  if (start < 0)   return start;
  for (int i=relationMap.mirrorStartPosition; i < this.dimAxis.length; i++) {
    start=start * this.relationMap.mirrorLength[i];
  }
  for (int k=relationMap.mirrorStartPosition; k <= dimAxisIndex; k++) {
    int offset=this.dimensionCursorPosition[k];
    if (!isStart && k == dimAxisIndex) {
      offset=this.dimensionCursorPosition[k] + 1;
    }
    for (int i=k + 1; i < this.dimAxis.length; i++) {
      offset=offset * relationMap.mirrorLength[i];
    }
    if (k + 1 < this.dimAxis.length)     start+=offset;
  }
  return start;
}
Program: 70829
Project: 70829
Buggy source:
/** 
 * @param axis
 * @param relationMap
 * @param fetcher
 */
DimensionTraverse(DimensionAxis[] axis,EdgeDimensionRelation relationMap,int edgeStart,int edgeEnd){
  this.dimAxis=axis;
  this.relationMap=relationMap;
  this.dimensionCursorPosition=new int[dimAxis.length];
  this.beforeFirst();
  this.fetcher=relationMap.fetcher;
  this.edgeStart=edgeStart;
  this.edgeEnd=edgeEnd;
  dimensionCursorPosition=findDimensionPosition(edgeStart - 1);
  endPosition=findDimensionPosition(edgeEnd);
}

Fixed version (ground truth):
/** 
 * @param axis
 * @param relationMap
 * @param fetcher
 */
DimensionTraverse(DimensionAxis[] axis,EdgeDimensionRelation relationMap,int edgeStart,int edgeEnd){
  this.dimAxis=axis;
  this.relationMap=relationMap;
  this.dimensionCursorPosition=new int[dimAxis.length];
  this.beforeFirst();
  this.fetcher=relationMap.fetcher;
  this.edgeStart=edgeStart;
  this.edgeEnd=edgeEnd;
  dimensionCursorPosition=findDimensionPosition(edgeStart - 1);
}
Program: 70830
Project: 70830
Buggy source:
protected void writeSectionInP() throws IOException, BirtException {
  wordWriter.startSectionInParagraph();
  writeHeaderFooter();
  wordWriter.writePageProperties(pageHeight,pageWidth,headerHeight,footerHeight,topMargin,bottomMargin,leftMargin,rightMargin,orientation);
  wordWriter.endSectionInParagraph();
}

Fixed version (ground truth):
protected void writeSectionInP() throws IOException, BirtException {
  wordWriter.startSectionInParagraph();
  writeHeaderFooter();
  wordWriter.writePageProperties(pageHeight,pageWidth,headerHeight,footerHeight,topMargin,bottomMargin,leftMargin,rightMargin,orientation);
  wordWriter.writePageBorders(previousPage.getComputedStyle(),topMargin,bottomMargin,leftMargin,rightMargin);
  wordWriter.endSectionInParagraph();
}
Program: 70831
Project: 70831
Buggy source:
protected void writeSectionInBody() throws IOException, BirtException {
  wordWriter.startSection();
  writeHeaderFooter();
  wordWriter.writePageProperties(pageHeight,pageWidth,headerHeight,footerHeight,topMargin,bottomMargin,leftMargin,rightMargin,orientation);
  wordWriter.endSection();
}

Fixed version (ground truth):
protected void writeSectionInBody() throws IOException, BirtException {
  wordWriter.startSection();
  writeHeaderFooter();
  wordWriter.writePageProperties(pageHeight,pageWidth,headerHeight,footerHeight,topMargin,bottomMargin,leftMargin,rightMargin,orientation);
  wordWriter.writePageBorders(previousPage.getComputedStyle(),topMargin,bottomMargin,leftMargin,rightMargin);
  wordWriter.endSection();
}
Program: 70832
Project: 70832
Buggy source:
private void writeTableBorders(IStyle style){
  writer.openTag("String_Node_Str");
  writeBorders(style);
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
private void writeTableBorders(IStyle style){
  writer.openTag("String_Node_Str");
  writeBorders(style,0,0,0,0);
  writer.closeTag("String_Node_Str");
}
Program: 70833
Project: 70833
Buggy source:
private void writeSingleBorder(String type,String borderStyle,String color,CSSValue width){
  writer.openTag("String_Node_Str" + type);
  writeBorderProperty(borderStyle,color,width);
  writer.closeTag("String_Node_Str" + type);
}

Fixed version (ground truth):
private void writeSingleBorder(String type,String borderStyle,String color,CSSValue width,int margin){
  writer.openTag("String_Node_Str" + type);
  writeBorderProperty(borderStyle,color,width,margin);
  writer.closeTag("String_Node_Str" + type);
}
Program: 70834
Project: 70834
Buggy source:
private void writeParagraphBorders(IStyle style){
  writer.openTag("String_Node_Str");
  writeBorders(style);
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
private void writeParagraphBorders(IStyle style){
  writer.openTag("String_Node_Str");
  writeBorders(style,0,0,0,0);
  writer.closeTag("String_Node_Str");
}
Program: 70835
Project: 70835
Buggy source:
private void writeRunBorder(String borderStyle,String color,CSSValue borderWidth){
  writer.openTag("String_Node_Str");
  writeBorderProperty(borderStyle,color,borderWidth);
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
private void writeRunBorder(String borderStyle,String color,CSSValue borderWidth){
  writer.openTag("String_Node_Str");
  writeBorderProperty(borderStyle,color,borderWidth,0);
  writer.closeTag("String_Node_Str");
}
Program: 70836
Project: 70836
Buggy source:
private void writeBorderProperty(String style,String color,CSSValue width){
  writer.attribute("String_Node_Str",WordUtil.parseBorderStyle(style));
  writer.attribute("String_Node_Str",WordUtil.parseBorderSize(((FloatValue)width).getFloatValue()));
  writer.attribute("String_Node_Str",0);
  writer.attribute("String_Node_Str",WordUtil.parseColor(color));
}

Fixed version (ground truth):
private void writeBorderProperty(String style,String color,CSSValue width,int margin){
  writer.attribute("String_Node_Str",WordUtil.parseBorderStyle(style));
  writer.attribute("String_Node_Str",WordUtil.parseBorderSize(((FloatValue)width).getFloatValue()));
  writer.attribute("String_Node_Str",validateBorderSpace(margin));
  writer.attribute("String_Node_Str",WordUtil.parseColor(color));
}
Program: 70837
Project: 70837
Buggy source:
private void writeBorders(IStyle style){
  String borderStyle=style.getBorderBottomStyle();
  if (hasBorder(borderStyle)) {
    writeSingleBorder(BOTTOM,borderStyle,style.getBorderBottomColor(),style.getProperty(StyleConstants.STYLE_BORDER_BOTTOM_WIDTH));
  }
  borderStyle=style.getBorderTopStyle();
  if (hasBorder(borderStyle)) {
    writeSingleBorder(TOP,borderStyle,style.getBorderTopColor(),style.getProperty(StyleConstants.STYLE_BORDER_TOP_WIDTH));
  }
  borderStyle=style.getBorderLeftStyle();
  if (hasBorder(borderStyle)) {
    writeSingleBorder(LEFT,borderStyle,style.getBorderLeftColor(),style.getProperty(StyleConstants.STYLE_BORDER_LEFT_WIDTH));
  }
  borderStyle=style.getBorderRightStyle();
  if (hasBorder(borderStyle)) {
    writeSingleBorder(RIGHT,borderStyle,style.getBorderRightColor(),style.getProperty(StyleConstants.STYLE_BORDER_RIGHT_WIDTH));
  }
}

Fixed version (ground truth):
protected void writeBorders(IStyle style,int bottomMargin,int topMargin,int leftMargin,int rightMargin){
  String borderStyle=style.getBorderBottomStyle();
  if (hasBorder(borderStyle)) {
    writeSingleBorder(BOTTOM,borderStyle,style.getBorderBottomColor(),style.getProperty(StyleConstants.STYLE_BORDER_BOTTOM_WIDTH),bottomMargin);
  }
  borderStyle=style.getBorderTopStyle();
  if (hasBorder(borderStyle)) {
    writeSingleBorder(TOP,borderStyle,style.getBorderTopColor(),style.getProperty(StyleConstants.STYLE_BORDER_TOP_WIDTH),topMargin);
  }
  borderStyle=style.getBorderLeftStyle();
  if (hasBorder(borderStyle)) {
    writeSingleBorder(LEFT,borderStyle,style.getBorderLeftColor(),style.getProperty(StyleConstants.STYLE_BORDER_LEFT_WIDTH),leftMargin);
  }
  borderStyle=style.getBorderRightStyle();
  if (hasBorder(borderStyle)) {
    writeSingleBorder(RIGHT,borderStyle,style.getBorderRightColor(),style.getProperty(StyleConstants.STYLE_BORDER_RIGHT_WIDTH),rightMargin);
  }
}
Program: 70838
Project: 70838
Buggy source:
private void writeCellBorders(IStyle style){
  writer.openTag("String_Node_Str");
  writeBorders(style);
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
private void writeCellBorders(IStyle style){
  writer.openTag("String_Node_Str");
  writeBorders(style,0,0,0,0);
  writer.closeTag("String_Node_Str");
}
Program: 70839
Project: 70839
Buggy source:
/** 
 * This method will be invoked while a containerArea ends.
 * @param container the ContainerArea specified from layout
 */
protected void endContainer(IContainerArea container){
  currentX-=getX(container);
  currentY-=getY(container);
  if (container instanceof PageArea) {
    BorderInfo[] borders=cacheBorderInfo(container);
    drawBorder(borders);
    pageGraphic.dispose();
  }
 else {
    if (container instanceof RowArea) {
      rowStyleStack.pop();
    }
    if (container instanceof TableArea) {
      drawTableBorder((TableArea)container);
    }
 else     if (!(container instanceof CellArea)) {
      BorderInfo[] borders=cacheBorderInfo(container);
      drawBorder(borders);
    }
    if (container.needClip()) {
      endClip();
    }
  }
}

Fixed version (ground truth):
/** 
 * This method will be invoked while a containerArea ends.
 * @param container the ContainerArea specified from layout
 */
protected void endContainer(IContainerArea container){
  currentX-=getX(container);
  currentY-=getY(container);
  if (container instanceof PageArea) {
    pageGraphic.dispose();
  }
 else {
    if (container instanceof RowArea) {
      rowStyleStack.pop();
    }
    if (container instanceof TableArea) {
      drawTableBorder((TableArea)container);
    }
 else     if (!(container instanceof CellArea)) {
      BorderInfo[] borders=cacheBorderInfo(container);
      drawBorder(borders);
    }
    if (container.needClip()) {
      endClip();
    }
  }
}
Program: 70841
Project: 70841
Buggy source:
/** 
 * handle action to clear some old birt runtime files
 * @param webContentPath
 * @param monitor
 * @throws Exception
 */
protected void doClearAction(IPath webContentPath,IProgressMonitor monitor) throws Exception {
  IPath webPath=webContentPath;
  if (webPath.segmentCount() > 0)   webPath=webPath.removeFirstSegments(1);
  Map map=BirtWizardUtil.initConflictResources(null);
  Iterator it=map.keySet().iterator();
  while (it.hasNext()) {
    String folder=(String)it.next();
    if (folder == null)     continue;
    IPath path=webPath.append(folder);
    IFolder tempFolder=project.getFolder(path);
    if (tempFolder == null || !tempFolder.exists())     continue;
    List files=(List)map.get(folder);
    if (files == null || files.size() <= 0) {
      tempFolder.delete(true,monitor);
    }
 else {
      tempFolder.accept(new LibResourceVisitor(monitor,files),IResource.DEPTH_INFINITE,false);
    }
  }
}

Fixed version (ground truth):
/** 
 * handle action to clear some old birt runtime files
 * @param webContentPath
 * @param monitor
 * @throws Exception
 */
protected void doClearAction(IPath webContentPath,IProgressMonitor monitor) throws Exception {
  IPath webPath=webContentPath;
  if (webPath.segmentCount() > 0)   webPath=webPath.removeFirstSegments(1);
  Map map=BirtWizardUtil.initConflictResources(null);
  Iterator it=map.entrySet().iterator();
  while (it.hasNext()) {
    Map.Entry entry=(Map.Entry)it.next();
    String folder=(String)entry.getKey();
    if (folder == null)     continue;
    IPath path=webPath.append(folder);
    IFolder tempFolder=project.getFolder(path);
    if (tempFolder == null || !tempFolder.exists())     continue;
    List files=(List)entry.getValue();
    if (files == null || files.size() <= 0) {
      tempFolder.delete(true,monitor);
    }
 else {
      tempFolder.accept(new LibResourceVisitor(monitor,files),IResource.DEPTH_INFINITE,false);
    }
  }
}
Program: 70843
Project: 70843
Buggy source:
/** 
 * Create "BIRT_OVERWRITE_DOCUMENT" configuration group
 * @param parent
 */
public Button createOverwriteGroup(Composite parent){
  Button btOverwrite=new Button(parent,SWT.CHECK);
  boolean defaultValue=DataUtil.getBoolean(WebArtifactUtil.getContextParamValue(properties,BIRT_OVERWRITE_DOCUMENT_SETTING));
  btOverwrite.setSelection(defaultValue);
  btOverwrite.setText(BirtWTPMessages.BIRTConfiguration_overwrite_message);
  btOverwrite.setLayoutData(new GridData(GridData.END));
  btOverwrite.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      WebArtifactUtil.setContextParamValue(properties,BIRT_OVERWRITE_DOCUMENT_SETTING,new String(BLANK_STRING + ((Button)e.getSource()).getSelection()));
    }
  }
);
  return btOverwrite;
}

Fixed version (ground truth):
/** 
 * Create "BIRT_OVERWRITE_DOCUMENT" configuration group
 * @param parent
 */
public Button createOverwriteGroup(Composite parent){
  Button btOverwrite=new Button(parent,SWT.CHECK);
  boolean defaultValue=DataUtil.getBoolean(WebArtifactUtil.getContextParamValue(properties,BIRT_OVERWRITE_DOCUMENT_SETTING));
  btOverwrite.setSelection(defaultValue);
  btOverwrite.setText(BirtWTPMessages.BIRTConfiguration_overwrite_message);
  btOverwrite.setLayoutData(new GridData(GridData.END));
  btOverwrite.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      WebArtifactUtil.setContextParamValue(properties,BIRT_OVERWRITE_DOCUMENT_SETTING,BLANK_STRING + ((Button)e.getSource()).getSelection());
    }
  }
);
  return btOverwrite;
}