nus-yam/ex-repair huggingface dataset:
Program: 22019
Project: 22019
Buggy source:
public String getDetailText(Object element,int columnIndex){
  if (columnIndex < 0) {
    return "String_Node_Str";
  }
  if (element instanceof Rule) {
    Rule rule=(Rule)element;
    return columnDescriptors[columnIndex].detailStringFor(rule);
  }
  if (element instanceof RuleGroup) {
    RuleGroup group=(RuleGroup)element;
    return columnDescriptors[columnIndex].detailStringFor(group);
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
public String getDetailText(Object element,int columnIndex){
  if (columnIndex <= 0)   return "String_Node_Str";
  if (element instanceof Rule) {
    Rule rule=(Rule)element;
    return columnDescriptors[columnIndex - 1].detailStringFor(rule);
  }
  if (element instanceof RuleGroup) {
    RuleGroup group=(RuleGroup)element;
    return columnDescriptors[columnIndex - 1].detailStringFor(group);
  }
  return "String_Node_Str";
}
Program: 22020
Project: 22020
Buggy source:
public boolean hasOneRule(){
  if (ruleItems.length > 1)   return false;
  return allRules().size() == 1;
}

Fixed version (ground truth):
public boolean hasOneRule(){
  if (ruleItems == null || ruleItems.length > 1)   return false;
  return allRules().size() == 1;
}
Program: 22021
Project: 22021
Buggy source:
/** 
 * @param columnDescs RuleColumnDescriptor[]
 * @param groupingField RuleFieldAccessor
 */
private void setupTreeColumns(RuleColumnDescriptor[] columnDescs,RuleFieldAccessor groupingField){
  Tree ruleTree=cleanupRuleTree();
  for (int i=0; i < columnDescs.length; i++)   columnDescs[i].newTreeColumnFor(ruleTree,i,this,paintListeners());
  treeViewer.setLabelProvider(new RuleLabelProvider(columnDescs));
  treeViewer.setContentProvider(new RuleSetTreeItemProvider(groupingField,"String_Node_Str",Util.comparatorFrom(columnSorter,sortDescending)));
  treeViewer.setInput(ruleSet);
  checkSelections();
  TreeColumn[] columns=ruleTree.getColumns();
  for (  TreeColumn column : columns)   column.pack();
}

Fixed version (ground truth):
/** 
 * @param columnDescs RuleColumnDescriptor[]
 * @param groupingField RuleFieldAccessor
 */
private void setupTreeColumns(RuleColumnDescriptor[] columnDescs,RuleFieldAccessor groupingField){
  Tree ruleTree=cleanupRuleTree();
  createCheckBoxColumn(ruleTree);
  for (int i=0; i < columnDescs.length; i++) {
    TreeColumn tc=columnDescs[i].newTreeColumnFor(ruleTree,i + 1,this,paintListeners());
    if (i == 0 && groupingColumn != null) {
      tc.setText(labelFor(tc));
    }
  }
  treeViewer.setLabelProvider(new RuleLabelProvider(columnDescs));
  treeViewer.setContentProvider(new RuleSetTreeItemProvider(groupingField,"String_Node_Str",Util.comparatorFrom(columnSorter,sortDescending)));
  treeViewer.setInput(ruleSet);
  checkSelections();
  TreeColumn[] columns=ruleTree.getColumns();
  for (  TreeColumn column : columns)   column.pack();
}
Program: 22022
Project: 22022
Buggy source:
/** 
 * Method groupBy.
 * @param chosenColumn RuleColumnDescriptor
 */
public void groupBy(RuleColumnDescriptor chosenColumn){
  List<RuleColumnDescriptor> visibleColumns=new ArrayList<RuleColumnDescriptor>(availableColumns.length);
  for (  RuleColumnDescriptor desc : availableColumns) {
    if (desc == chosenColumn)     continue;
    if (isHidden(desc.label()))     continue;
    visibleColumns.add(desc);
  }
  setupTreeColumns(visibleColumns.toArray(new RuleColumnDescriptor[visibleColumns.size()]),chosenColumn == null ? null : chosenColumn.accessor());
}

Fixed version (ground truth):
/** 
 * Method groupBy.
 * @param chosenColumn RuleColumnDescriptor
 */
public void groupBy(RuleColumnDescriptor chosenColumn){
  groupColumnLabel=chosenColumn == null ? null : chosenColumn.label();
  List<RuleColumnDescriptor> visibleColumns=new ArrayList<RuleColumnDescriptor>(availableColumns.length);
  for (  RuleColumnDescriptor desc : availableColumns) {
    if (desc == chosenColumn)     continue;
    if (isHidden(desc.label()))     continue;
    visibleColumns.add(desc);
  }
  setupTreeColumns(visibleColumns.toArray(new RuleColumnDescriptor[visibleColumns.size()]),chosenColumn == null ? null : chosenColumn.accessor());
  selectedItems(new Object[0]);
}
Program: 22023
Project: 22023
Buggy source:
public static boolean isDefaultValue(Map.Entry<PropertyDescriptor<?>,Object> entry){
  PropertyDescriptor<?> desc=entry.getKey();
  Object value=entry.getValue();
  return CollectionUtil.areEqual(desc.defaultValue(),value);
}

Fixed version (ground truth):
public static boolean isDefaultValue(Map.Entry<PropertyDescriptor<?>,Object> entry){
  PropertyDescriptor<?> desc=entry.getKey();
  Object value=entry.getValue();
  return areEqual(desc.defaultValue(),value);
}
Program: 22024
Project: 22024
Buggy source:
private static boolean areEqual(Object a,Object b){
  return AbstractProperty.areEqual(a,b);
}

Fixed version (ground truth):
public static boolean areEqual(Object value,Object otherValue){
  if (value == otherValue) {
    return true;
  }
  if (value == null) {
    return false;
  }
  if (otherValue == null) {
    return false;
  }
  if (value.getClass().getComponentType() != null) {
    return CollectionUtil.arraysAreEqual(value,otherValue);
  }
  if (value instanceof Float || value instanceof Double) {
    return areEqualNumbers((Number)value,(Number)otherValue);
  }
  return value.equals(otherValue);
}
Program: 22025
Project: 22025
Buggy source:
/** 
 * puts an ArrayList into a Memento, the List is changed into a separated String
 * @param key
 * @param valueList
 */
public <T extends Object>void putList(String key,List<T> valueList){
  if (valueList.isEmpty()) {
    putString(key,"String_Node_Str");
    return;
  }
  final StringBuilder sb=new StringBuilder(String.valueOf(valueList.get(0)));
  for (int k=0; k < valueList.size(); k++) {
    sb.append(LIST_SEPARATOR).append(valueList.get(k));
  }
  putString(key,sb.toString());
}

Fixed version (ground truth):
/** 
 * puts an ArrayList into a Memento, the List is changed into a delimited String
 * @param key
 * @param valueList
 */
public <T extends Object>void putList(String key,List<T> valueList){
  if (valueList.isEmpty()) {
    putString(key,"String_Node_Str");
    return;
  }
  final StringBuilder sb=new StringBuilder(String.valueOf(valueList.get(0)));
  for (int k=1; k < valueList.size(); k++) {
    sb.append(LIST_SEPARATOR).append(valueList.get(k));
  }
  putString(key,sb.toString());
}
Program: 22026
Project: 22026
Buggy source:
/** 
 * Returns a Mewmento with the given Attribute
 * @param name
 * @return a Memento
 */
private IMemento getAttribute(String name){
  final IMemento[] mementos=this.memento.getChildren(ATTRIBUTE_PREFIX);
  IMemento mem=null;
  for (  IMemento memento2 : mementos) {
    final String attrName=memento2.getString(ATTR_NAME);
    if (name.equalsIgnoreCase(attrName)) {
      mem=memento2;
    }
  }
  if (mem == null) {
    mem=this.memento.createChild(ATTRIBUTE_PREFIX);
    mem.putString(ATTR_NAME,name);
  }
  return mem;
}

Fixed version (ground truth):
/** 
 * Returns a Memento with the given Attribute
 * @param name
 * @return a Memento
 */
private IMemento getAttribute(String name){
  final IMemento[] mementos=this.memento.getChildren(ATTRIBUTE_PREFIX);
  IMemento mem=null;
  for (  IMemento memento2 : mementos) {
    final String attrName=memento2.getString(ATTR_NAME);
    if (name.equalsIgnoreCase(attrName)) {
      mem=memento2;
    }
  }
  if (mem == null) {
    mem=this.memento.createChild(ATTRIBUTE_PREFIX);
    mem.putString(ATTR_NAME,name);
  }
  return mem;
}
Program: 22027
Project: 22027
Buggy source:
/** 
 * Set le log level
 */
void setLogLevel(Level level);

Fixed version (ground truth):
/** 
 * Set the log level
 */
void setLogLevel(Level level);
Program: 22028
Project: 22028
Buggy source:
/** 
 * Method arrangeFor.
 * @param theRule Rule
 */
public int arrangeFor(Rule theRule){
  if (rule == theRule)   return -1;
  clearChildren();
  rule=theRule;
  if (rule == null)   return -1;
  Map<PropertyDescriptor<?>,Object> valuesByDescriptor=PMDPreferencePage.filteredPropertiesOf(rule);
  if (valuesByDescriptor.isEmpty())   return 0;
  PropertyDescriptor<?>[] orderedDescs=(PropertyDescriptor[])valuesByDescriptor.keySet().toArray(new PropertyDescriptor[valuesByDescriptor.size()]);
  int maxColumns=2;
  int rowCount=0;
  for (int i=0; i < orderedDescs.length; i++) {
    EditorFactory factory=factoryFor(orderedDescs[i]);
    if (factory == null) {
      System.out.println("String_Node_Str" + orderedDescs[i]);
      continue;
    }
    int colsReqd=factory.columnsRequired();
    maxColumns=Math.max(maxColumns,colsReqd);
    rowCount++;
  }
  GridLayout layout=new GridLayout(maxColumns,false);
  layout.verticalSpacing=2;
  parent.setLayout(layout);
  widgets=new Control[rowCount][maxColumns];
  if (maxColumns < 1)   return 0;
  int rowsAdded=0;
  for (int i=0; i < orderedDescs.length; i++) {
    if (addRowWidgets(factoryFor(orderedDescs[i]),rowsAdded,orderedDescs[i]))     rowsAdded++;
  }
  if (rowsAdded > 0) {
    parent.pack();
  }
  return rowsAdded;
}

Fixed version (ground truth):
/** 
 * Method arrangeFor.
 * @param theRule Rule
 */
public int arrangeFor(Rule theRule){
  if (rule == theRule)   return -1;
  clearChildren();
  rule=theRule;
  if (rule == null)   return -1;
  Map<PropertyDescriptor<?>,Object> valuesByDescriptor=PMDPreferencePage.filteredPropertiesOf(rule);
  if (valuesByDescriptor.isEmpty())   return 0;
  PropertyDescriptor<?>[] orderedDescs=(PropertyDescriptor[])valuesByDescriptor.keySet().toArray(new PropertyDescriptor[valuesByDescriptor.size()]);
  int maxColumns=2;
  int rowCount=0;
  for (int i=0; i < orderedDescs.length; i++) {
    EditorFactory factory=factoryFor(orderedDescs[i]);
    if (factory == null) {
      System.out.println("String_Node_Str" + orderedDescs[i]);
      continue;
    }
    int colsReqd=factory.columnsRequired();
    maxColumns=Math.max(maxColumns,colsReqd);
    rowCount++;
  }
  GridLayout layout=new GridLayout(maxColumns,false);
  layout.verticalSpacing=2;
  layout.marginTop=1;
  parent.setLayout(layout);
  widgets=new Control[rowCount][maxColumns];
  if (maxColumns < 1)   return 0;
  int rowsAdded=0;
  for (int i=0; i < orderedDescs.length; i++) {
    if (addRowWidgets(factoryFor(orderedDescs[i]),rowsAdded,orderedDescs[i]))     rowsAdded++;
  }
  if (rowsAdded > 0) {
    parent.pack();
  }
  return rowsAdded;
}
Program: 22029
Project: 22029
Buggy source:
/** 
 * @param parent Composite
 * @return Combo
 */
private Composite buildGroupCombo(Composite parent,String comboLabel){
  final Composite panel=new Composite(parent,0);
  RowLayout layout=new RowLayout(SWT.HORIZONTAL);
  panel.setLayout(layout);
  Label label=new Label(panel,0);
  label.setText(comboLabel);
  final ComboViewer viewer=new ComboViewer(panel,SWT.DROP_DOWN);
  viewer.setLabelProvider(new LabelProvider(){
    @Override public String getText(    Object element){
      return ((Object[])element)[1].toString();
    }
  }
);
  viewer.add(groupingChoices);
  viewer.setSelection(new StructuredSelection(groupingChoices[groupingChoices.length - 1]),true);
  final Combo combo=viewer.getCombo();
  combo.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      int pos=combo.getSelectionIndex();
      Object[] choice=groupingChoices[pos];
      groupingColumn=(RuleColumnDescriptor)choice[0];
      redrawTable();
    }
  }
);
  return panel;
}

