nus-yam/ex-repair huggingface dataset:
Program: 133497
Project: 133497
Buggy source:
/** 
 * Refreshes the contents of the viewer. <p> <b>Note:</b> This method should be called on the UI thread! </p>
 */
private void refreshViewer(){
  boolean columnsChanged=false;
  List<VizEntry> newRowTemplate=tableComponent.getRowTemplate();
  if (!newRowTemplate.equals(rowTemplate)) {
    columnsChanged=true;
    rowTemplate=newRowTemplate;
  }
  if (columnsChanged) {
    for (    TableViewerColumn column : columns) {
      column.getColumn().dispose();
    }
    columns.clear();
    EntryCellContentProvider basicContentProvider=new EntryCellContentProvider();
    EntryCellEditingSupport basicEditingSupport=new EntryCellEditingSupport(viewer,basicContentProvider);
    for (int i=0; i < rowTemplate.size(); i++) {
      VizEntry entry=rowTemplate.get(i);
      TableViewerColumn column=new TableViewerColumn(viewer,SWT.LEFT);
      columns.add(column);
      TableColumn columnWidget=column.getColumn();
      columnWidget.setText(entry.getName());
      columnWidget.setToolTipText(entry.getDescription());
      columnWidget.setResizable(true);
      columnWidget.pack();
      ICellContentProvider contentProvider=new TableComponentCellContentProvider(basicContentProvider,i);
      EditingSupport editingSupport=new TableComponentCellEditingSupport(viewer,basicEditingSupport,i);
      column.setLabelProvider(new CellColumnLabelProvider(contentProvider));
      column.setEditingSupport(editingSupport);
    }
  }
  viewer.refresh();
  return;
}

Fixed version (ground truth):
/** 
 * Refreshes the contents of the viewer. <p> <b>Note:</b> This method should be called on the UI thread! </p>
 */
private void refreshViewer(){
  boolean columnsChanged=false;
  List<VizEntry> newRowTemplate=tableComponent.getRowTemplate();
  if (!newRowTemplate.equals(rowTemplate)) {
    columnsChanged=true;
    rowTemplate=newRowTemplate;
  }
  if (columnsChanged) {
    for (    TableViewerColumn column : columns) {
      column.getColumn().dispose();
    }
    columns.clear();
    EntryCellContentProvider basicContentProvider=new EntryCellContentProvider();
    EntryCellEditingSupport basicEditingSupport=new EntryCellEditingSupport(viewer,basicContentProvider);
    GC gc=new GC(viewer.getTable());
    for (int i=0; i < rowTemplate.size(); i++) {
      VizEntry entry=rowTemplate.get(i);
      String header=entry.getName();
      int headerWidth=gc.stringExtent(header).x + 20;
      TableViewerColumn column=new TableViewerColumn(viewer,SWT.LEFT);
      columns.add(column);
      TableColumn columnWidget=column.getColumn();
      columnWidget.setText(header);
      columnWidget.setToolTipText(entry.getDescription());
      columnWidget.setResizable(true);
      columnWidget.setWidth(headerWidth);
      ICellContentProvider contentProvider=new TableComponentCellContentProvider(basicContentProvider,i);
      EditingSupport editingSupport=new TableComponentCellEditingSupport(viewer,basicEditingSupport,i);
      column.setLabelProvider(new CellColumnLabelProvider(contentProvider));
      column.setEditingSupport(editingSupport);
    }
    gc.dispose();
  }
  viewer.refresh();
  return;
}
Program: 133498
Project: 133498
Buggy source:
/** 
 * This method sets up the BatMLModel Item's Form reference, specifically, it searches for the correct XML schema and creates an EMFComponent and adds it to the Form.
 */
@Override protected void setupForm(){
  if (project != null && project.isAccessible()) {
    try {
      project.refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    CoreException e) {
      logger.error(getClass().getName() + "String_Node_Str",e);
    }
    loadInput(null);
  }
}

Fixed version (ground truth):
/** 
 * This method sets up the BatMLModel Item's Form reference, specifically, it searches for the correct XML schema and creates an EMFComponent and adds it to the Form.
 */
@Override protected void setupForm(){
  form=new Form();
  if (project != null && project.isAccessible()) {
    try {
      project.refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    CoreException e) {
      logger.error(getClass().getName() + "String_Node_Str",e);
    }
    loadInput(null);
  }
}
Program: 133500
Project: 133500
Buggy source:
protected void reloadSeries(){
  proxySeries.clear();
  if (source != null) {
    proxySeries.putAll(createProxySeries(source));
  }
  return;
}

Fixed version (ground truth):
protected void reloadSeries(){
  if (source != null) {
    Map<String,List<ISeries>> newSeries=createProxySeries(source);
    for (    String category : newSeries.keySet()) {
      List<ISeries> listSeries=newSeries.get(category);
      List<ISeries> oldSeries=proxySeries.get(category);
      if (oldSeries != null) {
        for (int i=0; i < listSeries.size() && i < oldSeries.size(); i++) {
          listSeries.get(i).setEnabled(oldSeries.get(i).isEnabled());
        }
      }
    }
    proxySeries.clear();
    proxySeries.putAll(newSeries);
  }
 else {
    proxySeries.clear();
  }
  return;
}
Program: 133505
Project: 133505
Buggy source:
/** 
 * Overrides the parent behavior to provide an axial view of the component's data.
 */
@Override protected void refreshData(){
  data.removeAll();
  double value;
  Color bg;
  Color fg;
  Label label;
  GridData gridData;
  for (int i=featureData.size() - 1; i >= 0; i--) {
    value=featureData.get(i).getValue();
    bg=colorScale.getColor((value - minValue) / (maxValue - minValue));
    int luma=(int)(0.2126 * bg.getRed() + 0.7152 * bg.getGreen() + 0.0722 * bg.getBlue());
    fg=(luma < 75 ? ColorConstants.white : ColorConstants.black);
    label=new Label(String.format("String_Node_Str",value));
    label.setBackgroundColor(bg);
    label.setForegroundColor(fg);
    label.setOpaque(true);
    gridData=new GridData(0,0,true,true,1,1);
    gridData=new GridData(GridData.FILL_BOTH);
    data.add(label,gridData);
  }
  if (featureData.isEmpty()) {
    label=new Label("String_Node_Str");
    label.setBackgroundColor(ColorConstants.black);
    label.setForegroundColor(ColorConstants.white);
    label.setOpaque(true);
    gridData=new GridData(0,0,true,true,1,1);
    data.add(label,gridData);
  }
  return;
}

