nus-yam/ex-repair huggingface dataset:
Program: 32677
Project: 32677
Buggy source:
/** 
 * Prints the tree by its contents.
 */
public String toString(){
  String leftString=left == null ? "String_Node_Str" : left.toString();
  String valueString=value instanceof IndexedTreeNode ? "String_Node_Str" + ((IndexedTreeNode)value).getIndex() : value.toString();
  String rightString=right == null ? "String_Node_Str" : right.toString();
  return "String_Node_Str" + leftString + "String_Node_Str"+ valueString+ "String_Node_Str"+ rightString+ "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Prints the tree by its contents.
 */
public String toString(){
  String valueString=value instanceof IndexedTreeNode ? "String_Node_Str" + ((IndexedTreeNode)value).getIndex() : value.toString();
  int index=getIndex();
  return "String_Node_Str" + index + "String_Node_Str"+ valueString;
}
Program: 32678
Project: 32678
Buggy source:
/** 
 * Convert an index from view to source.
 */
protected int getSourceIndex(int mutationIndex){
  for (int i=0; i < source.size(); i++) {
    if (fromSourceIndex(i) == mutationIndex) {
      return i;
    }
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * Convert an index from view to source.
 * @return the index into the source list if this corresponds to aregular element. If this corresponds to a separator, the index of that separator will be returned.
 */
protected int getSourceIndex(int transformedIndex){
  throw new UnsupportedOperationException();
}
Program: 32679
Project: 32679
Buggy source:
public void groupChanged(int index,int groupIndex,int groupChangeType,boolean primary,int elementChangeType){
  if (primary) {
    updates.addChange(elementChangeType,fromSourceIndex(index));
  }
  updates.addChange(groupChangeType,fromGroupIndex(groupIndex));
}

Fixed version (ground truth):
public void groupChanged(int index,int groupIndex,int groupChangeType,boolean primary,int elementChangeType){
  if (groupChangeType == ListEvent.DELETE) {
    if (primary) {
      int outputIndex=separatorsBarcode.getIndex(index,REGULAR);
      if (elementChangeType == ListEvent.UPDATE) {
        updates.addChange(ListEvent.UPDATE,outputIndex);
      }
 else       if (elementChangeType == ListEvent.DELETE) {
        separatorsBarcode.remove(outputIndex,1);
        updates.addChange(ListEvent.DELETE,outputIndex);
      }
 else {
        throw new IllegalStateException();
      }
    }
    int separatorIndex=separatorsBarcode.getIndex(groupIndex,SEPARATOR);
    separatorsBarcode.remove(separatorIndex,1);
    updates.addChange(ListEvent.DELETE,separatorIndex);
  }
 else   if (groupChangeType == ListEvent.UPDATE) {
    throw new UnsupportedOperationException();
  }
 else   if (groupChangeType == ListEvent.INSERT) {
    throw new UnsupportedOperationException();
  }
}
Program: 32680
Project: 32680
Buggy source:
private SeparatorList(SortedList<E> source,Comparator comparator,Void dummyParameter){
  super(source);
  GrouperClient grouperClient=new GrouperClient();
  this.grouper=new Grouper<E>(source,grouperClient);
  source.addListEventListener(this);
}

Fixed version (ground truth):
private SeparatorList(SortedList<E> source,Comparator comparator,Void dummyParameter){
  super(source);
  GrouperClient grouperClient=new GrouperClient();
  this.grouper=new Grouper<E>(source,grouperClient);
  separatorsBarcode.add(0,REGULAR,source.size());
  for (BarcodeIterator i=grouper.getBarcode().iterator(); i.hasNextColour(Grouper.UNIQUE); ) {
    i.nextColour(Grouper.UNIQUE);
    separatorsBarcode.add(i.getIndex(),SEPARATOR,1);
  }
  source.addListEventListener(this);
}
Program: 32681
Project: 32681
Buggy source:
private void insertLogicalRow(int index){
  int baseRow=logicalToLayoutRow(index);
  if (gridComponents.size() > 1 && gapRow != null) {
    insertRow(baseRow,gapRow);
    baseRow+=1;
  }
  for (int r=0; r < rowSpecs.length; r++) {
    insertRow(baseRow + r,rowSpecs[r]);
  }
}

Fixed version (ground truth):
private void insertLogicalRow(int index){
  int baseRow=logicalToLayoutRow(index);
  if (index != 0 && gapRow != null) {
    insertRow(baseRow,gapRow);
    baseRow+=1;
  }
  for (int r=0; r < rowSpecs.length; r++) {
    insertRow(baseRow + r,rowSpecs[r]);
  }
}
Program: 32682
Project: 32682
Buggy source:
private void removeLogicalColumn(int index){
  int baseColumn=logicalToLayoutColumn(index);
  if (gridComponents.size() > 1 && gapColumn != null) {
    formLayout.removeColumn(baseColumn + 1);
  }
  for (int c=0; c < columnSpecs.length; c++) {
    formLayout.removeColumn(baseColumn + 1);
  }
}

Fixed version (ground truth):
private void removeLogicalColumn(int index){
  int baseColumn=logicalToLayoutColumn(index);
  if (index != 0 && gapColumn != null) {
    formLayout.removeColumn(baseColumn + 1);
  }
  for (int c=0; c < columnSpecs.length; c++) {
    formLayout.removeColumn(baseColumn + 1);
  }
}
Program: 32683
Project: 32683
Buggy source:
public void removeIndex(int index){
  int logicalColumnCountBefore=logicalColumnCount();
  int logicalRowCountBefore=logicalRowCount();
  gridComponents.remove(index);
  int logicalColumnCountAfter=logicalColumnCount();
  int logicalRowCountAfter=logicalRowCount();
  if (logicalRowCountAfter > logicalRowCountBefore) {
    removeLogicalRow(logicalRowCountAfter);
  }
  if (logicalColumnCountAfter > logicalColumnCountBefore) {
    removeLogicalColumn(logicalColumnCountAfter);
  }
  reassignConstraints();
}

Fixed version (ground truth):
public void removeIndex(int index){
  int logicalColumnCountBefore=logicalColumnCount();
  int logicalRowCountBefore=logicalRowCount();
  gridComponents.remove(index);
  reassignConstraints();
  int logicalColumnCountAfter=logicalColumnCount();
  int logicalRowCountAfter=logicalRowCount();
  if (logicalRowCountAfter < logicalRowCountBefore) {
    removeLogicalRow(logicalRowCountAfter);
  }
  if (logicalColumnCountAfter < logicalColumnCountBefore) {
    removeLogicalColumn(logicalColumnCountAfter);
  }
}
Program: 32684
Project: 32684
Buggy source:
private void removeLogicalRow(int index){
  int baseRow=logicalToLayoutRow(index);
  if (gridComponents.size() > 1 && gapRow != null) {
    formLayout.removeRow(baseRow + 1);
  }
  for (int r=0; r < rowSpecs.length; r++) {
    formLayout.removeRow(baseRow + 1);
  }
}

Fixed version (ground truth):
private void removeLogicalRow(int index){
  int baseRow=logicalToLayoutRow(index);
  if (index != 0 && gapRow != null) {
    formLayout.removeRow(baseRow + 1);
  }
  for (int r=0; r < rowSpecs.length; r++) {
    formLayout.removeRow(baseRow + 1);
  }
}
Program: 32685
Project: 32685
Buggy source:
private void insertLogicalColumn(int index){
  int baseColumn=logicalToLayoutColumn(index);
  if (gridComponents.size() > 1 && gapColumn != null) {
    insertColumn(baseColumn,gapColumn);
    baseColumn+=1;
  }
  for (int c=0; c < columnSpecs.length; c++) {
    insertColumn(baseColumn + c,columnSpecs[c]);
  }
}

Fixed version (ground truth):
private void insertLogicalColumn(int index){
  int baseColumn=logicalToLayoutColumn(index);
  if (index != 0 && gapColumn != null) {
    insertColumn(baseColumn,gapColumn);
    baseColumn+=1;
  }
  for (int c=0; c < columnSpecs.length; c++) {
    insertColumn(baseColumn + c,columnSpecs[c]);
  }
}
Program: 32686
Project: 32686
Buggy source:
/** 
 * Creates an   {@link EventList} that provides a view of thedeselected items in a ListSelection.
 */
SelectedList(EventList<E> source){
  super(source);
}

Fixed version (ground truth):
/** 
 * Creates an   {@link EventList} that provides a view of theselected items in a ListSelection.
 */
SelectedList(EventList<E> source){
  super(source);
}
Program: 32687
Project: 32687
Buggy source:
/** 
 * Workaround method to get the Windows theme, either "Windows Classic" or "Windows XP". The test for Windows XP is also an ugly hack because Swing's pluggable look-and-feel provides no alternative means for determining if the current theme is XP. For compatibility, the algorithm to determine if the style is XP is derived from similar code in the XPStyle class.
 */
public static String getWindowsTheme(){
  String classic="String_Node_Str";
  String xp="String_Node_Str";
  String themeActiveKey="String_Node_Str";
  Boolean themeActive=(Boolean)java.awt.Toolkit.getDefaultToolkit().getDesktopProperty(themeActiveKey);
  if (themeActive == null)   return classic;
  if (!themeActive.booleanValue())   return classic;
  String noXPProperty="String_Node_Str";
  if (System.getProperty(noXPProperty) != null)   return classic;
  String classicLnF="String_Node_Str";
  if (UIManager.getLookAndFeel().getClass().getName().equals(classicLnF))   return "String_Node_Str";
  return xp;
}

Fixed version (ground truth):
/** 
 * Workaround method to get the Windows theme, either "Windows Classic" or "Windows XP". The test for Windows XP is also an ugly hack because Swing's pluggable look-and-feel provides no alternative means for determining if the current theme is XP. For compatibility, the algorithm to determine if the style is XP is derived from similar code in the XPStyle class.
 */
public static String getWindowsTheme(){
  String classic="String_Node_Str";
  String xp="String_Node_Str";
  String themeActiveKey="String_Node_Str";
  Boolean themeActive=(Boolean)java.awt.Toolkit.getDefaultToolkit().getDesktopProperty(themeActiveKey);
  if (themeActive == null)   return classic;
  if (!themeActive.booleanValue())   return classic;
  String noXPProperty="String_Node_Str";
  try {
    if (System.getProperty(noXPProperty) != null)     return classic;
  }
 catch (  AccessControlException e) {
  }
  String classicLnF="String_Node_Str";
  if (UIManager.getLookAndFeel().getClass().getName().equals(classicLnF))   return "String_Node_Str";
  return xp;
}
Program: 32688
Project: 32688
Buggy source:
/** 
 * Creates a new issue that uses the specified issue as a template.
 */
public Issue(Project owner,Issue template){
  id=template.id;
  statusCode=template.statusCode;
  status=template.status;
  priority=template.priority;
  resolution=template.resolution;
  component=template.component;
  version=template.version;
  repPlatform=template.repPlatform;
  assignedTo=template.assignedTo;
  deltaTimestamp=template.deltaTimestamp;
  subcomponent=template.subcomponent;
  reporter=template.reporter;
  targetMilestone=template.targetMilestone;
  issueType=template.issueType;
  creationTimestamp=template.creationTimestamp;
  qaContact=template.qaContact;
  statusWhiteboard=template.statusWhiteboard;
  votes=template.votes;
  operatingSystem=template.operatingSystem;
  shortDescription=template.shortDescription;
  keywords.addAll(template.keywords);
  blocks.addAll(template.blocks);
  dependsOn.addAll(template.dependsOn);
  cc.addAll(template.cc);
  descriptions.addAll(template.descriptions);
  attachments.addAll(template.attachments);
  activities.addAll(template.activities);
}

Fixed version (ground truth):
/** 
 * Creates a new issue that uses the specified issue as a template.
 */
public Issue(Project owner,Issue template){
  this.owner=owner;
  id=template.id;
  statusCode=template.statusCode;
  status=template.status;
  priority=template.priority;
  resolution=template.resolution;
  component=template.component;
  version=template.version;
  repPlatform=template.repPlatform;
  assignedTo=template.assignedTo;
  deltaTimestamp=template.deltaTimestamp;
  subcomponent=template.subcomponent;
  reporter=template.reporter;
  targetMilestone=template.targetMilestone;
  issueType=template.issueType;
  creationTimestamp=template.creationTimestamp;
  qaContact=template.qaContact;
  statusWhiteboard=template.statusWhiteboard;
  votes=template.votes;
  operatingSystem=template.operatingSystem;
  shortDescription=template.shortDescription;
  keywords.addAll(template.keywords);
  blocks.addAll(template.blocks);
  dependsOn.addAll(template.dependsOn);
  cc.addAll(template.cc);
  descriptions.addAll(template.descriptions);
  attachments.addAll(template.attachments);
  activities.addAll(template.activities);
}
Program: 32689
Project: 32689
Buggy source:
/** 
 * {@inheritDoc} 
 */
public int getEndIndex(){
  int endIndex=Math.max(sortedSource.indexOfSimulated(upperThreshold),sortedSource.lastIndexOf(new Integer(upperThreshold)) + 1);
  int startIndex=getStartIndex();
  return Math.max(startIndex,endIndex);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public int getEndIndex(){
  int endIndex=sortedSource.indexOfSimulated(new Integer(upperThreshold));
  while (endIndex < sortedSource.size() && sourceIndexToThreshold(endIndex) == upperThreshold)   endIndex++;
  return Math.max(getStartIndex(),endIndex);
}
Program: 32690
Project: 32690
Buggy source:
/** 
 * Renders the header in the default way but with the addition of an icon.
 */
public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
  final Icon iconToUse=icons[getSortingStyle(column)];
  final Component rendered;
  if (delegateRenderer instanceof SortableRenderer) {
    ((SortableRenderer)delegateRenderer).setSortIcon(iconToUse);
    rendered=delegateRenderer.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
  }
 else   if (delegateRenderer instanceof DefaultTableCellRenderer) {
    rendered=delegateRenderer.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
    if (rendered == delegateRenderer) {
      final DefaultTableCellRenderer label=(DefaultTableCellRenderer)rendered;
      label.setIcon(iconToUse);
      label.setHorizontalTextPosition(SwingConstants.LEADING);
    }
  }
 else {
    rendered=delegateRenderer.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
  }
  return rendered;
}

Fixed version (ground truth):
/** 
 * Renders the header in the default way but with the addition of an icon.
 */
public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
  final Icon sortIcon=icons[getSortingStyle(column)];
  final Component rendered;
  if (delegateRenderer instanceof SortableRenderer) {
    ((SortableRenderer)delegateRenderer).setSortIcon(sortIcon);
    rendered=delegateRenderer.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
  }
 else   if (delegateRenderer instanceof DefaultTableCellRenderer) {
    rendered=delegateRenderer.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
    if (rendered == delegateRenderer) {
      final DefaultTableCellRenderer label=(DefaultTableCellRenderer)rendered;
      label.setIcon(sortIcon);
      label.setHorizontalTextPosition(SwingConstants.LEADING);
    }
  }
 else {
    rendered=delegateRenderer.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
  }
  return rendered;
}
Program: 32691
Project: 32691
Buggy source:
/** 
 * Creates a new SortArrowHeaderRenderer that delegates most drawing to the given delegate renderer.
 */
public SortArrowHeaderRenderer(TableCellRenderer delegateRenderer){
  this.delegateRenderer=delegateRenderer;
}

Fixed version (ground truth):
/** 
 * Creates a new SortArrowHeaderRenderer that attempts to decorate the given <code>delegateRenderer</code> which a sorting icon.
 */
public SortArrowHeaderRenderer(TableCellRenderer delegateRenderer){
  this.delegateRenderer=delegateRenderer;
}
Program: 32693
Project: 32693
Buggy source:
/** 
 * A convenience method to paint a gradient between <code>gradientStartColor</code> and <code>gradientEndColor</code> over <code>height</code> pixels.
 */
private static void paintGradient(Graphics2D g2d,Color gradientStartColor,Color gradientEndColor,int length,boolean vertical){
  final Paint oldPainter=g2d.getPaint();
  try {
    if (vertical)     g2d.setPaint(new GradientPaint(0,0,gradientStartColor,0,length,gradientEndColor));
 else     g2d.setPaint(new GradientPaint(0,0,gradientStartColor,length,0,gradientEndColor));
    g2d.fill(g2d.getClip());
  }
  finally {
    g2d.setPaint(oldPainter);
  }
}

Fixed version (ground truth):
/** 
 * A convenience method to paint a gradient between <code>gradientStartColor</code> and <code>gradientEndColor</code> over <code>length</code> pixels.
 */
private static void paintGradient(Graphics2D g2d,Color gradientStartColor,Color gradientEndColor,int length,boolean vertical){
  final Paint oldPainter=g2d.getPaint();
  try {
    if (vertical)     g2d.setPaint(new GradientPaint(0,0,gradientStartColor,0,length,gradientEndColor));
 else     g2d.setPaint(new GradientPaint(0,0,gradientStartColor,length,0,gradientEndColor));
    g2d.fill(g2d.getClip());
  }
  finally {
    g2d.setPaint(oldPainter);
  }
}
Program: 32695
Project: 32695
Buggy source:
/** 
 * Gets the white index of the element with the given real index or the white index of the previous or next WHITE element if that element is BLACK.
 * @param left true for BLACK elements to return the white index of thefirst WHITE element before it in the list. Such values will range from <code>-1</code> through <code>size()-1</code>. False for BLACK elements to return the white index of the first WHITE element after it in the list. Such values will range from <code>0</code> through <code>size()</code>.
 */
public int getWhiteIndex(int index,boolean left){
  if (root == null || index >= treeSize)   return index;
 else   return root.getWhiteIndex(index,left);
}

Fixed version (ground truth):
/** 
 * Gets the white index of the element with the given real index or the white index of the previous or next WHITE element if that element is BLACK.
 * @param left true for BLACK elements to return the white index of thefirst WHITE element before it in the list. Such values will range from <code>-1</code> through <code>size()-1</code>. False for BLACK elements to return the white index of the first WHITE element after it in the list. Such values will range from <code>0</code> through <code>size()</code>.
 */
public int getWhiteIndex(int index,boolean left){
  if (root == null)   return index;
 else   if (index >= treeSize)   return index - treeSize + root.whiteSize();
 else   return root.getWhiteIndex(index,left);
}
Program: 32696
Project: 32696
Buggy source:
/** 
 * Updates a row with the given value.
 */
public void updateRow(int row,Object value){
  if (!isVirtual(row)) {
    TableItem item=table.getItem(row);
    setItemText(item,value);
  }
}

Fixed version (ground truth):
/** 
 * Updates a row with the given value.
 */
public void updateRow(int row,Object value){
  if (!isVirtual(row)) {
    requested.setBlack(row,1);
    TableItem item=table.getItem(row);
    setItemText(item,value);
  }
}
Program: 32697
Project: 32697
Buggy source:
/** 
 * Adds a row with the given value.
 */
public void addRow(int row,Object value){
  if (row <= getLastIndex()) {
    TableItem item=new TableItem(table,0,row);
    setItemText(item,value);
  }
 else {
    table.setItemCount(table.getItemCount() + 1);
  }
}

Fixed version (ground truth):
/** 
 * Adds a row with the given value.
 */
public void addRow(int row,Object value){
  if (row <= getLastIndex()) {
    requested.addBlack(row,1);
    TableItem item=new TableItem(table,0,row);
    setItemText(item,value);
  }
 else {
    requested.addWhite(requested.size(),1);
    table.setItemCount(table.getItemCount() + 1);
  }
}
Program: 32698
Project: 32698
Buggy source:
/** 
 * To update the Barcode as change events come in.
 */
public void listChanged(ListEvent listChanges){
  while (listChanges.next()) {
    int changeType=listChanges.getType();
    int changeIndex=listChanges.getIndex();
    if (changeType == ListEvent.INSERT) {
      if (changeIndex == requested.size()) {
        requested.addWhite(requested.size(),1);
      }
 else {
        requested.addBlack(changeIndex,1);
      }
    }
 else     if (changeType == ListEvent.UPDATE) {
      requested.setBlack(changeIndex,1);
    }
 else     if (changeType == ListEvent.DELETE) {
      requested.remove(changeIndex,1);
    }
  }
}

Fixed version (ground truth):
/** 
 * When the source list is changed, this forwards the change to the displayed   {@link Table}.
 */
public void listChanged(ListEvent listChanges){
  swtSource.getReadWriteLock().readLock().lock();
  Barcode deletes=new Barcode();
  deletes.addWhite(0,swtSource.size());
  int firstChange=swtSource.size();
  try {
    table.setRedraw(false);
    while (listChanges.next()) {
      int changeIndex=listChanges.getIndex();
      int adjustedIndex=deletes.getIndex(changeIndex,Barcode.WHITE);
      int changeType=listChanges.getType();
      if (changeType == ListEvent.INSERT) {
        deletes.addWhite(adjustedIndex,1);
        tableHandler.addRow(adjustedIndex,swtSource.get(changeIndex));
        firstChange=Math.min(changeIndex,firstChange);
      }
 else       if (changeType == ListEvent.UPDATE) {
        tableHandler.updateRow(adjustedIndex,swtSource.get(changeIndex));
      }
 else       if (changeType == ListEvent.DELETE) {
        deletes.setBlack(adjustedIndex,1);
        firstChange=Math.min(changeIndex,firstChange);
      }
    }
    if (deletes.blackSize() > 0) {
      int[] deletedIndices=new int[deletes.blackSize()];
      for (BarcodeIterator i=deletes.iterator(); i.hasNextBlack(); ) {
        i.nextBlack();
        deletedIndices[i.getBlackIndex()]=i.getIndex();
      }
      tableHandler.removeAll(deletedIndices);
    }
    table.setRedraw(true);
  }
  finally {
    swtSource.getReadWriteLock().readLock().unlock();
  }
}
Program: 32699
Project: 32699
Buggy source:
/** 
 * Create a new VirtualTableHandler.
 */
public VirtualTableHandler(){
  requested=new Barcode();
  requested.addWhite(0,swtSource.size());
  table.addListener(SWT.SetData,this);
  swtSource.addListEventListener(this);
}

Fixed version (ground truth):
/** 
 * Create a new VirtualTableHandler.
 */
public VirtualTableHandler(){
  requested=new Barcode();
  requested.addWhite(0,swtSource.size());
  table.addListener(SWT.SetData,this);
}
Program: 32700
Project: 32700
Buggy source:
/** 
 * Allows this handler to clean up after itself.
 */
public void dispose(){
  table.removeListener(SWT.SetData,this);
  swtSource.removeListEventListener(this);
}

Fixed version (ground truth):
/** 
 * Allows this handler to clean up after itself.
 */
public void dispose(){
  table.removeListener(SWT.SetData,this);
}
Program: 32701
Project: 32701
Buggy source:
/** 
 * Test Matchers that fire matchAll() and matchNone() events.
 */
public void testMatchAllOrNothing(){
  EventList base_list=new BasicEventList();
  base_list.add(new Integer(1));
  base_list.add(new Integer(2));
  base_list.add(new Integer(3));
  base_list.add(new Integer(4));
  base_list.add(new Integer(5));
  AllOrNothingMatcherEditor matcher=new AllOrNothingMatcherEditor();
  FilterList filter_list=new FilterList(base_list,matcher);
  assertEquals(5,filter_list.size());
  matcher.showAll(false);
  assertEquals(0,filter_list.size());
  matcher.showAll(true);
  assertEquals(5,filter_list.size());
}

Fixed version (ground truth):
/** 
 * Test Matchers that fire matchAll() and matchNone() events.
 */
public void testMatchAllOrNothing(){
  EventList base_list=new BasicEventList();
  base_list.add(new Integer(1));
  base_list.add(new Integer(2));
  base_list.add(new Integer(3));
  base_list.add(new Integer(4));
  base_list.add(new Integer(5));
  AllOrNothingMatcherEditor matcher=new AllOrNothingMatcherEditor();
  FilterList filter_list=new FilterList(base_list,matcher);
  filter_list.addListEventListener(new ConsistencyTestList(filter_list,"String_Node_Str"));
  assertEquals(5,filter_list.size());
  matcher.showAll(false);
  assertEquals(0,filter_list.size());
  matcher.showAll(true);
  assertEquals(5,filter_list.size());
}
Program: 32702
Project: 32702
Buggy source:
/** 
 * Compare this to another   {@link MatchOperation}.
 * @return true if there exists some Object i such that <code>this.matches(i)</code>is <code>false</code> when <code>other.matches(i)<code> is <code>true</code>. Two MatcherOperations can be mutually more strict than each other.
 */
boolean isMoreStrict(MatchOperation other){
  if (other.polarity != this.polarity)   return true;
  if (other.comparator != this.comparator)   return true;
  if (this.threshold == other.threshold) {
    if (this.inclusive && !other.inclusive)     return true;
  }
 else {
    if (this.polarity == 0)     return true;
 else     if (!this.matches(other.threshold))     return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Compare this to another   {@link MatchOperation}.
 * @return true if there exists some Object i such that <code>this.matches(i)</code>is <code>false</code> when <code>other.matches(i)<code> is <code>true</code>. Two MatcherOperations can be mutually more strict than each other.
 */
boolean isMoreStrict(MatchOperation other){
  if (other.polarity != this.polarity)   return true;
  if (other.comparator != this.comparator)   return true;
  if (this.threshold == other.threshold) {
    if (polarity == 0)     return this.inclusive != other.inclusive;
 else     return (!this.inclusive && other.inclusive);
  }
 else {
    if (this.polarity == 0)     return true;
 else     if (!this.matches(other.threshold))     return true;
  }
  return false;
}
Program: 32704
Project: 32704
Buggy source:
/** 
 * Forwards the event. This is a convenience method that does the following: <br>1. beginEvent() <br>2. For all changes in sourceEvent, apply those changes to this <br>3. commitEvent() <p>Note that this method should be preferred to manually forwarding events because it is heavily optimized.
 */
public void forwardEvent(ListEvent listChanges){
  if (eventLevel == 0) {
    atomicChangeBlocks=listChanges.getBlocks();
    reorderMap=listChanges.isReordering() ? listChanges.getReorderMap() : null;
    fireEvent();
  }
 else {
    beginEvent();
    while (listChanges.nextBlock()) {
      addChange(listChanges.getType(),listChanges.getBlockStartIndex(),listChanges.getBlockEndIndex());
    }
    commitEvent();
  }
}

Fixed version (ground truth):
/** 
 * Forwards the event. This is a convenience method that does the following: <br>1. beginEvent() <br>2. For all changes in sourceEvent, apply those changes to this <br>3. commitEvent() <p>Note that this method should be preferred to manually forwarding events because it is heavily optimized. <p>Note that currently this implementation does a best effort to preserve reorderings. This means that a reordering is lost if it is combined with any other ListEvent.
 */
public void forwardEvent(ListEvent listChanges){
  if (eventLevel == 0) {
    atomicChangeBlocks=listChanges.getBlocks();
    reorderMap=listChanges.isReordering() ? listChanges.getReorderMap() : null;
    fireEvent();
  }
 else {
    beginEvent();
    this.reorderMap=null;
    if (atomicChangeBlocks.isEmpty() && listChanges.isReordering()) {
      reorder(listChanges.getReorderMap());
    }
 else {
      while (listChanges.nextBlock()) {
        addChange(listChanges.getType(),listChanges.getBlockStartIndex(),listChanges.getBlockEndIndex());
      }
    }
    commitEvent();
  }
}
Program: 32706
Project: 32706
Buggy source:
/** 
 * {@inheritDoc} 
 */
public final void removeMatcherEditorListener(MatcherEditorListener listener){
  for (Iterator i=listeners.iterator(); i.hasNext(); ) {
    if (i.next() == listener) {
      i.remove();
      break;
    }
  }
  throw new IllegalStateException("String_Node_Str" + listener);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public final void removeMatcherEditorListener(MatcherEditorListener listener){
  for (Iterator i=listeners.iterator(); i.hasNext(); ) {
    if (i.next() == listener) {
      i.remove();
      return;
    }
  }
  throw new IllegalStateException("String_Node_Str" + listener);
}
Program: 32707
Project: 32707
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void listChanged(ListEvent listChanges){
  updates.beginEvent();
  if (listChanges.isReordering() && size() == 1) {
    int[] reorderMap=listChanges.getReorderMap();
    for (int r=0; r < reorderMap.length; r++) {
      if (reorderMap[r] == startIndex) {
        startIndex=r;
        endIndex=startIndex + 1;
        break;
      }
    }
  }
 else {
    while (listChanges.next()) {
      int changeIndex=listChanges.getIndex();
      int changeType=listChanges.getType();
      if (changeIndex < startIndex || (changeType == ListEvent.INSERT && changeIndex == startIndex)) {
        if (changeType == ListEvent.INSERT) {
          startIndex++;
          endIndex++;
        }
 else         if (changeType == ListEvent.DELETE) {
          startIndex--;
          endIndex--;
        }
      }
 else       if (changeIndex < endIndex) {
        if (changeType == ListEvent.INSERT) {
          endIndex++;
          updates.addInsert(changeIndex - startIndex);
        }
 else         if (changeType == ListEvent.UPDATE) {
          updates.addInsert(changeIndex - startIndex);
        }
 else         if (changeType == ListEvent.DELETE) {
          endIndex--;
          updates.addDelete(changeIndex - startIndex);
        }
      }
 else {
      }
    }
  }
  assert(startIndex <= endIndex);
  updates.commitEvent();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void listChanged(ListEvent listChanges){
  updates.beginEvent();
  if (listChanges.isReordering() && size() == 1) {
    int[] reorderMap=listChanges.getReorderMap();
    for (int r=0; r < reorderMap.length; r++) {
      if (reorderMap[r] == startIndex) {
        startIndex=r;
        endIndex=startIndex + 1;
        break;
      }
    }
  }
 else {
    while (listChanges.next()) {
      int changeIndex=listChanges.getIndex();
      int changeType=listChanges.getType();
      if (changeIndex < startIndex || (changeType == ListEvent.INSERT && changeIndex == startIndex)) {
        if (changeType == ListEvent.INSERT) {
          startIndex++;
          endIndex++;
        }
 else         if (changeType == ListEvent.DELETE) {
          startIndex--;
          endIndex--;
        }
      }
 else       if (changeIndex < endIndex) {
        if (changeType == ListEvent.INSERT) {
          endIndex++;
          updates.addInsert(changeIndex - startIndex);
        }
 else         if (changeType == ListEvent.UPDATE) {
          updates.addUpdate(changeIndex - startIndex);
        }
 else         if (changeType == ListEvent.DELETE) {
          endIndex--;
          updates.addDelete(changeIndex - startIndex);
        }
      }
 else {
      }
    }
  }
  assert(startIndex <= endIndex);
  updates.commitEvent();
}
Program: 32708
Project: 32708
Buggy source:
/** 
 * {@inheritDoc}
 */
public final void relaxed(Matcher source){
  handleFilterRelaxed();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public final void relaxed(Matcher matcher,MatcherSource source){
  handleFilterRelaxed();
}
Program: 32709
Project: 32709
Buggy source:
/** 
 * Update the matcher used by the list.
 */
public synchronized void setMatcher(Matcher matcher){
  Matcher old_matcher=this.matcher;
  if (old_matcher != null)   old_matcher.removeMatcherListener(this);
  this.matcher=matcher;
  if (matcher != null) {
    matcher.addMatcherListener(this);
    handleFilterChanged();
  }
 else   handleFilterCleared();
}

Fixed version (ground truth):
/** 
 * Update the matcher used by the list.
 */
public synchronized void setMatcher(Matcher matcher){
}
Program: 32710
Project: 32710
Buggy source:
/** 
 * {@inheritDoc}
 */
public final void cleared(Matcher source){
  handleFilterCleared();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public final void cleared(MatcherSource source){
  handleFilterCleared();
}
Program: 32711
Project: 32711
Buggy source:
/** 
 * {@inheritDoc}
 */
public final void constrained(Matcher source){
  handleFilterConstrained();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public final void constrained(Matcher matcher,MatcherSource source){
  handleFilterConstrained();
}
Program: 32712
Project: 32712
Buggy source:
/** 
 * {@inheritDoc}
 */
public final void changed(Matcher source){
  handleFilterChanged();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public final void changed(Matcher matcher,MatcherSource source){
  handleFilterChanged();
}
Program: 32713
Project: 32713
Buggy source:
/** 
 * Gets the specified block from the current set of change blocks. Note that not blocks may be cleaned up after they are viewed by all monitoring sequences. Such blocks may not be available.
 */
ListEventBlock getBlock(int atomicCount,int block){
  List atomicChange=(List)atomicChanges.get(atomicCount);
  return (ListEventBlock)atomicChange.get(block);
}

Fixed version (ground truth):
/** 
 * Gets the specified block from the current set of change blocks. Note that not blocks may be cleaned up after they are viewed by all monitoring sequences. Such blocks may not be available.
 */
ListEventBlock getBlock(int atomicCount,int block){
  List atomicChange=(List)atomicChanges.get(atomicCount - atomicListOffset);
  return (ListEventBlock)atomicChange.get(block);
}
Program: 32714
Project: 32714
Buggy source:
/** 
 * Gets the reorder map for the specified atomic change or null if that change is not a reordering.
 */
int[] getReorderMap(int atomicCount){
  return (int[])reorderMaps.get(atomicCount);
}

Fixed version (ground truth):
/** 
 * Gets the reorder map for the specified atomic change or null if that change is not a reordering.
 */
int[] getReorderMap(int atomicCount){
  return (int[])reorderMaps.get(atomicCount - atomicListOffset);
}
Program: 32715
Project: 32715
Buggy source:
/** 
 * Gets the total number of blocks in the specified atomic change.
 */
int getBlockCount(int atomicCount){
  List atomicChange=(List)atomicChanges.get(atomicCount);
  return atomicChange.size();
}

Fixed version (ground truth):
/** 
 * Gets the total number of blocks in the specified atomic change.
 */
int getBlockCount(int atomicCount){
  List atomicChange=(List)atomicChanges.get(atomicCount - atomicListOffset);
  return atomicChange.size();
}
Program: 32716
Project: 32716
Buggy source:
/** 
 * Prepares to receive event parts. This needs to be called for each fired event exactly once, even if that event includes some nested events. <p>To prevent two simultaneous atomic changes, the atomicChangeBlocks arraylist is used as a flag. If it is null, there is no change taking place. Otherwise there is a conflicting change and a ConcurrentModificationException is thrown.
 */
private void prepareEvent(){
  atomicChangeBlocks=new ArrayList();
  atomicLatestBlock=null;
  reorderMap=null;
  int oldestRequiredChange=atomicChanges.size();
  for (int e=0; e < listenerEvents.size(); e++) {
    ListEvent listChangeEvent=(ListEvent)listenerEvents.get(e);
    int mark=listChangeEvent.getMark();
    if (mark == -1)     continue;
 else     if (mark < oldestRequiredChange)     oldestRequiredChange=mark;
  }
  for (int i=oldestChange; i < oldestRequiredChange; i++) {
    List recycledChanges=(List)atomicChanges.get(i);
    changePool.addAll(recycledChanges);
    atomicChanges.set(i,null);
  }
  oldestChange=oldestRequiredChange;
}

Fixed version (ground truth):
/** 
 * Prepares to receive event parts. This needs to be called for each fired event exactly once, even if that event includes some nested events. <p>To prevent two simultaneous atomic changes, the atomicChangeBlocks arraylist is used as a flag. If it is null, there is no change taking place. Otherwise there is a conflicting change and a ConcurrentModificationException is thrown.
 */
private void prepareEvent(){
  atomicChangeBlocks=new ArrayList();
  atomicLatestBlock=null;
  reorderMap=null;
  int oldestRequiredChange=atomicChanges.size() + atomicListOffset;
  for (int e=0; e < listenerEvents.size(); e++) {
    ListEvent listChangeEvent=(ListEvent)listenerEvents.get(e);
    int mark=listChangeEvent.getMark();
    if (mark == -1)     continue;
 else     if (mark < oldestRequiredChange)     oldestRequiredChange=mark;
  }
  for (int i=oldestChange; i < oldestRequiredChange; i++) {
    List recycledChanges=(List)atomicChanges.get(0);
    changePool.addAll(recycledChanges);
    atomicChanges.remove(0);
    reorderMaps.remove(0);
    atomicListOffset++;
  }
  oldestChange=oldestRequiredChange;
}
Program: 32717
Project: 32717
Buggy source:
/** 
 * Gets the total number of atomic changes so far.
 */
int getAtomicCount(){
  return atomicChanges.size();
}

Fixed version (ground truth):
/** 
 * Gets the total number of atomic changes so far.
 */
int getAtomicCount(){
  return atomicChanges.size() + atomicListOffset;
}
Program: 32718
Project: 32718
Buggy source:
/** 
 * Returns the previous element in the list.
 */
public Object previous(){
  if (nextIndex < 0) {
    if (previous != null) {
      Object result=previous;
      previous=null;
      nextIndex--;
      lastIndex=nextIndex;
      return result;
    }
 else {
      throw new NoSuchElementException("String_Node_Str" + nextIndex + "String_Node_Str"+ source.size());
    }
  }
 else {
    nextIndex--;
    lastIndex=nextIndex;
    Object result=source.get(nextIndex);
    return result;
  }
}

Fixed version (ground truth):
/** 
 * Returns the previous element in the list.
 */
public Object previous(){
  if (nextIndex <= 0) {
    if (previous != null) {
      Object result=previous;
      previous=null;
      nextIndex--;
      lastIndex=nextIndex;
      return result;
    }
 else {
      throw new NoSuchElementException("String_Node_Str" + nextIndex + "String_Node_Str"+ source.size());
    }
  }
 else {
    nextIndex--;
    lastIndex=nextIndex;
    Object result=source.get(nextIndex);
    return result;
  }
}
Program: 32719
Project: 32719
Buggy source:
/** 
 * Mark the current location in the sequence of list events so that it may be returned to later. Note that this will cause the components of this  {@link ListEvent} to persist in memory until {@link clearMark()} is called.Therefore be sure to call  {@link clearMark()} whenever you call{@link mark()}.
 */
public void mark(){
  atomicCountMark=atomicCount;
}

Fixed version (ground truth):
/** 
 * Mark the current location in the sequence of list events so that it may be returned to later. Note that this will cause the components of this  {@link ListEvent} to persist in memory until {@link #clearMark()} is called.Therefore be sure to call  {@link #clearMark()} whenever you call{@link #mark()}.
 */
public void mark(){
  atomicCountMark=atomicCount;
}
Program: 32720
Project: 32720
Buggy source:
/** 
 * Binds the contents of a   {@link Combo} component to an {@link EventList}source.  This allows the selection choices in a   {@link Combo} to changedynamically to reflect chances to the source  {@link EventList}.  The  {@link String} values displayed in the {@link Combo} compoment will beformatted using the provided  {@link LabelFormat}.
 * @see LabelFormat
 * @see GlazedLists#beanLabelProvider(String)
 */
public EventComboViewer(EventList source,Combo combo,ILabelProvider labelProvider){
  swtSource=GlazedListsSWT.swtThreadProxyList(source,combo.getDisplay());
  this.combo=combo;
  this.labelProvider=labelProvider;
  for (int i=0; i < source.size(); i++) {
    addRow(i,source.get(i));
  }
  swtSource.addListEventListener(this);
}

Fixed version (ground truth):
/** 
 * Binds the contents of a   {@link Combo} component to an {@link EventList}source.  This allows the selection choices in a   {@link Combo} to changedynamically to reflect chances to the source  {@link EventList}.  The  {@link String} values displayed in the {@link Combo} compoment will beformatted using the provided  {@link ILabelProvider}.
 * @see ILabelProvider
 * @see GlazedListsSWT#beanLabelProvider(String)
 */
public EventComboViewer(EventList source,Combo combo,ILabelProvider labelProvider){
  swtSource=GlazedListsSWT.swtThreadProxyList(source,combo.getDisplay());
  this.combo=combo;
  this.labelProvider=labelProvider;
  for (int i=0; i < source.size(); i++) {
    addRow(i,source.get(i));
  }
  swtSource.addListEventListener(this);
}
Program: 32721
Project: 32721
Buggy source:
/** 
 * Creates a new List that displays and responds to changes in source. List elements are formatted using the provided   {@link LabelFormat}.
 */
public EventListViewer(EventList source,List list,ILabelProvider labelProvider){
  swtSource=GlazedListsSWT.swtThreadProxyList(source,list.getDisplay());
  this.list=list;
  this.labelProvider=labelProvider;
  selectionList=new SelectionList(swtSource,this);
  populateList();
  swtSource.addListEventListener(this);
}

Fixed version (ground truth):
/** 
 * Creates a new List that displays and responds to changes in source. List elements are formatted using the provided   {@link ILabelProvider}.
 */
public EventListViewer(EventList source,List list,ILabelProvider labelProvider){
  swtSource=GlazedListsSWT.swtThreadProxyList(source,list.getDisplay());
  this.list=list;
  this.labelProvider=labelProvider;
  selectionList=new SelectionList(swtSource,this);
  populateList();
  swtSource.addListEventListener(this);
}
Program: 32722
Project: 32722
Buggy source:
/** 
 * Tests that BeanTableFormat works as a TableFormat.
 */
public void testTableFormat(){
  assertEquals(4,footballFormat.getColumnCount());
  assertEquals("String_Node_Str",footballFormat.getColumnName(0));
  assertEquals("String_Node_Str",footballFormat.getColumnName(1));
  assertEquals("String_Node_Str",footballFormat.getColumnName(2));
  assertEquals("String_Node_Str",footballFormat.getColumnName(3));
  assertEquals("String_Node_Str",footballFormat.getColumnValue(riders,0));
  assertEquals("String_Node_Str",footballFormat.getColumnValue(riders,1));
  assertEquals(Color.green,footballFormat.getColumnValue(riders,2));
  assertEquals(Color.white,footballFormat.getColumnValue(riders,3));
  assertEquals("String_Node_Str",footballFormat.getColumnValue(ticats,0));
  assertEquals("String_Node_Str",footballFormat.getColumnValue(ticats,1));
  assertEquals(Color.yellow,footballFormat.getColumnValue(ticats,2));
  assertEquals(Color.black,footballFormat.getColumnValue(ticats,3));
}

Fixed version (ground truth):
/** 
 * Tests that BeanTableFormat works as a TableFormat.
 */
public void testTableFormat(){
  assertEquals(6,footballFormat.getColumnCount());
  assertEquals("String_Node_Str",footballFormat.getColumnName(0));
  assertEquals("String_Node_Str",footballFormat.getColumnName(1));
  assertEquals("String_Node_Str",footballFormat.getColumnName(2));
  assertEquals("String_Node_Str",footballFormat.getColumnName(3));
  assertEquals("String_Node_Str",footballFormat.getColumnValue(riders,0));
  assertEquals("String_Node_Str",footballFormat.getColumnValue(riders,1));
  assertEquals(Color.green,footballFormat.getColumnValue(riders,2));
  assertEquals(Color.white,footballFormat.getColumnValue(riders,3));
  assertEquals("String_Node_Str",footballFormat.getColumnValue(ticats,0));
  assertEquals("String_Node_Str",footballFormat.getColumnValue(ticats,1));
  assertEquals(Color.yellow,footballFormat.getColumnValue(ticats,2));
  assertEquals(Color.black,footballFormat.getColumnValue(ticats,3));
}
Program: 32724
Project: 32724
Buggy source:
/** 
 * Prepare for the test.
 */
public void setUp(){
  String[] propertyNames=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  String[] columnNames=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  boolean[] writable=new boolean[]{false,true,false,false};
  footballFormat=GlazedLists.tableFormat(propertyNames,columnNames,writable);
  classedFootballFormat=GlazedLists.tableFormat(FootballTeam.class,propertyNames,columnNames,writable);
}

Fixed version (ground truth):
/** 
 * Prepare for the test.
 */
public void setUp(){
  String[] propertyNames=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  String[] columnNames=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  boolean[] writable=new boolean[]{false,true,false,false,false,false};
  footballFormat=GlazedLists.tableFormat(propertyNames,columnNames,writable);
  classedFootballFormat=GlazedLists.tableFormat(FootballTeam.class,propertyNames,columnNames,writable);
}
Program: 32725
Project: 32725
Buggy source:
/** 
 * Compares the specified objects by the JavaBean property.
 */
public int compare(Object alpha,Object beta){
  Object alphaProperty=null;
  if (alpha != null)   alphaProperty=beanProperty.get(alpha);
  Object betaProperty=null;
  if (beta != null)   alphaProperty=beanProperty.get(beta);
  return propertyComparator.compare(alphaProperty,betaProperty);
}

Fixed version (ground truth):
/** 
 * Compares the specified objects by the JavaBean property.
 */
public int compare(Object alpha,Object beta){
  Object alphaProperty=null;
  if (alpha != null)   alphaProperty=beanProperty.get(alpha);
  Object betaProperty=null;
  if (beta != null)   betaProperty=beanProperty.get(beta);
  return propertyComparator.compare(alphaProperty,betaProperty);
}
Program: 32726
Project: 32726
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void listChanged(ListEvent listChanges){
  if (listChanges.isReordering())   return;
  boolean constrained=false;
  boolean relaxed=false;
  while (listChanges.next()) {
    int type=listChanges.getType();
    if (type == ListEvent.UPDATE || type == ListEvent.DELETE)     relaxed=true;
    if (type == ListEvent.UPDATE || type == ListEvent.INSERT)     constrained=true;
  }
  getReadWriteLock().writeLock().lock();
  try {
    if (contrained && relaxed)     handleFilterChanged();
 else     if (relaxed)     handleFilterRelaxed();
 else     if (constrained)     handleFilterConstrained();
  }
  finally {
    getReadWriteLock().writeLock().unlock();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void listChanged(ListEvent listChanges){
  if (listChanges.isReordering()) {
    listChanges.getReorderMap();
    return;
  }
  boolean constrained=false;
  boolean relaxed=false;
  while (listChanges.next()) {
    int type=listChanges.getType();
    if (type == ListEvent.UPDATE || type == ListEvent.DELETE)     relaxed=true;
    if (type == ListEvent.UPDATE || type == ListEvent.INSERT)     constrained=true;
  }
  getReadWriteLock().writeLock().lock();
  try {
    if (contrained && relaxed)     handleFilterChanged();
 else     if (relaxed)     handleFilterRelaxed();
 else     if (constrained)     handleFilterConstrained();
  }
  finally {
    getReadWriteLock().writeLock().unlock();
  }
}
Program: 32727
Project: 32727
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void listChanged(ListEvent listChanges){
  int stateMask=0;
  final int FILTER_RELAXED=1;
  final int FILTER_CONSTRAINED=2;
  final int FILTER_CHANGED=3;
  while (listChanges.next()) {
    int type=listChanges.getType();
    if (listChanges.isReordering()) {
    }
 else     if (type == ListEvent.UPDATE) {
      stateMask=FILTER_CHANGED;
    }
 else     if (type == ListEvent.DELETE) {
      stateMask=stateMask | FILTER_RELAXED;
    }
 else     if (type == ListEvent.INSERT) {
      stateMask=stateMask | FILTER_CONSTRAINED;
    }
  }
  if ((stateMask & FILTER_CHANGED) != 0) {
    handleFilterChanged();
  }
 else   if ((stateMask & FILTER_RELAXED) != 0) {
    handleFilterRelaxed();
  }
 else   if ((stateMask & FILTER_CONSTRAINED) != 0) {
    handleFilterConstrained();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void listChanged(ListEvent listChanges){
  int stateMask=0;
  final int FILTER_RELAXED=1;
  final int FILTER_CONSTRAINED=2;
  final int FILTER_CHANGED=3;
  while (listChanges.next()) {
    int type=listChanges.getType();
    if (listChanges.isReordering()) {
    }
 else     if (type == ListEvent.UPDATE) {
      stateMask=FILTER_CHANGED;
    }
 else     if (type == ListEvent.DELETE) {
      stateMask=stateMask | FILTER_RELAXED;
    }
 else     if (type == ListEvent.INSERT) {
      stateMask=stateMask | FILTER_CONSTRAINED;
    }
  }
  if (stateMask == 0)   return;
  getReadWriteLock().writeLock().lock();
  try {
    if ((stateMask & FILTER_CHANGED) != 0) {
      handleFilterChanged();
    }
 else     if ((stateMask & FILTER_RELAXED) != 0) {
      handleFilterRelaxed();
    }
 else     if ((stateMask & FILTER_CONSTRAINED) != 0) {
      handleFilterConstrained();
    }
  }
  finally {
    getReadWriteLock().writeLock().unlock();
  }
}