Fixed version (ground truth):
/** 
 * @param parent Composite
 * @return Combo
 */
private Composite buildGroupCombo(Composite parent,String comboLabel){
  final Composite panel=new Composite(parent,0);
  RowLayout layout=new RowLayout(SWT.HORIZONTAL);
  layout.marginTop=0;
  panel.setLayout(layout);
  Label label=new Label(panel,0);
  label.setText(comboLabel);
  final ComboViewer viewer=new ComboViewer(panel,SWT.DROP_DOWN);
  viewer.setLabelProvider(new LabelProvider(){
    @Override public String getText(    Object element){
      return ((Object[])element)[1].toString();
    }
  }
);
  viewer.add(groupingChoices);
  viewer.setSelection(new StructuredSelection(groupingChoices[groupingChoices.length - 1]),true);
  final Combo combo=viewer.getCombo();
  combo.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      int pos=combo.getSelectionIndex();
      Object[] choice=groupingChoices[pos];
      groupingColumn=(RuleColumnDescriptor)choice[0];
      redrawTable();
    }
  }
);
  return panel;
}
Program: 22030
Project: 22030
Buggy source:
/** 
 * Method addLabel.
 * @param parent Composite
 * @param desc PropertyDescriptor
 * @return Label
 */
protected Label addLabel(Composite parent,PropertyDescriptor<?> desc){
  Label label=new Label(parent,SWT.NONE);
  label.setText(desc.description());
  return label;
}