Fixed version (ground truth):
/** 
 * Overrides the parent behavior to provide an axial view of the component's data.
 */
@Override protected void refreshData(){
  data.removeAll();
  double value;
  Color bg;
  Color fg;
  Label label;
  GridData gridData;
  for (int i=featureData.size() - 1; i >= 0; i--) {
    value=featureData.get(i).getValue();
    int color=colorFactory.findColor((value - minValue) / (maxValue - minValue));
    bg=colorFactory.createColor(null,color);
    int luma=(int)(0.2126 * bg.getRed() + 0.7152 * bg.getGreen() + 0.0722 * bg.getBlue());
    fg=(luma < 75 ? ColorConstants.white : ColorConstants.black);
    label=new Label(String.format("String_Node_Str",value));
    label.setBackgroundColor(bg);
    label.setForegroundColor(fg);
    label.setOpaque(true);
    gridData=new GridData(0,0,true,true,1,1);
    gridData=new GridData(GridData.FILL_BOTH);
    data.add(label,gridData);
  }
  if (featureData.isEmpty()) {
    label=new Label("String_Node_Str");
    label.setBackgroundColor(ColorConstants.black);
    label.setForegroundColor(ColorConstants.white);
    label.setOpaque(true);
    gridData=new GridData(0,0,true,true,1,1);
    data.add(label,gridData);
  }
  return;
}
Program: 133506
Project: 133506
Buggy source:
/** 
 * This method is called whenever the current   {@link #resourceComponent} isupdated. It adds any new plots to the map of  {@link #plots} if possible.
 */
@Override public void update(IUpdateable component){
  if (component != null && component == resourceComponent) {
    ResourceComponent resourceComponent=(ResourceComponent)component;
  }
 else   if (component != null && component instanceof VizResource) {
    final VizResource resource=(VizResource)component;
    plotGridComposite.refreshPlots(resource.getPath());
    if (pageComposite != null) {
      pageComposite.getDisplay().asyncExec(new Runnable(){
        @Override public void run(){
          pageComposite.layout();
          activateEditor();
        }
      }
);
    }
  }
  return;
}

Fixed version (ground truth):
/** 
 * This method is called whenever the current   {@link #resourceComponent} isupdated. It adds any new plots to the map of  {@link #plots} if possible.
 */
@Override public void update(IUpdateable component){
  if (component != null && component == resourceComponent) {
    ResourceComponent resourceComponent=(ResourceComponent)component;
    for (    ICEResource resource : resourceComponent.getResources()) {
      if (resource instanceof VizResource) {
        resource.register(this);
      }
    }
  }
 else   if (component != null && component instanceof VizResource) {
    final VizResource resource=(VizResource)component;
    plotGridComposite.refreshPlots(resource.getPath());
    if (pageComposite != null) {
      pageComposite.getDisplay().asyncExec(new Runnable(){
        @Override public void run(){
          pageComposite.layout();
          activateEditor();
        }
      }
);
    }
  }
  return;
}
Program: 133509
Project: 133509
Buggy source:
/** 
 * Refreshes any plots that may be associated with the specified URI.
 * @param uri The data file.
 */
public void refreshPlots(URI uri){
  for (int i=0; i < plots.size(); i++) {
    IPlot plot=plots.get(i);
    if (plot.getDataSource() == uri) {
      try {
        plot.draw(grid);
      }
 catch (      Exception e) {
        logger.warn(getClass().getName() + "String_Node_Str" + "String_Node_Str"+ uri.getPath()+ "String_Node_Str",e);
      }
    }
  }
  return;
}

Fixed version (ground truth):
/** 
 * Refreshes any plots that may be associated with the specified URI.
 * @param uri The data file.
 */
public void refreshPlots(URI uri){
  for (int i=0; i < plots.size(); i++) {
    IPlot plot=plots.get(i);
    if (plot.getDataSource().equals(uri)) {
      try {
        plot.redraw();
      }
 catch (      Exception e) {
        logger.warn(getClass().getName() + "String_Node_Str" + "String_Node_Str"+ uri.getPath()+ "String_Node_Str",e);
      }
    }
  }
  return;
}
Program: 133510
Project: 133510
Buggy source:
/** 
 * Adds the components of the model to the reflectivity page.
 * @see org.eclipse.ice.client.widgets.ICEFormEditor#addPages()
 */
@Override protected void addPages(){
  for (  Component i : iceDataForm.getComponents()) {
    System.out.println("String_Node_Str" + i.getName() + "String_Node_Str"+ i.getId());
    i.accept(this);
  }
  if (!(componentMap.get("String_Node_Str").isEmpty()) && !(componentMap.get("String_Node_Str").isEmpty()) && !(componentMap.get("String_Node_Str").isEmpty())) {
    DataComponent dataComp=(DataComponent)componentMap.get("String_Node_Str").get(0);
    DataComponent outputComp=(DataComponent)componentMap.get("String_Node_Str").get(1);
    ListComponent listComp=(ListComponent)componentMap.get("String_Node_Str").get(0);
    ResourceComponent resComp=(ResourceComponent)componentMap.get("String_Node_Str").get(0);
    ReflectivityPage page=new ReflectivityPage(this,dataComp.getName() + listComp.getName() + resComp.getName()+ outputComp.getName(),"String_Node_Str");
    super.resourceComponentPage=page;
    page.setVizService(this.getVizServiceFactory());
    page.setResourceComponent(resComp);
    page.setDataComponent(dataComp);
    page.setList(listComp);
    page.setOutputComponent(outputComp);
    try {
      addPage(page);
    }
 catch (    PartInitException e) {
      e.printStackTrace();
    }
    reflectPage=page;
  }
}

Fixed version (ground truth):
/** 
 * Adds the components of the model to the reflectivity page.
 * @see org.eclipse.ice.client.widgets.ICEFormEditor#addPages()
 */