Fixed version (ground truth):
/** 
 * Method addLabel.
 * @param parent Composite
 * @param desc PropertyDescriptor
 * @return Label
 */
protected Label addLabel(Composite parent,PropertyDescriptor<?> desc){
  Label label=new Label(parent,SWT.NONE);
  label.setText(desc.description());
  GridData data=new GridData();
  data.horizontalAlignment=SWT.LEFT;
  data.verticalAlignment=SWT.TOP;
  label.setLayoutData(data);
  return label;
}
Program: 22031
Project: 22031
Buggy source:
public void handleEvent(Event event){
  Double newValue=doubleFrom(text);
  if (newValue.equals(rule.getProperty(dp)))   return;
  rule.setProperty(dp,newValue);
  listener.changed(rule,dp,newValue);
}

Fixed version (ground truth):
public void handleEvent(Event event){
  Double newValue=doubleFrom(text);
  if (newValue == null)   return;
  if (newValue.equals(rule.getProperty(dp)))   return;
  rule.setProperty(dp,newValue);
  listener.changed(rule,dp,newValue);
}
Program: 22032
Project: 22032
Buggy source:
public Control newEditorOn(Composite parent,int columnIndex,final PropertyDescriptor<?> desc,final Rule rule,final ValueChangeListener listener,SizeChangeListener sizeListener){
  if (columnIndex == 0)   return addLabel(parent,desc);
  if (columnIndex == 1) {
    final Text text=new Text(parent,SWT.SINGLE);
    Number val=(Number)rule.getProperty(desc);
    text.setText(val == null ? "String_Node_Str" : val.toString());
    final DoubleProperty dp=doublePropertyFrom(desc);
    text.addListener(SWT.FocusOut,new Listener(){
      public void handleEvent(      Event event){
        Double newValue=doubleFrom(text);
        if (newValue.equals(rule.getProperty(dp)))         return;
        rule.setProperty(dp,newValue);
        listener.changed(rule,dp,newValue);
      }
    }
);
    return text;
  }
  return null;
}

Fixed version (ground truth):
public Control newEditorOn(Composite parent,int columnIndex,final PropertyDescriptor<?> desc,final Rule rule,final ValueChangeListener listener,SizeChangeListener sizeListener){
  if (columnIndex == 0)   return addLabel(parent,desc);
  if (columnIndex == 1) {
    final Text text=new Text(parent,SWT.SINGLE);
    Number val=(Number)rule.getProperty(desc);
    text.setText(val == null ? "String_Node_Str" : val.toString());
    final DoubleProperty dp=doublePropertyFrom(desc);
    text.addListener(SWT.FocusOut,new Listener(){
      public void handleEvent(      Event event){
        Double newValue=doubleFrom(text);
        if (newValue == null)         return;
        if (newValue.equals(rule.getProperty(dp)))         return;
        rule.setProperty(dp,newValue);
        listener.changed(rule,dp,newValue);
      }
    }
);
    return text;
  }
  return null;
}
Program: 22033
Project: 22033
Buggy source:
/** 
 * @param parent Composite
 * @param columnIndex int
 * @param desc PropertyDescriptor
 * @param rule Rule
 * @return Control
 * @see net.sourceforge.pmd.ui.preferences.br.EditorFactory#newEditorOn(Composite,int,PropertyDescriptor,Rule)
 */
public Control newEditorOn(Composite parent,int columnIndex,final PropertyDescriptor<?> desc,final Rule rule,final ValueChangeListener listener,SizeChangeListener sizeListener){
  if (columnIndex == 0)   return addLabel(parent,desc);
  if (columnIndex == 1) {
    final Spinner spinner=new Spinner(parent,SWT.SINGLE | SWT.BORDER);
    final IntegerProperty ip=intPropertyFrom(desc);
    int val=((Number)rule.getProperty(desc)).intValue();
    spinner.setMinimum(ip.lowerLimit().intValue());
    spinner.setMaximum(ip.upperLimit().intValue());
    spinner.setSelection(val);
    spinner.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent event){
        int newValue=spinner.getSelection();
        if (newValue == rule.getProperty(ip))         return;
        rule.setProperty(ip,Integer.valueOf(newValue));
        listener.changed(rule,desc,Integer.valueOf(newValue));
      }
    }
);
    return spinner;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param parent Composite
 * @param columnIndex int
 * @param desc PropertyDescriptor
 * @param rule Rule
 * @return Control
 * @see net.sourceforge.pmd.ui.preferences.br.EditorFactory#newEditorOn(Composite,int,PropertyDescriptor,Rule)
 */
public Control newEditorOn(Composite parent,int columnIndex,final PropertyDescriptor<?> desc,final Rule rule,final ValueChangeListener listener,SizeChangeListener sizeListener){
  if (columnIndex == 0)   return addLabel(parent,desc);
  if (columnIndex == 1) {
    final IntegerProperty ip=intPropertyFrom(desc);
    final Spinner spinner=newSpinner(parent,ip,rule.getProperty(desc));
    spinner.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent event){
        int newValue=spinner.getSelection();
        if (newValue == rule.getProperty(ip))         return;
        rule.setProperty(ip,Integer.valueOf(newValue));
        listener.changed(rule,desc,Integer.valueOf(newValue));
      }
    }
);
    return spinner;
  }
  return null;
}
Program: 22034
Project: 22034
Buggy source:
/** 
 * @param parent Composite
 * @param columnIndex int
 * @param desc PropertyDescriptor
 * @param rule Rule
 * @param listener ValueChangeListener
 * @return Control
 * @see net.sourceforge.pmd.ui.preferences.br.EditorFactory#newEditorOn(Composite,int,PropertyDescriptor,Rule)
 */
public Control newEditorOn(Composite parent,int columnIndex,final PropertyDescriptor<?> desc,final Rule rule,final ValueChangeListener listener,SizeChangeListener sizeListener){
  if (columnIndex == 0)   return addLabel(parent,desc);
  if (columnIndex == 1) {
    final MethodPicker picker=new MethodPicker(parent,SWT.SINGLE | SWT.BORDER,unwantedPrefixes);
    picker.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    fillWidget(picker,desc,rule);
    final MethodProperty mp=methodPropertyFrom(desc);
    picker.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        Method newValue=picker.getMethod();
        if (newValue == null)         return;
        Method existingValue=rule.getProperty(mp);
        if (existingValue == newValue)         return;
        rule.setProperty(mp,newValue);
        fillWidget(picker,desc,rule);
        listener.changed(rule,desc,newValue);
      }
    }
);
    return picker;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param parent Composite
 * @param columnIndex int
 * @param desc PropertyDescriptor
 * @param rule Rule
 * @param listener ValueChangeListener
 * @return Control
 * @see net.sourceforge.pmd.ui.preferences.br.EditorFactory#newEditorOn(Composite,int,PropertyDescriptor,Rule)
 */
public Control newEditorOn(Composite parent,int columnIndex,final PropertyDescriptor<?> desc,final Rule rule,final ValueChangeListener listener,SizeChangeListener sizeListener){
  if (columnIndex == 0)   return addLabel(parent,desc);
  if (columnIndex == 1) {
    final MethodPicker picker=new MethodPicker(parent,SWT.SINGLE | SWT.BORDER,UnwantedPrefixes);
    picker.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    fillWidget(picker,desc,rule);
    final MethodProperty mp=methodPropertyFrom(desc);
    picker.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        Method newValue=picker.getMethod();
        if (newValue == null)         return;
        Method existingValue=rule.getProperty(mp);
        if (existingValue == newValue)         return;
        rule.setProperty(mp,newValue);
        fillWidget(picker,desc,rule);
        listener.changed(rule,desc,newValue);
      }
    }
);
    return picker;
  }
  return null;
}
Program: 22035
Project: 22035
Buggy source:
public void setMethod(Method method){
  ;
  Class<?> cls=method.getDeclaringClass();
  typeText.setType(cls);
  reviseMethodListFor(cls);
  methodList.select(indexOf(method));
}

Fixed version (ground truth):
public void setMethod(Method method){
  if (method == null) {
    typeText.setType(null);
    return;
  }
  Class<?> cls=method.getDeclaringClass();
  typeText.setType(cls);
  reviseMethodListFor(cls);
  methodList.select(indexOf(method));
}
Program: 22036
Project: 22036
Buggy source:
private void reviseMethodListFor(Class<?> cls){
  if (cls == null) {
    methodList.removeAll();
    methodList.setEnabled(false);
    return;
  }
  methodList.setEnabled(true);
  methods=cls.getMethods();
  String[] items=new String[methods.length];
  for (int i=0; i < methods.length; i++)   items[i]=Util.signatureFor(methods[i],unwantedPrefixes);
  methodList.setItems(items);
  methodList.select(0);
}

Fixed version (ground truth):
private void reviseMethodListFor(Class<?> cls){
  if (cls == null) {
    methodList.removeAll();
    methodList.setEnabled(false);
    return;
  }
  methodList.setEnabled(true);
  methods=cls.getMethods();
  Arrays.sort(methods,Util.MethodNameComparator);
  String[] items=new String[methods.length];
  for (int i=0; i < methods.length; i++)   items[i]=Util.signatureFor(methods[i],unwantedPrefixes);
  methodList.setItems(items);
  methodList.select(0);
}
Program: 22037
Project: 22037
Buggy source:
public MethodPicker(Composite parent,int style,String[] theUnwantedPrefixes){
  super(parent,SWT.None);
  unwantedPrefixes=theUnwantedPrefixes == null ? StringUtil.EMPTY_STRINGS : theUnwantedPrefixes;
  GridLayout layout=new GridLayout(2,true);
  layout.verticalSpacing=0;
  layout.horizontalSpacing=0;
  layout.marginHeight=0;
  layout.marginWidth=0;
  this.setLayout(layout);
  typeText=new TypeText(this,style);
  typeText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  typeText.addListener(SWT.FocusOut,new Listener(){
    public void handleEvent(    Event event){
      reviseMethodListFor(typeText.getType(true));
    }
  }
);
  methodList=new Combo(this,style);
  methodList.setLayoutData(new GridData(GridData.FILL_BOTH));
}

Fixed version (ground truth):
public MethodPicker(Composite parent,int style,String[] theUnwantedPrefixes){
  super(parent,SWT.None);
  unwantedPrefixes=theUnwantedPrefixes == null ? StringUtil.EMPTY_STRINGS : theUnwantedPrefixes;
  GridLayout layout=new GridLayout(2,true);
  layout.verticalSpacing=0;
  layout.horizontalSpacing=0;
  layout.marginHeight=0;
  layout.marginWidth=0;
  this.setLayout(layout);
  typeText=new TypeText(this,style,false);
  typeText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  typeText.addListener(SWT.FocusOut,new Listener(){
    public void handleEvent(    Event event){
      reviseMethodListFor(typeText.getType(true));
    }
  }
);
  methodList=new Combo(this,style);
  methodList.setLayoutData(new GridData(GridData.FILL_BOTH));
}
Program: 22038
Project: 22038
Buggy source:
protected Control addWidget(Composite parent,Object value,PropertyDescriptor<?> desc,Rule rule){
  final Spinner spinner=new Spinner(parent,SWT.SINGLE | SWT.BORDER);
  final NumericPropertyDescriptor<?> ip=numericPropertyFrom(desc);
  spinner.setMinimum(ip.lowerLimit().intValue());
  spinner.setMaximum(ip.upperLimit().intValue());
  setValue(spinner,value);
  return spinner;
}