@Override protected void addPages(){
  for (  Component i : iceDataForm.getComponents()) {
    System.out.println("String_Node_Str" + i.getName() + "String_Node_Str"+ i.getId());
    i.accept(this);
  }
  if (!(componentMap.get("String_Node_Str").isEmpty()) && !(componentMap.get("String_Node_Str").isEmpty()) && !(componentMap.get("String_Node_Str").isEmpty())) {
    DataComponent dataComp=(DataComponent)componentMap.get("String_Node_Str").get(0);
    DataComponent outputComp=(DataComponent)componentMap.get("String_Node_Str").get(1);
    ListComponent listComp=(ListComponent)componentMap.get("String_Node_Str").get(0);
    ResourceComponent resComp=(ResourceComponent)componentMap.get("String_Node_Str").get(0);
    ReflectivityPage page=new ReflectivityPage(this,dataComp.getName() + listComp.getName() + resComp.getName()+ outputComp.getName(),"String_Node_Str");
    super.resourceComponentPage=page;
    page.setResourceComponent(resComp);
    page.setDataComponent(dataComp);
    page.setList(listComp);
    page.setOutputComponent(outputComp);
    try {
      addPage(page);
    }
 catch (    PartInitException e) {
      e.printStackTrace();
    }
    reflectPage=page;
  }
}
Program: 133511
Project: 133511
Buggy source:
@Override protected IStatus run(IProgressMonitor monitor){
  monitor.beginTask("String_Node_Str",100);
  String sourcePath=getSourcePath(uri);
  ViewerMethods methods=connection.getWidget().getViewerMethods();
  methods.openDatabase(sourcePath);
  monitor.worked(20);
  FileInfo info=methods.getDatabaseInfo();
  monitor.worked(20);
  addIndependentSeries(info);
  monitor.worked(10);
  addPlotCategory("String_Node_Str",info.getMeshes());
  monitor.worked(10);
  addPlotCategory("String_Node_Str",info.getMaterials());
  monitor.worked(10);
  addPlotCategory("String_Node_Str",info.getScalars());
  monitor.worked(10);
  addPlotCategory("String_Node_Str",info.getVectors());
  monitor.worked(10);
  loadLock.lock();
  try {
    loading=false;
    loaded=true;
  }
  finally {
    loadLock.unlock();
  }
  notifyPlotListeners("String_Node_Str","String_Node_Str");
  monitor.worked(10);
  return new Status(Status.OK,"String_Node_Str",1,"String_Node_Str",null);
}

Fixed version (ground truth):
@Override protected IStatus run(IProgressMonitor monitor){
  monitor.beginTask("String_Node_Str",100);
  String sourcePath=getSourcePath(uri);
  ViewerMethods methods=connection.getWidget().getViewerMethods();
  methods.openDatabase(sourcePath);
  monitor.worked(20);
  FileInfo info=methods.getDatabaseInfo();
  monitor.worked(20);
  addIndependentSeries(info);
  monitor.worked(5);
  addPlotCategory("String_Node_Str",info.getMeshes());
  monitor.worked(10);
  addPlotCategory("String_Node_Str",info.getMaterials());
  monitor.worked(10);
  addPlotCategory("String_Node_Str",info.getScalars());
  monitor.worked(10);
  addPlotCategory("String_Node_Str",info.getVectors());
  monitor.worked(10);
  setInitialPlotType();
  monitor.worked(5);
  loadLock.lock();
  try {
    loading=false;
    loaded=true;
  }
  finally {
    loadLock.unlock();
  }
  notifyPlotListeners("String_Node_Str","String_Node_Str");
  monitor.worked(10);
  return new Status(Status.OK,"String_Node_Str",1,"String_Node_Str",null);
}
Program: 133513
Project: 133513
Buggy source:
@Override public void setInput(IWorkbenchPart part,ISelection selection){
  super.setInput(part,selection);
  System.out.println("String_Node_Str");
  if (selection instanceof IStructuredSelection) {
    Object second=((IStructuredSelection)selection).toArray()[1];
    if (second instanceof MaterialSelection && second != null) {
      this.selection=(MaterialSelection)second;
      selectionLabel.setText(this.selection.getMaterial().getName() + "String_Node_Str" + this.selection.getSelectedProperty()+ "String_Node_Str");
      this.selectionText.setText(Double.toString(this.selection.getMaterial().getProperty(this.selection.getSelectedProperty())));
    }
  }
}

Fixed version (ground truth):
@Override public void setInput(IWorkbenchPart part,ISelection selection){
  super.setInput(part,selection);
  if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() >= 2) {
    Object second=((IStructuredSelection)selection).toArray()[1];
    if (second instanceof MaterialSelection && second != null) {
      this.selection=(MaterialSelection)second;
      selectionLabel.setText(this.selection.getMaterial().getName() + "String_Node_Str" + this.selection.getSelectedProperty()+ "String_Node_Str");
      if (this.selection.getSelectedProperty().equals("String_Node_Str")) {
        this.selectionText.setText(this.selection.getMaterial().getName());
        this.selectionText.setEnabled(false);
      }
 else {
        this.selectionText.setText(Double.toString(this.selection.getMaterial().getProperty(this.selection.getSelectedProperty())));
        this.selectionText.setEnabled(true);
      }
    }
  }
}
Program: 133514
Project: 133514
Buggy source:
@Override public List<Object> toList(){
  List<Object> list=new ArrayList<Object>();
  list.add(data);
  list.add(selectedCell);
  return list;
}

Fixed version (ground truth):
@Override public List<Object> toList(){
  List<Object> list=new ArrayList<Object>();
  list.add(data);
  if (selectedCell != null) {
    list.add(selectedCell);
  }
  return list;
}
Program: 133515
Project: 133515
Buggy source:
@Override public Iterator iterator(){
  List<Object> list=new ArrayList<Object>();
  list.add(data);
  list.add(selectedCell);
  return list.iterator();
}