Fixed version (ground truth):
protected Control addWidget(Composite parent,Object value,PropertyDescriptor<?> desc,Rule rule){
  NumericPropertyDescriptor<?> ip=numericPropertyFrom(desc);
  return IntegerEditorFactory.newSpinner(parent,ip,value);
}
Program: 22039
Project: 22039
Buggy source:
public void handleEvent(Event event){
  Class<?> newValue=typeText.getType(true);
  if (newValue == null)   return;
  Class<?> existingValue=rule.getProperty(tp);
  if (existingValue == newValue)   return;
  rule.setProperty(tp,newValue);
  fillWidget(typeText,desc,rule);
  listener.changed(rule,desc,newValue);
}

Fixed version (ground truth):
public void handleEvent(Event event){
  Class<?> newValue=typeText.getType(true);
  if (newValue == null)   return;
  Class<?> existingValue=rule.getProperty(tp);
  if (existingValue == newValue)   return;
  rule.setProperty(tp,newValue);
  listener.changed(rule,desc,newValue);
}
Program: 22040
Project: 22040
Buggy source:
/** 
 * @param parent Composite
 * @param columnIndex int
 * @param desc PropertyDescriptor
 * @param rule Rule
 * @param listener ValueChangeListener
 * @return Control
 * @see net.sourceforge.pmd.ui.preferences.br.EditorFactory#newEditorOn(Composite,int,PropertyDescriptor,Rule)
 */
public Control newEditorOn(Composite parent,int columnIndex,final PropertyDescriptor<?> desc,final Rule rule,final ValueChangeListener listener,SizeChangeListener sizeListener){
  if (columnIndex == 0)   return addLabel(parent,desc);
  if (columnIndex == 1) {
    final TypeText typeText=new TypeText(parent,SWT.SINGLE | SWT.BORDER);
    typeText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    fillWidget(typeText,desc,rule);
    final TypeProperty tp=typePropertyFrom(desc);
    typeText.addListener(SWT.FocusOut,new Listener(){
      public void handleEvent(      Event event){
        Class<?> newValue=typeText.getType(true);
        if (newValue == null)         return;
        Class<?> existingValue=rule.getProperty(tp);
        if (existingValue == newValue)         return;
        rule.setProperty(tp,newValue);
        fillWidget(typeText,desc,rule);
        listener.changed(rule,desc,newValue);
      }
    }
);
    return typeText;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param parent Composite
 * @param columnIndex int
 * @param desc PropertyDescriptor
 * @param rule Rule
 * @param listener ValueChangeListener
 * @return Control
 * @see net.sourceforge.pmd.ui.preferences.br.EditorFactory#newEditorOn(Composite,int,PropertyDescriptor,Rule)
 */
public Control newEditorOn(Composite parent,int columnIndex,final PropertyDescriptor<?> desc,final Rule rule,final ValueChangeListener listener,SizeChangeListener sizeListener){
  if (columnIndex == 0)   return addLabel(parent,desc);
  if (columnIndex == 1) {
    final TypeText typeText=new TypeText(parent,SWT.SINGLE | SWT.BORDER,true);
    typeText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    fillWidget(typeText,desc,rule);
    final TypeProperty tp=typePropertyFrom(desc);
    typeText.addListener(SWT.FocusOut,new Listener(){
      public void handleEvent(      Event event){
        Class<?> newValue=typeText.getType(true);
        if (newValue == null)         return;
        Class<?> existingValue=rule.getProperty(tp);
        if (existingValue == newValue)         return;
        rule.setProperty(tp,newValue);
        listener.changed(rule,desc,newValue);
      }
    }
);
    return typeText;
  }
  return null;
}
Program: 22041
Project: 22041
Buggy source:
/** 
 * Method setupTreeColumns.
 * @param columnDescs RuleColumnDescriptor[]
 * @param groupingField RuleFieldAccessor
 */
private void setupTreeColumns(RuleColumnDescriptor[] columnDescs,RuleFieldAccessor groupingField){
  Tree ruleTree=cleanupRuleTree();
  for (int i=0; i < columnDescs.length; i++)   columnDescs[i].newTreeColumnFor(ruleTree,i,this,paintListeners);
  ruleTreeViewer.setLabelProvider(new RuleLabelProvider(columnDescs));
  ruleTreeViewer.setContentProvider(new RuleSetTreeItemProvider(groupingField,"String_Node_Str",Util.comparatorFrom(columnSorter,sortDescending)));
  populateRuleTable();
  TreeColumn[] columns=ruleTree.getColumns();
  for (  TreeColumn column : columns)   column.pack();
}

Fixed version (ground truth):
/** 
 * Method setupTreeColumns.
 * @param columnDescs RuleColumnDescriptor[]
 * @param groupingField RuleFieldAccessor
 */
private void setupTreeColumns(RuleColumnDescriptor[] columnDescs,RuleFieldAccessor groupingField){
  Tree ruleTree=cleanupRuleTree();
  for (int i=0; i < columnDescs.length; i++)   columnDescs[i].newTreeColumnFor(ruleTree,i,this,paintListeners);
  ruleTreeViewer.setLabelProvider(new RuleLabelProvider(columnDescs));
  ruleTreeViewer.setContentProvider(new RuleSetTreeItemProvider(groupingField,"String_Node_Str",Util.comparatorFrom(columnSorter,sortDescending)));
  TreeColumn[] columns=ruleTree.getColumns();
  for (  TreeColumn column : columns)   column.pack();
}
Program: 22042
Project: 22042
Buggy source:
public List<Rule> allRules(){
  List<Rule> selections=new ArrayList<Rule>();
  if (ruleItems == null || ruleItems.length == 0) {
    return selections;
  }
  for (  Object ruleItem : ruleItems) {
    if (ruleItem instanceof Rule) {
      selections.add((Rule)ruleItem);
      continue;
    }
 else {
      Rule[] rules=((RuleGroup)ruleItem).rules();
      for (int r=0; r < rules.length; r++)       selections.add(rules[r]);
    }
  }
  return selections;
}

Fixed version (ground truth):
public List<Rule> allRules(){
  List<Rule> selections=new ArrayList<Rule>();
  if (ruleItems == null || ruleItems.length == 0) {
    return selections;
  }
  for (  Object ruleItem : ruleItems) {
    if (ruleItem instanceof Rule) {
      selections.add((Rule)ruleItem);
      continue;
    }
 else {
      Rule[] rules=((RuleGroup)ruleItem).rules();
      for (      Rule rule : rules)       selections.add(rule);
    }
  }
  return selections;
}
Program: 22043
Project: 22043
Buggy source:
public void changed(RuleSelection selection,PropertyDescriptor<?> desc,Object newValue){
  modified=true;
  for (  Rule rule : selection.allRules())   ruleTreeViewer.update(rule,null);
  for (  RulePropertyManager manager : rulePropertyManagers) {
    manager.validate();
  }
}

Fixed version (ground truth):
public void changed(RuleSelection selection,PropertyDescriptor<?> desc,Object newValue){
  modified=true;
  for (  Rule rule : selection.allRules()) {
    if (newValue != null) {
      ruleTreeViewer.getTree().redraw();
    }
 else {
      ruleTreeViewer.update(rule,null);
    }
  }
  for (  RulePropertyManager manager : rulePropertyManagers) {
    manager.validate();
  }
}
Program: 22044
Project: 22044
Buggy source:
public void modifyText(ModifyEvent e){
  colourWindow.setBackground(colourManager.colourFor(control.getText()));
  changeListener.changed(rules,null,null);
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  String newText=control.getText();
  colourWindow.setBackground(colourManager.colourFor(newText));
  changed(desc,newText);
}
Program: 22045
Project: 22045
Buggy source:
private void addListeners(final Text control,final StringProperty desc,final Control colourWindow){
  addTextListeners(control,desc);
  control.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      colourWindow.setBackground(colourManager.colourFor(control.getText()));
      changeListener.changed(rules,null,null);
    }
  }
);
}