Fixed version (ground truth):
@Override public Iterator iterator(){
  List<Object> list=new ArrayList<Object>();
  list.add(data);
  if (selectedCell != null) {
    list.add(selectedCell);
  }
  return list.iterator();
}
Program: 133516
Project: 133516
Buggy source:
/** 
 * Gets the current selection for this page. If nothing in the list component table is selected, should return the data component for editing its entries, and a material selection for editing the table. Part of the ISelectionProvider interface.
 */
@Override public ISelection getSelection(){
  return new IStructuredSelection(){
    @Override public boolean isEmpty(){
      return false;
    }
    @Override public Object getFirstElement(){
      return data;
    }
    @Override public Iterator iterator(){
      List<Object> list=new ArrayList<Object>();
      list.add(data);
      list.add(selectedCell);
      return list.iterator();
    }
    @Override public int size(){
      return 2;
    }
    @Override public Object[] toArray(){
      return new Object[]{data,selectedCell};
    }
    @Override public List<Object> toList(){
      List<Object> list=new ArrayList<Object>();
      list.add(data);
      list.add(selectedCell);
      return list;
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Gets the current selection for this page. If nothing in the list component table is selected, should return the data component for editing its entries, and a material selection for editing the table. Part of the ISelectionProvider interface.
 */
@Override public ISelection getSelection(){
  return new IStructuredSelection(){
    @Override public boolean isEmpty(){
      return false;
    }
    @Override public Object getFirstElement(){
      return data;
    }
    @Override public Iterator iterator(){
      List<Object> list=new ArrayList<Object>();
      list.add(data);
      if (selectedCell != null) {
        list.add(selectedCell);
      }
      return list.iterator();
    }
    @Override public int size(){
      return selectedCell == null ? 1 : 2;
    }
    @Override public Object[] toArray(){
      if (selectedCell != null) {
        return new Object[]{data,selectedCell};
      }
 else {
        return new DataComponent[]{data};
      }
    }
    @Override public List<Object> toList(){
      List<Object> list=new ArrayList<Object>();
      list.add(data);
      if (selectedCell != null) {
        list.add(selectedCell);
      }
      return list;
    }
  }
;
}
Program: 133517
Project: 133517
Buggy source:
@Override public int size(){
  return 2;
}

Fixed version (ground truth):
@Override public int size(){
  return selectedCell == null ? 1 : 2;
}
Program: 133518
Project: 133518
Buggy source:
@Override public Object[] toArray(){
  return new Object[]{data,selectedCell};
}

Fixed version (ground truth):
@Override public Object[] toArray(){
  if (selectedCell != null) {
    return new Object[]{data,selectedCell};
  }
 else {
    return new DataComponent[]{data};
  }
}
Program: 133520
Project: 133520
Buggy source:
@Override protected void disposePlotContent(Composite plotContent,IVizConnection<VisItSwtConnection> connection){
  if (canvas != null && !canvas.isDisposed()) {
    canvas.dispose();
    canvas=null;
  }
  super.disposePlotContent(plotContent,connection);
}

Fixed version (ground truth):
@Override protected void disposePlotContent(Composite plotContent,IVizConnection<VisItSwtConnection> connection){
  if (canvas != null && !canvas.isDisposed()) {
    canvas.dispose();
    canvas=null;
    timeSlider.dispose();
    timeSlider=null;
  }
  super.disposePlotContent(plotContent,connection);
}
Program: 133522
Project: 133522
Buggy source:
/** 
 * This operation draws the (initial) controls in the properties view based on the input.
 */
@Override public void createControls(Composite parent,TabbedPropertySheetPage aTabbedPropertySheetPage){
  super.createControls(parent,aTabbedPropertySheetPage);
  Color backgroundColor=parent.getBackground();
  section=getWidgetFactory().createSection(parent,Section.SHORT_TITLE_BAR | Section.DESCRIPTION);
  section.setText(data.getName());
  section.setDescription(data.getDescription());
  section.setBackground(backgroundColor);
  dataComposite=new DataComponentComposite(data,section,SWT.NONE);
  GridLayout clientLayout=new GridLayout(2,true);
  clientLayout.marginLeft=ITabbedPropertyConstants.HMARGIN;
  clientLayout.marginRight=ITabbedPropertyConstants.HMARGIN;
  clientLayout.marginTop=ITabbedPropertyConstants.VMARGIN;
  clientLayout.marginBottom=ITabbedPropertyConstants.VMARGIN;
  clientLayout.horizontalSpacing=ITabbedPropertyConstants.HSPACE;
  clientLayout.verticalSpacing=ITabbedPropertyConstants.VSPACE;
  dataComposite.setLayout(clientLayout);
  if (System.getProperty("String_Node_Str") == null) {
    dataComposite.setBackground(backgroundColor);
  }
 else {
    dataComposite.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
  }
  getWidgetFactory().adapt(dataComposite);
  section.setClient(dataComposite);
  return;
}

Fixed version (ground truth):
/** 
 * This operation draws the (initial) controls in the properties view based on the input.
 */
@Override public void createControls(Composite parent,TabbedPropertySheetPage aTabbedPropertySheetPage){
  super.createControls(parent,aTabbedPropertySheetPage);
  Color backgroundColor=parent.getBackground();
  section=getWidgetFactory().createSection(parent,Section.SHORT_TITLE_BAR | Section.DESCRIPTION);
  section.setText(data.getName());
  section.setDescription(data.getDescription());
  section.setBackground(backgroundColor);
  dataComposite=new DataComponentComposite(data,section,SWT.NONE);
  Control[] children=dataComposite.getChildren();
  for (  Control child : children) {
    if (child instanceof EntryComposite) {
      EntryComposite entry=(EntryComposite)child;
      entry.setEnabled(isEnabled);
    }
  }
  GridLayout clientLayout=new GridLayout(2,true);
  clientLayout.marginLeft=ITabbedPropertyConstants.HMARGIN;
  clientLayout.marginRight=ITabbedPropertyConstants.HMARGIN;
  clientLayout.marginTop=ITabbedPropertyConstants.VMARGIN;
  clientLayout.marginBottom=ITabbedPropertyConstants.VMARGIN;
  clientLayout.horizontalSpacing=ITabbedPropertyConstants.HSPACE;
  clientLayout.verticalSpacing=ITabbedPropertyConstants.VSPACE;
  dataComposite.setLayout(clientLayout);
  if (System.getProperty("String_Node_Str") == null) {
    dataComposite.setBackground(backgroundColor);
  }
 else {
    dataComposite.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
  }
  getWidgetFactory().adapt(dataComposite);
  section.setClient(dataComposite);
  return;
}
Program: 133523
Project: 133523
Buggy source:
@Override public ISection getSectionClass(){
  ReflectivityDataPropertySection section;
  section=new ReflectivityDataPropertySection();
  section.setDataComponent(output);
  return section;
}

Fixed version (ground truth):
@Override public ISection getSectionClass(){
  ReflectivityDataPropertySection section;
  section=new ReflectivityDataPropertySection();
  section.setDataComponent(output);
  section.setIsEnabled(false);
  return section;
}
Program: 133525
Project: 133525
Buggy source:
@Override protected void setup(){
  allowedValueType=AllowedValueType.Continuous;
  defaultValue="String_Node_Str";
  return;
}

Fixed version (ground truth):
@Override protected void setup(){
  allowedValueType=AllowedValueType.Continuous;
  allowedValues.add("String_Node_Str");
  allowedValues.add("String_Node_Str");
  defaultValue="String_Node_Str";
  return;
}
Program: 133527
Project: 133527
Buggy source:
public void addShape(ICEShape newShape){
  if (isComplex()) {
    notifyListeners();
    ((ComplexShape)shape).addShape(newShape.getShape());
    children.add(newShape);
  }
}

Fixed version (ground truth):
public void addShape(ICEShape newShape){
  if (isComplex()) {
    ((ComplexShape)shape).addShape(newShape.getShape());
    newShape.setParent(this);
    children.add(newShape);
    notifyListeners();
  }
}
Program: 133528
Project: 133528
Buggy source:
public double[] getRotation(){
  return transformation.getSkew();
}

Fixed version (ground truth):
public double[] getRotation(){
  return transformation.getRotation();
}
Program: 133529
Project: 133529
Buggy source:
public double[] getScale(){
  return transformation.getSkew();
}

Fixed version (ground truth):
public double[] getScale(){
  return transformation.getScale();
}
Program: 133530
Project: 133530
Buggy source:
public double[] getTranslation(){
  return transformation.getSkew();
}

Fixed version (ground truth):
public double[] getTranslation(){
  return transformation.getTranslation();
}
Program: 133531
Project: 133531
Buggy source:
/** 
 * Adds a plot to be drawn inside the plot grid. Note that the same plot can be added more than once.
 * @param plot The plot to draw inside the grid.
 * @return The index of the plot in the grid, or -1 if the plot could not bedrawn.
 * @throws Exception An exception is thrown if the  {@link IPlot} implementationcannot be rendered.
 */
public int addPlot(IPlot plot) throws Exception {
  int index=-1;
  ISeries independent=null;
  List<ISeries> dependent=null;
  if (plot != null && drawnPlots.size() < rows * columns && (independent=plot.getIndependentSeries()) != null && (dependent=plot.getAllDependentSeries(null)) != null) {
    if (dependent.size() > 0 && independent.getBounds() != null) {
      final DrawnPlot drawnPlot=new DrawnPlot(gridComposite,plot);
      drawnPlot.setBackground(getBackground());
      try {
        drawnPlot.draw();
      }
 catch (      Exception e) {
        drawnPlot.dispose();
        throw e;
      }
      index=drawnPlots.size();
      drawnPlots.add(drawnPlot);
      drawnPlotMap.put(drawnPlot,index);
      drawnPlot.addDisposeListener(plotDisposeListener);
      GridData gridData=new GridData(SWT.FILL,SWT.FILL,true,true);
      drawnPlot.setLayoutData(gridData);
      refreshLayout();
    }
  }
  return index;
}

Fixed version (ground truth):
/** 
 * Adds a plot to be drawn inside the plot grid. Note that the same plot can be added more than once.
 * @param plot The plot to draw inside the grid.
 * @return The index of the plot in the grid, or -1 if the plot could not bedrawn.
 * @throws Exception An exception is thrown if the  {@link IPlot} implementationcannot be rendered.
 */
public int addPlot(IPlot plot) throws Exception {
  int index=-1;
  if (plot != null && drawnPlots.size() < rows * columns && plot.getIndependentSeries() != null && plot.getCategories().length > 0) {
    final DrawnPlot drawnPlot=new DrawnPlot(gridComposite,plot);
    drawnPlot.setBackground(getBackground());
    try {
      drawnPlot.draw();
    }
 catch (    Exception e) {
      drawnPlot.dispose();
      throw e;
    }
    index=drawnPlots.size();
    drawnPlots.add(drawnPlot);
    drawnPlotMap.put(drawnPlot,index);
    drawnPlot.addDisposeListener(plotDisposeListener);
    GridData gridData=new GridData(SWT.FILL,SWT.FILL,true,true);
    drawnPlot.setLayoutData(gridData);
    refreshLayout();
  }
  return index;
}
Program: 133532
Project: 133532
Buggy source:
/** 
 * Gets the number of times that   {@link #draw(String,String,Composite)}was called.
 */
public int getDrawCount(){
  return children.size();
}

Fixed version (ground truth):
/** 
 * Gets the number of times that   {@link #draw(Composite)} was called.
 */
public int getDrawCount(){
  return children.size();
}
Program: 133533
Project: 133533
Buggy source:
@Override public IPlot createPlot(URI file) throws Exception {
  createWasCalled.set(true);
  super.createPlot(file);
  FakePlot plot=new FakePlot();
  createCompleted.set(true);
  return plot;
}

Fixed version (ground truth):
@Override public IPlot createPlot(URI file) throws Exception {
  createWasCalled.set(true);
  super.createPlot(file);
  FakePlot plot=new FakePlot();
  plots.add(plot);
  createCompleted.set(true);
  return plot;
}
Program: 133537
Project: 133537
Buggy source:
/** 
 * Creates a FakePlot that will draw something and has a set of plot types.
 */
private FakePlot createValidPlot(){
  FakePlot plot=new FakePlot();
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  return plot;
}

Fixed version (ground truth):
/** 
 * Creates a FakePlot that will draw something and has a set of plot types.
 */
private FakePlot createValidPlot(){
  FakePlot plot=new FakePlot();
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.addDependentSeries("String_Node_Str",getSeries("String_Node_Str"));
  plot.setIndependentSeries(getSeries("String_Node_Str"));
  return plot;
}
Program: 133538
Project: 133538
Buggy source:
/** 
 * <p> Constructor for creating new ComplexShapes with a given OperatorType </p>
 * @param view <p> The current ShapeTreeViewer </p>
 * @param operatorType <p> The type of ComplexShape to create with the action is triggered </p>
 */
public ActionAddShape(ShapeTreeView view,ICEOperatorType operatorType){
  this.view=view;
  this.shapeType=null;
  this.operatorType=operatorType;
  currentShapeId=0;
  this.setText("String_Node_Str" + operatorType.toString());
  Map<ICEOperatorType,String> operatorIcons=new HashMap<ICEOperatorType,String>();
  operatorIcons.put(ICEOperatorType.Union,"String_Node_Str");
  operatorIcons.put(ICEOperatorType.Intersection,"String_Node_Str");
  operatorIcons.put(ICEOperatorType.Complement,"String_Node_Str");
  Bundle bundle=FrameworkUtil.getBundle(getClass());
  URL imagePath=BundleUtility.find(bundle,"String_Node_Str" + operatorIcons.get(operatorType));
  imageDescriptor=ImageDescriptor.createFromURL(imagePath);
}

Fixed version (ground truth):
/** 
 * <p> Constructor for creating new ComplexShapes with a given OperatorType </p>
 * @param view <p> The current ShapeTreeViewer </p>
 * @param operatorType <p> The type of ComplexShape to create with the action is triggered </p>
 */
public ActionAddShape(ShapeTreeView view,OperatorType operatorType){
  this.view=view;
  this.shapeType=null;
  this.operatorType=operatorType;
  currentShapeId=0;
  this.setText("String_Node_Str" + operatorType.toString());
  Map<OperatorType,String> operatorIcons=new HashMap<OperatorType,String>();
  operatorIcons.put(OperatorType.Union,"String_Node_Str");
  operatorIcons.put(OperatorType.Intersection,"String_Node_Str");
  operatorIcons.put(OperatorType.Complement,"String_Node_Str");
  Bundle bundle=FrameworkUtil.getBundle(getClass());
  URL imagePath=BundleUtility.find(bundle,"String_Node_Str" + operatorIcons.get(operatorType));
  imageDescriptor=ImageDescriptor.createFromURL(imagePath);
}
Program: 133540
Project: 133540
Buggy source:
/** 
 * Converts a geometry Transformation data structure to a JME3 Transform
 * @param The Geometry transformation data structure
 * @return The JME3 transformation
 */
private Transform convertTransformation(ICETransformation transformation){
  Transform transform=new Transform();
  double size=transformation.getSize();
  double[] scale=transformation.getScale();
  double[] rotation=transformation.getRotation();
  double[] translation=transformation.getTranslation();
  transform.setScale((float)(size * scale[0]),(float)(size * scale[1]),(float)(size * scale[2]));
  Quaternion rotationQuat=new Quaternion();
  rotationQuat.fromAngles((float)rotation[0],(float)rotation[1],(float)rotation[2]);
  transform.setRotation(rotationQuat);
  transform.setTranslation((float)translation[0],(float)translation[1],(float)translation[2]);
  return transform;
}

Fixed version (ground truth):
/** 
 * Converts a geometry Transformation data structure to a JME3 Transform
 * @param The Geometry transformation data structure
 * @return The JME3 transformation
 */
private Transform convertTransformation(Transformation transformation){
  Transform transform=new Transform();
  double size=transformation.getSize();
  double[] scale=transformation.getScale();
  double[] rotation=transformation.getRotation();
  double[] translation=transformation.getTranslation();
  transform.setScale((float)(size * scale[0]),(float)(size * scale[1]),(float)(size * scale[2]));
  Quaternion rotationQuat=new Quaternion();
  rotationQuat.fromAngles((float)rotation[0],(float)rotation[1],(float)rotation[2]);
  transform.setRotation(rotationQuat);
  transform.setTranslation((float)translation[0],(float)translation[1],(float)translation[2]);
  return transform;
}
Program: 133542
Project: 133542
Buggy source:
public void addShape(ICEShape newShape){
  if (newShape.isComplex()) {
    if (newShape.getOperatorType() == ICEOperatorType.Union) {
      Node node=new Node();
      spatial=node;
    }
  }
 else {
    Mesh mesh=new Box(1.0f,1.0f,1.0f);
    spatial=new Geometry(newShape.getName(),mesh);
  }
}

Fixed version (ground truth):
public void addShape(ICEShape newShape){
  if (newShape.isComplex()) {
    if (newShape.getOperatorType() == OperatorType.Union) {
      Node node=new Node();
      spatial=node;
    }
  }
 else {
    Mesh mesh=new Box(1.0f,1.0f,1.0f);
    spatial=new Geometry(newShape.getName(),mesh);
  }
}
Program: 133543
Project: 133543
Buggy source:
public RenderShape(ICEOperatorType operatorType){
  super(operatorType);
}

Fixed version (ground truth):
public RenderShape(OperatorType operatorType){
  super(operatorType);
}
Program: 133544
Project: 133544
Buggy source:
/** 
 * Converts the IShape's Transformation to a JME3 Transform
 */
private Transform getTransform(){
  ICETransformation transformation=getTransformation();
  Transform transform=new Transform();
  double size=transformation.getSize();
  double[] scale=transformation.getScale();
  double[] rotation=transformation.getRotation();
  double[] translation=transformation.getTranslation();
  transform.setScale((float)(size * scale[0]),(float)(size * scale[1]),(float)(size * scale[2]));
  Quaternion rotationQuat=new Quaternion();
  rotationQuat.fromAngles((float)rotation[0],(float)rotation[1],(float)rotation[2]);
  transform.setRotation(rotationQuat);
  transform.setTranslation((float)translation[0],(float)translation[1],(float)translation[2]);
  return transform;
}

Fixed version (ground truth):
/** 
 * Converts the IShape's Transformation to a JME3 Transform
 */
private Transform getTransform(){
  Transformation transformation=getTransformation();
  Transform transform=new Transform();
  double size=transformation.getSize();
  double[] scale=transformation.getScale();
  double[] rotation=transformation.getRotation();
  double[] translation=transformation.getTranslation();
  transform.setScale((float)(size * scale[0]),(float)(size * scale[1]),(float)(size * scale[2]));
  Quaternion rotationQuat=new Quaternion();
  rotationQuat.fromAngles((float)rotation[0],(float)rotation[1],(float)rotation[2]);
  transform.setRotation(rotationQuat);
  transform.setTranslation((float)translation[0],(float)translation[1],(float)translation[2]);
  return transform;
}
Program: 133547
Project: 133547
Buggy source:
@Override public void update(RealSpinner realSpinner){
  if (currentShape == null) {
    return;
  }
  double size=sizeSpinner.getValue();
  double scaleX=scaleSpinners[0].getValue();
  double scaleY=scaleSpinners[1].getValue();
  double scaleZ=scaleSpinners[2].getValue();
  double rotationX=rotationSpinners[0].getValue();
  double rotationY=rotationSpinners[1].getValue();
  double rotationZ=rotationSpinners[2].getValue();
  double translationX=translateSpinners[0].getValue();
  double translationY=translateSpinners[1].getValue();
  double translationZ=translateSpinners[2].getValue();
  if (degrees) {
    rotationX=Math.toRadians(rotationX);
    rotationY=Math.toRadians(rotationY);
    rotationZ=Math.toRadians(rotationZ);
  }
  ICETransformation transformation=new ICETransformation();
  transformation.setSize(size);
  transformation.setScale(scaleX,scaleY,scaleZ);
  transformation.setRotation(rotationX,rotationY,rotationZ);
  transformation.setTranslation(translationX,translationY,translationZ);
  currentShape.setTransformation(transformation);
}

Fixed version (ground truth):
@Override public void update(RealSpinner realSpinner){
  if (currentShape == null) {
    return;
  }
  double size=sizeSpinner.getValue();
  double scaleX=scaleSpinners[0].getValue();
  double scaleY=scaleSpinners[1].getValue();
  double scaleZ=scaleSpinners[2].getValue();
  double rotationX=rotationSpinners[0].getValue();
  double rotationY=rotationSpinners[1].getValue();
  double rotationZ=rotationSpinners[2].getValue();
  double translationX=translateSpinners[0].getValue();
  double translationY=translateSpinners[1].getValue();
  double translationZ=translateSpinners[2].getValue();
  if (degrees) {
    rotationX=Math.toRadians(rotationX);
    rotationY=Math.toRadians(rotationY);
    rotationZ=Math.toRadians(rotationZ);
  }
  Transformation transformation=new Transformation();
  transformation.setSize(size);
  transformation.setScale(scaleX,scaleY,scaleZ);
  transformation.setRotation(rotationX,rotationY,rotationZ);
  transformation.setTranslation(translationX,translationY,translationZ);
  currentShape.setTransformation(transformation);
}
Program: 133548
Project: 133548
Buggy source:
/** 
 * <p> Sets the input shape and updates the state of the TransformationView to manipulate the input shape's transformation </p> <p> Passing a null value for the input shape reinitializes and disables all the text boxes in the view. </p>
 * @param shape
 */
public void setShape(ICEShape shape){
  this.currentShape=shape;
  ICETransformation transformation;
  if (shape == null) {
    transformation=new ICETransformation();
  }
 else {
    transformation=shape.getTransformation();
  }
  double size=transformation.getSize();
  sizeSpinner.setValue(size);
  double[] scale=transformation.getScale();
  for (int i=0; i < 3; i++) {
    scaleSpinners[i].setValue(scale[i]);
  }
  double[] rotation=transformation.getRotation();
  for (int i=0; i < 3; i++) {
    if (degrees) {
      rotationSpinners[i].setValue(Math.toDegrees(rotation[i]));
    }
 else {
      rotationSpinners[i].setValue(rotation[i]);
    }
  }
  double[] translations=transformation.getTranslation();
  for (int i=0; i < 3; i++) {
    translateSpinners[i].setValue(translations[i]);
  }
  setSpinnersEnabled(shape != null);
}

Fixed version (ground truth):
/** 
 * <p> Sets the input shape and updates the state of the TransformationView to manipulate the input shape's transformation </p> <p> Passing a null value for the input shape reinitializes and disables all the text boxes in the view. </p>
 * @param shape
 */
public void setShape(ICEShape shape){
  this.currentShape=shape;
  Transformation transformation;
  if (shape == null) {
    transformation=new Transformation();
  }
 else {
    transformation=shape.getTransformation();
  }
  double size=transformation.getSize();
  sizeSpinner.setValue(size);
  double[] scale=transformation.getScale();
  for (int i=0; i < 3; i++) {
    scaleSpinners[i].setValue(scale[i]);
  }
  double[] rotation=transformation.getRotation();
  for (int i=0; i < 3; i++) {
    if (degrees) {
      rotationSpinners[i].setValue(Math.toDegrees(rotation[i]));
    }
 else {
      rotationSpinners[i].setValue(rotation[i]);
    }
  }
  double[] translations=transformation.getTranslation();
  for (int i=0; i < 3; i++) {
    translateSpinners[i].setValue(translations[i]);
  }
  setSpinnersEnabled(shape != null);
}
Program: 133550
Project: 133550
Buggy source:
@Override public void menuShown(MenuEvent e){
  repTree.getContributionItem().fill((Menu)e.widget,-1);
}

Fixed version (ground truth):
@Override public void menuShown(MenuEvent e){
  for (  MenuItem item : ((Menu)e.widget).getItems()) {
    item.dispose();
  }
  repTree.getContributionItem().fill((Menu)e.widget,-1);
}
Program: 133552
Project: 133552
Buggy source:
/** 
 * @see org.eclipse.ice.viz.service.IPlot#draw(java.lang.String,java.lang.String,org.eclipse.swt.widgets.Composite)
 */
@Override public Composite draw(Composite parent) throws Exception {
  Composite child=null;
  if (parent == null) {
    throw new NullPointerException("String_Node_Str" + "String_Node_Str");
  }
 else   if (parent.isDisposed()) {
    throw new SWTException(SWT.ERROR_WIDGET_DISPOSED,"String_Node_Str" + "String_Node_Str");
  }
  PlotRender plotRender=plotRenders.get(parent);
  if (plotRender == null) {
    plotRender=createPlotRender(parent);
    plotRenders.put(parent,plotRender);
  }
  plotRender=(CSVPlotRender)plotRenders.get(parent);
  parent.addDisposeListener(new DisposeListener(){
    @Override public void widgetDisposed(    DisposeEvent e){
      ((CSVPlotRender)plotRenders.remove(e.widget)).dispose();
    }
  }
);
  updatePlotRender(plotRender);
  plotRender.refresh();
  child=((CSVPlotRender)plotRender).getEditor().getPlotCanvas();
  return child;
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.ice.viz.service.IPlot#draw(java.lang.String,java.lang.String,org.eclipse.swt.widgets.Composite)
 */
@Override public Composite draw(Composite parent) throws Exception {
  Composite child=null;
  if (parent == null) {
    throw new NullPointerException("String_Node_Str" + "String_Node_Str");
  }
 else   if (parent.isDisposed()) {
    throw new SWTException(SWT.ERROR_WIDGET_DISPOSED,"String_Node_Str" + "String_Node_Str");
  }
  PlotRender plotRender=plotRenders.get(parent);
  if (plotRender == null) {
    plotRender=createPlotRender(parent);
    plotRenders.put(parent,plotRender);
  }
  plotRender=(CSVPlotRender)plotRenders.get(parent);
  parent.addDisposeListener(new DisposeListener(){
    @Override public void widgetDisposed(    DisposeEvent e){
      ((CSVPlotRender)plotRenders.remove(e.widget)).dispose();
    }
  }
);
  for (  ISeries series : getAllDependentSeries(IPlot.DEFAULT_CATEGORY)) {
    if (series.enabled()) {
      ((CSVPlotRender)plotRender).addSeries(series);
    }
  }
  updatePlotRender(plotRender);
  child=((CSVPlotRender)plotRender).getEditor().getPlotCanvas();
  return child;
}
Program: 133554
Project: 133554
Buggy source:
@Override public void run(){
  try {
    draw(categoryRef,typeRef);
  }
 catch (  Exception e) {
    logger.error(getClass().getName() + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  dispose();
}
Program: 133555
Project: 133555
Buggy source:
@Override public void menuShown(MenuEvent e){
  Menu menu=(Menu)e.widget;
  if (parent.getMenu() == null) {
    for (    MenuItem item : menu.getItems()) {
      item.dispose();
    }
  }
  addSeriesTree.getContributionItem().fill(menu,-1);
  removeSeriesTree.getContributionItem().fill(menu,-1);
  separator.fill(menu,-1);
  clearAction.getContributionItem().fill(menu,-1);
}

Fixed version (ground truth):
@Override public void menuShown(MenuEvent e){
  Menu menu=(Menu)e.widget;
  for (  IContributionItem item : menuManager.getItems()) {
    item.fill(menu,-1);
  }
}
Program: 133558
Project: 133558
Buggy source:
@Override public String validateValue(String value){
  String newValue=null;
  if (value != null) {
    String trimmedValue=value.trim();
    try {
      int intValue=Integer.parseInt(trimmedValue);
      if (intValue == -1 || (intValue >= 1 && intValue <= 16)) {
        newValue=trimmedValue;
      }
    }
 catch (    NumberFormatException e) {
    }
  }
  return newValue;
}

Fixed version (ground truth):
@Override public boolean validateValue(String value){
  boolean valid=false;
  if (value != null) {
    String trimmedValue=value.trim();
    try {
      int intValue=Integer.parseInt(trimmedValue);
      if (intValue == -1 || (intValue >= 1 && intValue <= 16)) {
        valid=true;
      }
    }
 catch (    NumberFormatException e) {
    }
  }
  return valid;
}
Program: 133559
Project: 133559
Buggy source:
/** 
 * Validates the specified value for the associated property.
 * @param value The value to check.
 * @return An acceptable, validated value if it is allowed, or{@code null} if it is not allowed.
 */
public String validateValue(String value);

Fixed version (ground truth):
/** 
 * Validates the specified value for the associated property.
 * @param value The value to check.
 * @return True if the value allowed, false otherwise.
 */
public boolean validateValue(String value);
Program: 133561
Project: 133561
Buggy source:
/** 
 * Sets the specified property to the new value, provided the value is both allowed and new.
 * @param name The name of the property to update.
 * @param value The new value of the property. If  {@code null}, the property will be removed.
 * @return True if the property specified by the name was updated to a newvalue, false otherwise.
 */
public boolean setProperty(String name,String value){
  boolean changed=false;
  boolean canChange=true;
  String newValue=value;
  IPropertyHandler handler=propertyHandlers.get(name);
  if (handler != null) {
    newValue=handler.validateValue(value);
    canChange=(newValue != null);
  }
  if (canChange) {
    if (value != null) {
      String oldValue=properties.put(name,value);
      changed=(oldValue == null || !oldValue.equals(value));
    }
 else {
      changed=(properties.remove(name) != null);
    }
  }
  return changed;
}

Fixed version (ground truth):
/** 
 * Sets the specified property to the new value, provided the value is both allowed and new.
 * @param name The name of the property to update.
 * @param value The new value of the property. If  {@code null}, the property will be removed.
 * @return True if the property specified by the name was updated to a newvalue, false otherwise.
 */
public boolean setProperty(String name,String value){
  boolean changed=false;
  IPropertyHandler handler=propertyHandlers.get(name);
  if (handler == null || handler.validateValue(value)) {
    if (value != null) {
      String oldValue=properties.put(name,value);
      changed=(oldValue == null || !oldValue.equals(value));
    }
 else {
      changed=(properties.remove(name) != null);
    }
  }
  return changed;
}