Fixed version (ground truth):
private void addListeners(final Text control,final StringProperty desc,final Control colourWindow){
  addTextListeners(control,desc);
  control.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      String newText=control.getText();
      colourWindow.setBackground(colourManager.colourFor(newText));
      changed(desc,newText);
    }
  }
);
}
Program: 22046
Project: 22046
Buggy source:
/** 
 * @param parent Composite
 * @param columnIndex int
 * @param desc PropertyDescriptor
 * @param rule Rule
 * @param listener ValueChangeListener
 * @return Control
 * @see net.sourceforge.pmd.ui.preferences.br.EditorFactory#newEditorOn(Composite,int,PropertyDescriptor,Rule)
 */
public Control newEditorOn(Composite parent,int columnIndex,final PropertyDescriptor<?> desc,final Rule rule,final ValueChangeListener listener){
  if (columnIndex == 0)   return addLabel(parent,desc);
  if (columnIndex == 1) {
    Composite panel=new Composite(parent,SWT.NONE);
    panel.setLayout(new GridLayout(2,false));
    Text textWidget=new Text(panel,SWT.SINGLE | SWT.BORDER);
    textWidget.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    fillWidget(textWidget,desc,rule);
    configure(textWidget,desc,rule,listener);
    return panel;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param parent Composite
 * @param columnIndex int
 * @param desc PropertyDescriptor
 * @param rule Rule
 * @param listener ValueChangeListener
 * @return Control
 * @see net.sourceforge.pmd.ui.preferences.br.EditorFactory#newEditorOn(Composite,int,PropertyDescriptor,Rule)
 */
public Control newEditorOn(Composite parent,int columnIndex,final PropertyDescriptor<?> desc,final Rule rule,final ValueChangeListener listener){
  if (columnIndex == 0)   return addLabel(parent,desc);
  if (columnIndex == 1) {
    final Text textWidget=new Text(parent,SWT.SINGLE | SWT.BORDER);
    GridData gridData=new GridData();
    gridData.horizontalAlignment=SWT.FILL;
    gridData.grabExcessHorizontalSpace=true;
    textWidget.setLayoutData(gridData);
    fillWidget(textWidget,desc,rule);
    configure(textWidget,desc,rule,listener);
    return textWidget;
  }
  return null;
}
Program: 22047
Project: 22047
Buggy source:
/** 
 * @param property StringProperty
 * @param newValue String
 */
protected void changed(StringProperty property,String newValue){
  if (currentRule == null)   return;
  String cleanValue=newValue.trim();
  String existingValue=currentRule.getProperty(property);
  if (StringUtil.areSemanticEquals(existingValue,cleanValue))   return;
  currentRule.setProperty(property,cleanValue);
  changeListener.changed(currentRule,property,cleanValue);
}

Fixed version (ground truth):
/** 
 * @param property StringProperty
 * @param newValue String
 */
protected void changed(StringProperty property,String newValue){
  if (rules == null)   return;
  String cleanValue=newValue.trim();
  String existingValue=rules.commonStringValue(property);
  if (StringUtil.areSemanticEquals(existingValue,cleanValue))   return;
  rules.setValue(property,cleanValue);
  changeListener.changed(rules,property,cleanValue);
}
Program: 22048
Project: 22048
Buggy source:
public Control setupOn(Composite parent){
  descriptionBox=buildDescriptionBox(parent);
  descriptionBox.addListener(SWT.FocusOut,new Listener(){
    public void handleEvent(    Event event){
      if (currentRule == null)       return;
      String cleanValue=descriptionBox.getText().trim();
      String existingValue=currentRule.getDescription();
      if (StringUtil.areSemanticEquals(existingValue,cleanValue))       return;
      currentRule.setDescription(cleanValue);
      changeListener.changed(currentRule,null,cleanValue);
    }
  }
);
  return descriptionBox;
}

Fixed version (ground truth):
public Control setupOn(Composite parent){
  descriptionBox=buildDescriptionBox(parent);
  descriptionBox.addListener(SWT.FocusOut,new Listener(){
    public void handleEvent(    Event event){
      Rule soleRule=soleRule();
      String cleanValue=descriptionBox.getText().trim();
      String existingValue=soleRule.getDescription();
      if (StringUtil.areSemanticEquals(existingValue,cleanValue))       return;
      soleRule.setDescription(cleanValue);
      changeListener.changed(rules,null,cleanValue);
    }
  }
);
  return descriptionBox;
}
Program: 22049
Project: 22049
Buggy source:
public void handleEvent(Event event){
  if (currentRule == null)   return;
  String cleanValue=descriptionBox.getText().trim();
  String existingValue=currentRule.getDescription();
  if (StringUtil.areSemanticEquals(existingValue,cleanValue))   return;
  currentRule.setDescription(cleanValue);
  changeListener.changed(currentRule,null,cleanValue);
}

Fixed version (ground truth):
public void handleEvent(Event event){
  Rule soleRule=soleRule();
  String cleanValue=descriptionBox.getText().trim();
  String existingValue=soleRule.getDescription();
  if (StringUtil.areSemanticEquals(existingValue,cleanValue))   return;
  soleRule.setDescription(cleanValue);
  changeListener.changed(rules,null,cleanValue);
}
Program: 22050
Project: 22050
Buggy source:
private void clearChildren(){
  Control[] kids=parent.getChildren();
  for (int i=0; i < kids.length; i++)   kids[i].dispose();
}

Fixed version (ground truth):
public void clearChildren(){
  Control[] kids=parent.getChildren();
  for (int i=0; i < kids.length; i++)   kids[i].dispose();
  parent.pack();
  rule=null;
}
Program: 22051
Project: 22051
Buggy source:
/** 
 * Fill a properties information structure from a transfer object
 * @param projectProperties a project properties data structure
 * @param to a project properties transfer object
 */
private void fillProjectProperties(IProjectProperties projectProperties,ProjectPropertiesTO to) throws PropertiesException, CoreException {
  if (to == null) {
    log.info("String_Node_Str");
  }
 else {
    final IWorkingSetManager workingSetManager=PlatformUI.getWorkbench().getWorkingSetManager();
    projectProperties.setProjectWorkingSet(workingSetManager.getWorkingSet(to.getWorkingSetName()));
    projectProperties.setRuleSetStoredInProject(to.isRuleSetStoredInProject());
    projectProperties.setRuleSetFile(to.getRuleSetFile());
    projectProperties.setPmdEnabled(projectProperties.getProject().hasNature(PMDNature.PMD_NATURE));
    projectProperties.setIncludeDerivedFiles(to.isIncludeDerivedFiles());
    if (to.isRuleSetStoredInProject()) {
      loadRuleSetFromProject(projectProperties);
    }
 else {
      setRuleSetFromProperties(projectProperties,to.getRules());
    }
    log.debug("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Fill a properties information structure from a transfer object
 * @param projectProperties a project properties data structure
 * @param to a project properties transfer object
 */
private void fillProjectProperties(IProjectProperties projectProperties,ProjectPropertiesTO to) throws PropertiesException, CoreException {
  if (to == null) {
    log.info("String_Node_Str");
  }
 else {
    final IWorkingSetManager workingSetManager=PlatformUI.getWorkbench().getWorkingSetManager();
    projectProperties.setProjectWorkingSet(workingSetManager.getWorkingSet(to.getWorkingSetName()));
    projectProperties.setRuleSetFile(to.getRuleSetFile());
    projectProperties.setRuleSetStoredInProject(to.isRuleSetStoredInProject());
    projectProperties.setPmdEnabled(projectProperties.getProject().hasNature(PMDNature.PMD_NATURE));
    projectProperties.setIncludeDerivedFiles(to.isIncludeDerivedFiles());
    if (to.isRuleSetStoredInProject()) {
      loadRuleSetFromProject(projectProperties);
    }
 else {
      setRuleSetFromProperties(projectProperties,to.getRules());
    }
    log.debug("String_Node_Str");
  }
}
Program: 22052
Project: 22052
Buggy source:
/** 
 * @param property StringProperty
 * @param newValue String
 */
protected void changed(StringProperty property,String newValue){
  if (currentRule == null)   return;
  String cleanValue=newValue.trim();
  String existingValue=currentRule.getProperty(property);
  if (StringUtil.areSemanticEquals(existingValue,cleanValue))   return;
  currentRule.setProperty(property,cleanValue);
  changeListener.changed(property,cleanValue);
}

Fixed version (ground truth):
/** 
 * @param property StringProperty
 * @param newValue String
 */
protected void changed(StringProperty property,String newValue){
  if (currentRule == null)   return;
  String cleanValue=newValue.trim();
  String existingValue=currentRule.getProperty(property);
  if (StringUtil.areSemanticEquals(existingValue,cleanValue))   return;
  currentRule.setProperty(property,cleanValue);
  changeListener.changed(currentRule,property,cleanValue);
}
Program: 22053
Project: 22053
Buggy source:
public void widgetSelected(SelectionEvent event){
  boolean selected=butt.getSelection();
  if (selected == rule.getProperty(bp))   return;
  rule.setProperty(bp,Boolean.valueOf(selected));
  listener.changed(desc,Boolean.valueOf(selected));
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent event){
  boolean selected=butt.getSelection();
  if (selected == rule.getProperty(bp))   return;
  rule.setProperty(bp,Boolean.valueOf(selected));
  listener.changed(rule,desc,Boolean.valueOf(selected));
}
Program: 22054
Project: 22054
Buggy source:
/** 
 * Method newEditorOn.
 * @param parent Composite
 * @param columnIndex int
 * @param desc PropertyDescriptor
 * @param rule Rule
 * @return Control
 * @see net.sourceforge.pmd.ui.preferences.br.EditorFactory#newEditorOn(Composite,int,PropertyDescriptor,Rule)
 */
public Control newEditorOn(Composite parent,int columnIndex,final PropertyDescriptor<?> desc,final Rule rule,final ValueChangeListener listener){
  if (columnIndex == 0)   return addLabel(parent,desc);
  if (columnIndex == 1) {
    final Button butt=new Button(parent,SWT.CHECK);
    butt.setText("String_Node_Str");
    final BooleanProperty bp=booleanPropertyFrom(desc);
    boolean set=((Boolean)rule.getProperty(desc)).booleanValue();
    butt.setSelection(set);
    butt.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent event){
        boolean selected=butt.getSelection();
        if (selected == rule.getProperty(bp))         return;
        rule.setProperty(bp,Boolean.valueOf(selected));
        listener.changed(desc,Boolean.valueOf(selected));
      }
    }
);
    return butt;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Method newEditorOn.
 * @param parent Composite
 * @param columnIndex int
 * @param desc PropertyDescriptor
 * @param rule Rule
 * @return Control
 * @see net.sourceforge.pmd.ui.preferences.br.EditorFactory#newEditorOn(Composite,int,PropertyDescriptor,Rule)
 */
public Control newEditorOn(Composite parent,int columnIndex,final PropertyDescriptor<?> desc,final Rule rule,final ValueChangeListener listener){
  if (columnIndex == 0)   return addLabel(parent,desc);
  if (columnIndex == 1) {
    final Button butt=new Button(parent,SWT.CHECK);
    butt.setText("String_Node_Str");
    final BooleanProperty bp=booleanPropertyFrom(desc);
    boolean set=((Boolean)rule.getProperty(desc)).booleanValue();
    butt.setSelection(set);
    butt.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent event){
        boolean selected=butt.getSelection();
        if (selected == rule.getProperty(bp))         return;
        rule.setProperty(bp,Boolean.valueOf(selected));
        listener.changed(rule,desc,Boolean.valueOf(selected));
      }
    }
);
    return butt;
  }
  return null;
}
Program: 22055
Project: 22055
Buggy source:
void addPainterFor(Tree tree,int columnIndex,RuleFieldAccessor getter);

Fixed version (ground truth):
void addPainterFor(Tree tree,int columnIndex,RuleFieldAccessor getter,Map<Integer,List<Listener>> listenersByEventCode);
Program: 22056
Project: 22056
Buggy source:
public void handleEvent(Event event){
  Character newValue=charValueIn(text);
  Character existingValue=rule.getProperty(cp);
  if (existingValue.equals(newValue))   return;
  rule.setProperty(cp,newValue);
  listener.changed(cp,newValue);
}

Fixed version (ground truth):
public void handleEvent(Event event){
  Character newValue=charValueIn(text);
  Character existingValue=rule.getProperty(cp);
  if (existingValue.equals(newValue))   return;
  rule.setProperty(cp,newValue);
  listener.changed(rule,cp,newValue);
}
Program: 22057
Project: 22057
Buggy source:
public Control newEditorOn(Composite parent,int columnIndex,PropertyDescriptor<?> desc,final Rule rule,final ValueChangeListener listener){
  if (columnIndex == 0)   return addLabel(parent,desc);
  if (columnIndex == 1) {
    final Text text=new Text(parent,SWT.SINGLE | SWT.BORDER);
    fillWidget(text,desc,rule);
    final CharacterProperty cp=characterPropertyFrom(desc);
    text.addListener(SWT.FocusOut,new Listener(){
      public void handleEvent(      Event event){
        Character newValue=charValueIn(text);
        Character existingValue=rule.getProperty(cp);
        if (existingValue.equals(newValue))         return;
        rule.setProperty(cp,newValue);
        listener.changed(cp,newValue);
      }
    }
);
    return text;
  }
  return null;
}

Fixed version (ground truth):
public Control newEditorOn(Composite parent,int columnIndex,PropertyDescriptor<?> desc,final Rule rule,final ValueChangeListener listener){
  if (columnIndex == 0)   return addLabel(parent,desc);
  if (columnIndex == 1) {
    final Text text=new Text(parent,SWT.SINGLE | SWT.BORDER);
    fillWidget(text,desc,rule);
    final CharacterProperty cp=characterPropertyFrom(desc);
    text.addListener(SWT.FocusOut,new Listener(){
      public void handleEvent(      Event event){
        Character newValue=charValueIn(text);
        Character existingValue=rule.getProperty(cp);
        if (existingValue.equals(newValue))         return;
        rule.setProperty(cp,newValue);
        listener.changed(rule,cp,newValue);
      }
    }
);
    return text;
  }
  return null;
}
Program: 22058
Project: 22058
Buggy source:
public Control setupOn(Composite parent){
  descriptionBox=buildDescriptionBox(parent);
  descriptionBox.addListener(SWT.FocusOut,new Listener(){
    public void handleEvent(    Event event){
      if (currentRule == null)       return;
      String cleanValue=descriptionBox.getText().trim();
      String existingValue=currentRule.getDescription();
      if (StringUtil.areSemanticEquals(existingValue,cleanValue))       return;
      currentRule.setDescription(cleanValue);
      changeListener.changed(null,cleanValue);
    }
  }
);
  return descriptionBox;
}

Fixed version (ground truth):
public Control setupOn(Composite parent){
  descriptionBox=buildDescriptionBox(parent);
  descriptionBox.addListener(SWT.FocusOut,new Listener(){
    public void handleEvent(    Event event){
      if (currentRule == null)       return;
      String cleanValue=descriptionBox.getText().trim();
      String existingValue=currentRule.getDescription();
      if (StringUtil.areSemanticEquals(existingValue,cleanValue))       return;
      currentRule.setDescription(cleanValue);
      changeListener.changed(currentRule,null,cleanValue);
    }
  }
);
  return descriptionBox;
}
Program: 22059
Project: 22059
Buggy source:
public void handleEvent(Event event){
  if (currentRule == null)   return;
  String cleanValue=descriptionBox.getText().trim();
  String existingValue=currentRule.getDescription();
  if (StringUtil.areSemanticEquals(existingValue,cleanValue))   return;
  currentRule.setDescription(cleanValue);
  changeListener.changed(null,cleanValue);
}

Fixed version (ground truth):
public void handleEvent(Event event){
  if (currentRule == null)   return;
  String cleanValue=descriptionBox.getText().trim();
  String existingValue=currentRule.getDescription();
  if (StringUtil.areSemanticEquals(existingValue,cleanValue))   return;
  currentRule.setDescription(cleanValue);
  changeListener.changed(currentRule,null,cleanValue);
}
Program: 22060
Project: 22060
Buggy source:
public void modifyText(ModifyEvent event){
  int newValue=spinner.getSelection();
  if (newValue == rule.getProperty(ip))   return;
  rule.setProperty(ip,Integer.valueOf(newValue));
  listener.changed(desc,Integer.valueOf(newValue));
}

Fixed version (ground truth):
public void modifyText(ModifyEvent event){
  int newValue=spinner.getSelection();
  if (newValue == rule.getProperty(ip))   return;
  rule.setProperty(ip,Integer.valueOf(newValue));
  listener.changed(rule,desc,Integer.valueOf(newValue));
}