nus-yam/ex-repair huggingface dataset:
Program: 32583
Project: 32583
Buggy source:
/** 
 * Lookup the ancestor of this node whose path length is the length specified. For example, the ancestor of path length 2 of the node <code>/Users/jessewilson/Desktop/yarbo.mp4</code> is the node <code>/Users/jessewilson</code>. <p>If the ancestor path length is the same as this node's path length, then this node will be returned.
 */
public Node<E> ancestorWithPathLength(int ancestorPathLength){
  assert(pathLength() >= ancestorPathLength);
  Node<E> ancestor=this;
  while (ancestor.pathLength() > ancestorPathLength) {
    ancestor=ancestor.parent;
    if (ancestor == null) {
      throw new IllegalStateException();
    }
  }
  return ancestor;
}

Fixed version (ground truth):
/** 
 * Lookup the ancestor of this node whose path length is the length specified. For example, the ancestor of path length 2 of the node <code>/Users/jessewilson/Desktop/yarbo.mp4</code> is the node <code>/Users/jessewilson</code>. <p>If the ancestor path length is the same as this node's path length, then this node will be returned.
 */
private Node<E> ancestorWithPathLength(int ancestorPathLength){
  assert(pathLength() >= ancestorPathLength);
  Node<E> ancestor=this;
  while (ancestor.pathLength() > ancestorPathLength) {
    ancestor=ancestor.parent;
    if (ancestor == null) {
      throw new IllegalStateException();
    }
  }
  return ancestor;
}
Program: 32584
Project: 32584
Buggy source:
/** 
 * Attach the specified parent to the specified node.
 * @param parent the parent node, may be <code>null</code>
 * @param siblingBeforeNode the node immediately before the node of interestwho is a child of the same parent. This will be linked in as the new node's sibling. If <code>null</code>, no linking/unlinking will be performed.
 */
private void attachParent(Node<E> parent,Node<E> siblingBeforeNode){
  assert(current != null);
  assert((current.pathLength() == 1 && parent == null) || (current.pathLength() == parent.pathLength() + 1));
  if (siblingBeforeNode != null && siblingBeforeNode.siblingAfter != current) {
    if (siblingBeforeNode.pathLength() != current.pathLength()) {
      throw new IllegalStateException();
    }
    assert(siblingBeforeNode.parent == parent);
    if (siblingBeforeNode.siblingAfter != null) {
      assert(current.siblingAfter == null);
      current.siblingAfter=siblingBeforeNode.siblingAfter;
      siblingBeforeNode.siblingAfter.siblingBefore=current;
    }
    current.siblingBefore=siblingBeforeNode;
    siblingBeforeNode.siblingAfter=current;
    assert(current.siblingBefore != current);
    assert(current.siblingAfter != current);
  }
  for (Node<E> currentSibling=current; currentSibling != null; currentSibling=currentSibling.siblingAfter) {
    if (currentSibling.parent != parent) {
      currentSibling.parent=parent;
    }
  }
  incrementCurrent();
}

Fixed version (ground truth):
/** 
 * Attach the specified parent to the specified node.
 * @param parent the parent node, may be <code>null</code>
 * @param siblingBeforeNode the node immediately before the node of interestwho is a child of the same parent. This will be linked in as the new node's sibling. If <code>null</code>, no linking/unlinking will be performed.
 */
private void attachParent(Node<E> parent,Node<E> siblingBeforeNode){
  assert(current != null);
  assert((current.pathLength() == 1 && parent == null) || (current.pathLength() == parent.pathLength() + 1));
  if (siblingBeforeNode != null && siblingBeforeNode.siblingAfter != current) {
    if (siblingBeforeNode.pathLength() != current.pathLength()) {
      throw new IllegalStateException();
    }
    assert(siblingBeforeNode.parent == parent);
    if (siblingBeforeNode.siblingAfter != null) {
      assert(current.siblingAfter == null);
      current.siblingAfter=siblingBeforeNode.siblingAfter;
      siblingBeforeNode.siblingAfter.siblingBefore=current;
    }
    current.siblingBefore=siblingBeforeNode;
    siblingBeforeNode.siblingAfter=current;
    assert(current.siblingBefore != current);
    assert(current.siblingAfter != current);
  }
  for (Node<E> currentSibling=current; currentSibling != null; currentSibling=currentSibling.siblingAfter) {
    currentSibling.parent=parent;
  }
  incrementCurrent();
}
Program: 32585
Project: 32585
Buggy source:
/** 
 * Create a   {@link Node} that resembles the parent of this.
 */
private Node<E> describeParent(){
  int pathLength=pathLength();
  if (pathLength == 1)   return null;
  Node<E> result=new Node<E>();
  result.path=path.subList(0,pathLength - 1);
  result.virtual=true;
  return result;
}

Fixed version (ground truth):
/** 
 * Create a   {@link Node} that resembles the parent of this.
 */
private Node<E> describeParent(){
  int pathLength=pathLength();
  if (pathLength == 1)   return null;
  return new Node<E>(true,path.subList(0,pathLength - 1));
}
Program: 32586
Project: 32586
Buggy source:
/** 
 * @return the node that follows this one, or <code>null</code> if thereis no such node.
 */
public Node<E> next(){
  Element<Node<E>> next=element.next();
  return (next == null) ? null : next.get();
}

Fixed version (ground truth):
/** 
 * @return the node that follows this one, or <code>null</code> if thereis no such node.
 */
private Node<E> next(){
  Element<Node<E>> next=element.next();
  return (next == null) ? null : next.get();
}
Program: 32588
Project: 32588
Buggy source:
/** 
 * @return the node that precedes this one, or <code>null</code> if thereis no such node.
 */
public Node<E> previous(){
  Element<Node<E>> previous=element.previous();
  return (previous == null) ? null : previous.get();
}

Fixed version (ground truth):
/** 
 * @return the node that precedes this one, or <code>null</code> if thereis no such node.
 */
private Node<E> previous(){
  Element<Node<E>> previous=element.previous();
  return (previous == null) ? null : previous.get();
}
Program: 32589
Project: 32589
Buggy source:
/** 
 * Sanity check the entire datastructure.
 */
private boolean isValid(){
  assert(source.size() == data.size(REAL_NODES));
  int lastPathLengthSeen=0;
  for (int i=0; i < data.size(ALL_NODES); i++) {
    Node<E> node=data.get(i,ALL_NODES).get();
    assert(node.pathLength() <= lastPathLengthSeen + 1);
    lastPathLengthSeen=node.pathLength();
    assert(isVisibilityValid(node));
    if (node.virtual) {
      assert(node.element.getColor() == HIDDEN_VIRTUAL || node.element.getColor() == VISIBLE_VIRTUAL);
    }
 else {
      assert(source.get(data.convertIndexColor(i,ALL_NODES,REAL_NODES)) == node);
      assert(node.element.getColor() == HIDDEN_REAL || node.element.getColor() == VISIBLE_REAL);
    }
    if (node.pathLength() == 1) {
      validateSubtree(node);
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Sanity check the entire datastructure.
 */
private boolean isValid(){
  assert(source.size() == data.size(REAL_NODES));
  int lastPathLengthSeen=0;
  for (int i=0; i < data.size(ALL_NODES); i++) {
    Node<E> node=data.get(i,ALL_NODES).get();
    assert(node.pathLength() <= lastPathLengthSeen + 1);
    lastPathLengthSeen=node.pathLength();
    assert(isVisibilityValid(node));
    if (node.virtual) {
      assert(node.element.getColor() == HIDDEN_VIRTUAL || node.element.getColor() == VISIBLE_VIRTUAL);
    }
 else {
      if (source.get(data.convertIndexColor(i,ALL_NODES,REAL_NODES)) != node) {
        throw new IllegalStateException();
      }
      assert(node.element.getColor() == HIDDEN_REAL || node.element.getColor() == VISIBLE_REAL);
    }
    if (node.pathLength() == 1) {
      validateSubtree(node);
    }
  }
  return true;
}
Program: 32590
Project: 32590
Buggy source:
/** 
 * Attach the specified parent to the specified node.
 * @param node the node to be attached as parent
 * @param parent the parent node, may be <code>null</code>
 * @param siblingBeforeNode the node immediately before the node of interestwho is a child of the same parent. This will be linked in as the new node's sibling
 */
private void attachParent(Node<E> node,Node<E> parent,Node<E> siblingBeforeNode){
  assert(node != null);
  assert((node.pathLength() == 1 && parent == null) || (node.pathLength() == parent.pathLength() + 1));
  Node<E> originalParent=node.parent;
  node.parent=parent;
  if (siblingBeforeNode != null) {
    assert(siblingBeforeNode.pathLength() == node.pathLength());
    assert(siblingBeforeNode.parent == parent);
    node.siblingBefore=siblingBeforeNode;
    siblingBeforeNode.siblingAfter=node;
  }
  for (Node<E> siblingAfter=node.siblingAfter; siblingAfter != null; siblingAfter=siblingAfter.siblingAfter) {
    assert(siblingAfter.parent == originalParent);
    siblingAfter.parent=parent;
    assert(isVisibilityValid(siblingAfter));
  }
}

Fixed version (ground truth):
/** 
 * Attach the specified parent to the specified node.
 * @param node the node to be attached as parent
 * @param parent the parent node, may be <code>null</code>
 * @param siblingBeforeNode the node immediately before the node of interestwho is a child of the same parent. This will be linked in as the new node's sibling
 */
private void attachParent(Node<E> node,Node<E> parent,Node<E> siblingBeforeNode){
  assert(node != null);
  assert((node.pathLength() == 1 && parent == null) || (node.pathLength() == parent.pathLength() + 1));
  node.parent=parent;
  if (siblingBeforeNode != null) {
    assert(siblingBeforeNode.pathLength() == node.pathLength());
    assert(siblingBeforeNode.parent == parent);
    if (siblingBeforeNode.siblingAfter != null) {
      assert(node.siblingAfter == null);
      node.siblingAfter=siblingBeforeNode.siblingAfter;
      siblingBeforeNode.siblingAfter.siblingBefore=node;
    }
    node.siblingBefore=siblingBeforeNode;
    siblingBeforeNode.siblingAfter=node;
  }
  for (Node<E> siblingAfter=node.siblingAfter; siblingAfter != null; siblingAfter=siblingAfter.siblingAfter) {
    siblingAfter.parent=parent;
    assert(isVisibilityValid(siblingAfter));
  }
}
Program: 32592
Project: 32592
Buggy source:
/** 
 * When the source combo is changed, this forwards the change to the displayed combo.
 */
public void listChanged(ListEvent listChanges){
  swtSource.getReadWriteLock().readLock().lock();
  try {
    while (listChanges.next()) {
      int changeIndex=listChanges.getIndex();
      int changeType=listChanges.getType();
      if (changeType == ListEvent.INSERT) {
        addRow(changeIndex,swtSource.get(changeIndex));
      }
 else       if (changeType == ListEvent.UPDATE) {
        updateRow(changeIndex,swtSource.get(changeIndex));
      }
 else       if (changeType == ListEvent.DELETE) {
        deleteRow(changeIndex);
      }
    }
  }
  finally {
    swtSource.getReadWriteLock().readLock().unlock();
  }
}

Fixed version (ground truth):
/** 
 * When the source combo is changed, this forwards the change to the displayed combo.
 */
public void listChanged(ListEvent listChanges){
  while (listChanges.next()) {
    int changeIndex=listChanges.getIndex();
    int changeType=listChanges.getType();
    if (changeType == ListEvent.INSERT) {
      addRow(changeIndex,swtSource.get(changeIndex));
    }
 else     if (changeType == ListEvent.UPDATE) {
      updateRow(changeIndex,swtSource.get(changeIndex));
    }
 else     if (changeType == ListEvent.DELETE) {
      deleteRow(changeIndex);
    }
  }
}
Program: 32593
Project: 32593
Buggy source:
/** 
 * Releases the resources consumed by this   {@link EventComboViewer} so that itmay eventually be garbage collected. <p>An  {@link EventComboViewer} will be garbage collected without a call to{@link #dispose()}, but not before its source   {@link EventList} is garbagecollected. By calling  {@link #dispose()}, you allow the   {@link EventComboViewer}to be garbage collected before its source   {@link EventList}. This is necessary for situations where an   {@link EventComboViewer} is short-lived butits source  {@link EventList} is long-lived.<p><strong><font color="#FF0000">Warning:</font></strong> It is an error to call any method on a  {@link EventComboViewer} after it has been disposed.
 */
public void dispose(){
  swtSource.dispose();
}

Fixed version (ground truth):
/** 
 * Releases the resources consumed by this   {@link EventComboViewer} so that itmay eventually be garbage collected. <p>An  {@link EventComboViewer} will be garbage collected without a call to{@link #dispose()}, but not before its source   {@link EventList} is garbagecollected. By calling  {@link #dispose()}, you allow the   {@link EventComboViewer}to be garbage collected before its source   {@link EventList}. This is necessary for situations where an   {@link EventComboViewer} is short-lived butits source  {@link EventList} is long-lived.<p><strong><font color="#FF0000">Warning:</font></strong> It is an error to call any method on a  {@link EventComboViewer} after it has been disposed.
 */
public void dispose(){
  swtSource.dispose();
  swtSource.removeListEventListener(this);
}
Program: 32594
Project: 32594
Buggy source:
/** 
 * When the source list is changed, this forwards the change to the displayed List.
 */
public void listChanged(ListEvent listChanges){
  int firstModified=swtSource.size();
  swtSource.getReadWriteLock().readLock().lock();
  try {
    while (listChanges.next()) {
      int changeIndex=listChanges.getIndex();
      int changeType=listChanges.getType();
      if (changeType == ListEvent.INSERT) {
        addRow(changeIndex,swtSource.get(changeIndex));
        firstModified=Math.min(changeIndex,firstModified);
      }
 else       if (changeType == ListEvent.UPDATE) {
        updateRow(changeIndex,swtSource.get(changeIndex));
      }
 else       if (changeType == ListEvent.DELETE) {
        deleteRow(changeIndex);
        firstModified=Math.min(changeIndex,firstModified);
      }
    }
    selection.fireSelectionChanged(firstModified,swtSource.size() - 1);
  }
  finally {
    swtSource.getReadWriteLock().readLock().unlock();
  }
}

Fixed version (ground truth):
/** 
 * When the source list is changed, this forwards the change to the displayed List.
 */
public void listChanged(ListEvent listChanges){
  int firstModified=swtSource.size();
  while (listChanges.next()) {
    int changeIndex=listChanges.getIndex();
    int changeType=listChanges.getType();
    if (changeType == ListEvent.INSERT) {
      addRow(changeIndex,swtSource.get(changeIndex));
      firstModified=Math.min(changeIndex,firstModified);
    }
 else     if (changeType == ListEvent.UPDATE) {
      updateRow(changeIndex,swtSource.get(changeIndex));
    }
 else     if (changeType == ListEvent.DELETE) {
      deleteRow(changeIndex);
      firstModified=Math.min(changeIndex,firstModified);
    }
  }
  selection.fireSelectionChanged(firstModified,swtSource.size() - 1);
}
Program: 32595
Project: 32595
Buggy source:
/** 
 * Releases the resources consumed by this   {@link EventListViewer} so that itmay eventually be garbage collected. <p>An  {@link EventListViewer} will be garbage collected without a call to{@link #dispose()}, but not before its source   {@link EventList} is garbagecollected. By calling  {@link #dispose()}, you allow the   {@link EventListViewer}to be garbage collected before its source   {@link EventList}. This is necessary for situations where an   {@link EventListViewer} is short-lived butits source  {@link EventList} is long-lived.<p><strong><font color="#FF0000">Warning:</font></strong> It is an error to call any method on a  {@link EventListViewer} after it has been disposed.
 */
public void dispose(){
  selection.dispose();
  swtSource.dispose();
}

Fixed version (ground truth):
/** 
 * Releases the resources consumed by this   {@link EventListViewer} so that itmay eventually be garbage collected. <p>An  {@link EventListViewer} will be garbage collected without a call to{@link #dispose()}, but not before its source   {@link EventList} is garbagecollected. By calling  {@link #dispose()}, you allow the   {@link EventListViewer}to be garbage collected before its source   {@link EventList}. This is necessary for situations where an   {@link EventListViewer} is short-lived butits source  {@link EventList} is long-lived.<p><strong><font color="#FF0000">Warning:</font></strong> It is an error to call any method on a  {@link EventListViewer} after it has been disposed.
 */
public void dispose(){
  selection.dispose();
  swtSource.dispose();
  swtSource.removeListEventListener(this);
}
Program: 32596
Project: 32596
Buggy source:
/** 
 * 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();
  }
}

Fixed version (ground truth):
/** 
 * When the source list is changed, this forwards the change to the displayed   {@link Table}.
 */
public void listChanged(ListEvent listChanges){
  Barcode deletes=new Barcode();
  deletes.addWhite(0,swtSource.size());
  int firstChange=swtSource.size();
  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);
}
Program: 32597
Project: 32597
Buggy source:
/** 
 * For implementing the ListEventListener interface. This sends changes to the table which repaint the table cells. Because this class is backed by   {@link GlazedListsSwing#swingThreadProxyList}, all natural calls to this method are guaranteed to occur on the Swing EDT.
 */
public void listChanged(ListEvent<E> listChanges){
  swingThreadSource.getReadWriteLock().readLock().lock();
  try {
    while (listChanges.nextBlock()) {
      int startIndex=listChanges.getBlockStartIndex();
      int endIndex=listChanges.getBlockEndIndex();
      int changeType=listChanges.getType();
      tableModelEvent.setValues(startIndex,endIndex,changeType);
      fireTableChanged(tableModelEvent);
    }
  }
  finally {
    swingThreadSource.getReadWriteLock().readLock().unlock();
  }
}

Fixed version (ground truth):
/** 
 * For implementing the ListEventListener interface. This sends changes to the table which repaint the table cells. Because this class is backed by   {@link GlazedListsSwing#swingThreadProxyList}, all natural calls to this method are guaranteed to occur on the Swing EDT.
 */
public void listChanged(ListEvent<E> listChanges){
  while (listChanges.nextBlock()) {
    int startIndex=listChanges.getBlockStartIndex();
    int endIndex=listChanges.getBlockEndIndex();
    int changeType=listChanges.getType();
    tableModelEvent.setValues(startIndex,endIndex,changeType);
    fireTableChanged(tableModelEvent);
  }
}
Program: 32598
Project: 32598
Buggy source:
public void popupMenuWillBecomeVisible(PopupMenuEvent e){
  final Object prototypeValue=comboBox.getPrototypeDisplayValue();
  if (prototypeValue == null)   return;
  final JComponent popupComponent=(JComponent)e.getSource();
  if (popupComponent.getComponent(0) instanceof JScrollPane) {
    final JScrollPane scroller=(JScrollPane)popupComponent.getComponent(0);
    final Dimension scrollerSize=scroller.getPreferredSize();
    final Dimension prototypeSize=getPrototypeSize(prototypeValue);
    prototypeSize.width+=scroller.getVerticalScrollBar().getPreferredSize().width;
    if (prototypeSize.width > scrollerSize.width) {
      scrollerSize.width=prototypeSize.width;
      scroller.setMaximumSize(scrollerSize);
      scroller.setPreferredSize(scrollerSize);
      scroller.setMinimumSize(scrollerSize);
    }
  }
}

Fixed version (ground truth):
public void popupMenuWillBecomeVisible(PopupMenuEvent e){
  final Object prototypeValue=comboBox.getPrototypeDisplayValue();
  if (prototypeValue == null)   return;
  final JComponent popupComponent=(JComponent)e.getSource();
  fixPopupLocation(popupComponent);
  if (popupComponent.getComponent(0) instanceof JScrollPane) {
    final JScrollPane scroller=(JScrollPane)popupComponent.getComponent(0);
    final Dimension scrollerSize=scroller.getPreferredSize();
    final Dimension prototypeSize=getPrototypeSize(prototypeValue);
    prototypeSize.width+=scroller.getVerticalScrollBar().getPreferredSize().width;
    if (prototypeSize.width > scrollerSize.width) {
      scrollerSize.width=prototypeSize.width;
      scroller.setMaximumSize(scrollerSize);
      scroller.setPreferredSize(scrollerSize);
      scroller.setMinimumSize(scrollerSize);
    }
  }
}
Program: 32601
Project: 32601
Buggy source:
public void popupMenuWillBecomeVisible(PopupMenuEvent e){
  final Object prototypeValue=comboBox.getPrototypeDisplayValue();
  if (prototypeValue == null)   return;
  final JComponent popupComponent=(JComponent)e.getSource();
  fixPopupLocation(popupComponent);
  if (popupComponent.getComponent(0) instanceof JScrollPane) {
    final JScrollPane scroller=(JScrollPane)popupComponent.getComponent(0);
    final Dimension scrollerSize=scroller.getPreferredSize();
    final Dimension prototypeSize=getPrototypeSize(prototypeValue);
    prototypeSize.width+=scroller.getVerticalScrollBar().getPreferredSize().width;
    if (prototypeSize.width > scrollerSize.width) {
      scrollerSize.width=prototypeSize.width;
      scroller.setMaximumSize(scrollerSize);
      scroller.setPreferredSize(scrollerSize);
      scroller.setMinimumSize(scrollerSize);
    }
  }
}

Fixed version (ground truth):
public void popupMenuWillBecomeVisible(PopupMenuEvent e){
  final Object prototypeValue=comboBox.getPrototypeDisplayValue();
  if (prototypeValue == null)   return;
  final JComponent popupComponent=(JComponent)e.getSource();
  if (popupComponent.getComponent(0) instanceof JScrollPane) {
    final JScrollPane scroller=(JScrollPane)popupComponent.getComponent(0);
    final Dimension scrollerSize=scroller.getPreferredSize();
    final Dimension prototypeSize=getPrototypeSize(prototypeValue);
    prototypeSize.width+=scroller.getVerticalScrollBar().getPreferredSize().width;
    if (prototypeSize.width > scrollerSize.width) {
      scrollerSize.width=prototypeSize.width;
      scroller.setMaximumSize(scrollerSize);
      scroller.setPreferredSize(scrollerSize);
      scroller.setMinimumSize(scrollerSize);
    }
  }
}
Program: 32602
Project: 32602
Buggy source:
/** 
 * Starts a new atomic change to this list change queue.
 */
public final synchronized void beginEvent(boolean allowNestedEvents){
  if (!this.allowNestedEvents) {
    throw new ConcurrentModificationException("String_Node_Str" + eventThread.getName());
  }
  this.allowNestedEvents=allowNestedEvents;
  if (allowNestedEvents)   allowContradictingEvents=true;
  if (eventLevel == 0) {
    this.eventThread=Thread.currentThread();
    prepareEvent();
  }
  eventLevel++;
}

Fixed version (ground truth):
/** 
 * Starts a new atomic change to this list change queue.
 */
public final synchronized void beginEvent(boolean allowNestedEvents){
  if (!this.allowNestedEvents) {
    throw new ConcurrentModificationException("String_Node_Str" + eventThread.getName());
  }
  this.allowNestedEvents=allowNestedEvents;
  if (allowNestedEvents || (eventLevel == 0 && !isEventEmpty())) {
    allowContradictingEvents=true;
  }
  if (eventLevel == 0) {
    this.eventThread=Thread.currentThread();
    prepareEvent();
  }
  eventLevel++;
}
Program: 32603
Project: 32603
Buggy source:
/** 
 * @inheritDoc 
 */
public void dispose(){
  tableModel.dispose();
}

Fixed version (ground truth):
/** 
 * @inheritDoc 
 */
public void dispose(){
  swingThreadSource.removeListEventListener(this);
  tableModel.dispose();
}
Program: 32604
Project: 32604
Buggy source:
/** 
 * This method removes autocompletion support from the   {@link JComboBox}it was installed on. This method is useful when the   {@link EventList} ofitems that backs the combo box must outlive the combo box itself. Calling this method will return the combo box to its original state before autocompletion was installed, and it will be available for garbage collection independently of the  {@link EventList} of items.
 * @throws IllegalStateException if this method is called from any Threadother than the Swing Event Dispatch Thread
 */
public void uninstall(){
  checkAccessThread();
  if (this.comboBox == null)   throw new IllegalStateException("String_Node_Str");
  this.comboBox.removePropertyChangeListener("String_Node_Str",this.uiWatcher);
  this.comboBox.removePropertyChangeListener("String_Node_Str",this.modelWatcher);
  this.comboBoxEditor.removePropertyChangeListener("String_Node_Str",this.documentWatcher);
  this.undecorateOriginalUI();
  this.comboBox.setModel(this.originalModel);
  this.originalModel=null;
  this.comboBox.setEditable(originalComboBoxEditable);
  this.filteredItems.dispose();
  this.comboBox=null;
}

Fixed version (ground truth):
/** 
 * This method removes autocompletion support from the   {@link JComboBox}it was installed on. This method is useful when the   {@link EventList} ofitems that backs the combo box must outlive the combo box itself. Calling this method will return the combo box to its original state before autocompletion was installed, and it will be available for garbage collection independently of the  {@link EventList} of items.
 * @throws IllegalStateException if this method is called from any Threadother than the Swing Event Dispatch Thread
 */
public void uninstall(){
  checkAccessThread();
  if (this.comboBox == null)   throw new IllegalStateException("String_Node_Str");
  this.comboBox.removePropertyChangeListener("String_Node_Str",this.uiWatcher);
  this.comboBox.removePropertyChangeListener("String_Node_Str",this.modelWatcher);
  this.comboBoxEditor.removePropertyChangeListener("String_Node_Str",this.documentWatcher);
  this.undecorateOriginalUI();
  this.comboBox.setModel(this.originalModel);
  this.originalModel=null;
  this.comboBox.setEditable(originalComboBoxEditable);
  this.comboBoxModel.dispose();
  this.filteredItems.dispose();
  this.comboBox=null;
}
Program: 32605
Project: 32605
Buggy source:
/** 
 * Releases the resources consumed by this   {@link EventListModel} so that itmay eventually be garbage collected. <p>An  {@link EventListModel} will be garbage collected without a call to{@link #dispose()}, but not before its source   {@link EventList} is garbagecollected. By calling  {@link #dispose()}, you allow the   {@link EventListModel}to be garbage collected before its source   {@link EventList}. This is  necessary for situations where an   {@link EventListModel} is short-lived butits source  {@link EventList} is long-lived.<p><strong><font color="#FF0000">Warning:</font></strong> It is an error to call any method on a  {@link EventListModel} after it has been disposed.
 */
public void dispose(){
  swingSource.dispose();
}

Fixed version (ground truth):
/** 
 * Releases the resources consumed by this   {@link EventListModel} so that itmay eventually be garbage collected. <p>An  {@link EventListModel} will be garbage collected without a call to{@link #dispose()}, but not before its source   {@link EventList} is garbagecollected. By calling  {@link #dispose()}, you allow the   {@link EventListModel}to be garbage collected before its source   {@link EventList}. This is  necessary for situations where an   {@link EventListModel} is short-lived butits source  {@link EventList} is long-lived.<p><strong><font color="#FF0000">Warning:</font></strong> It is an error to call any method on a  {@link EventListModel} after it has been disposed.
 */
public void dispose(){
  swingSource.removeListEventListener(this);
  swingSource.dispose();
}
Program: 32606
Project: 32606
Buggy source:
/** 
 * Releases the resources consumed by this   {@link EventTableModel} so that itmay eventually be garbage collected. <p>An  {@link EventTableModel} will be garbage collected without a call to{@link #dispose()}, but not before its source   {@link EventList} is garbagecollected. By calling  {@link #dispose()}, you allow the   {@link EventTableModel}to be garbage collected before its source   {@link EventList}. This is  necessary for situations where an   {@link EventTableModel} is short-lived butits source  {@link EventList} is long-lived.<p><strong><font color="#FF0000">Warning:</font></strong> It is an error to call any method on a  {@link EventTableModel} after it has been disposed.
 */
public void dispose(){
  swingThreadSource.dispose();
}

Fixed version (ground truth):
/** 
 * Releases the resources consumed by this   {@link EventTableModel} so that itmay eventually be garbage collected. <p>An  {@link EventTableModel} will be garbage collected without a call to{@link #dispose()}, but not before its source   {@link EventList} is garbagecollected. By calling  {@link #dispose()}, you allow the   {@link EventTableModel}to be garbage collected before its source   {@link EventList}. This is  necessary for situations where an   {@link EventTableModel} is short-lived butits source  {@link EventList} is long-lived.<p><strong><font color="#FF0000">Warning:</font></strong> It is an error to call any method on a  {@link EventTableModel} after it has been disposed.
 */
public void dispose(){
  swingThreadSource.removeListEventListener(this);
  swingThreadSource.dispose();
}
Program: 32607
Project: 32607
Buggy source:
/** 
 * Forward the specified event to listeners.
 */
public final synchronized void forwardEvent(ListEvent<?> listChanges){
  beginEvent(false);
  this.reorderMap=null;
  if (isEventEmpty() && listChanges.isReordering()) {
    reorder(listChanges.getReorderMap());
  }
 else {
    while (listChanges.nextBlock()) {
      addChange(listChanges.getType(),listChanges.getBlockStartIndex(),listChanges.getBlockEndIndex());
    }
  }
  commitEvent();
}

Fixed version (ground truth):
/** 
 * Forward the specified event to listeners.
 */
public final synchronized void forwardEvent(ListEvent<?> listChanges){
  beginEvent(false);
  this.reorderMap=null;
  if (isEventEmpty() && listChanges.isReordering()) {
    reorder(listChanges.getReorderMap());
  }
 else {
    while (listChanges.nextBlock()) {
      addChange(listChanges.getType(),listChanges.getBlockStartIndex(),listChanges.getBlockEndIndex());
    }
    listChanges.reset();
  }
  commitEvent();
}
Program: 32608
Project: 32608
Buggy source:
/** 
 * {@inheritDoc} 
 */
protected void beforeFireEvent(){
  Block.sortListEventBlocks(atomicChangeBlocks,allowContradictingEvents);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
protected void beforeFireEvent(){
  Block.sortListEventBlocks(atomicChangeBlocks,getAllowContradictingEvents());
}
Program: 32609
Project: 32609
Buggy source:
/** 
 * Commits the current atomic change to this list change queue.
 */
public final synchronized void commitEvent(){
  if (eventLevel == 0)   throw new IllegalStateException("String_Node_Str");
  eventLevel--;
  allowNestedEvents=true;
  if (eventLevel == 0) {
    beforeFireEvent();
    if (!isEventEmpty()) {
      publisherAdapter.fireEvent();
    }
 else {
      cleanup();
    }
  }
}

Fixed version (ground truth):
/** 
 * Commits the current atomic change to this list change queue.
 */
public final synchronized void commitEvent(){
  if (eventLevel == 0)   throw new IllegalStateException("String_Node_Str");
  eventLevel--;
  allowNestedEvents=true;
  if (eventLevel == 0) {
    beforeFireEvent();
    if (!isEventEmpty()) {
      publisherAdapter.fireEvent();
    }
 else {
      eventPending=false;
      cleanup();
    }
  }
}
Program: 32610
Project: 32610
Buggy source:
/** 
 * Starts a new atomic change to this list change queue.
 */
public final synchronized void beginEvent(boolean allowNestedEvents){
  if (!this.allowNestedEvents) {
    throw new ConcurrentModificationException("String_Node_Str" + eventThread.getName());
  }
  this.allowNestedEvents=allowNestedEvents;
  if (allowNestedEvents || (eventLevel == 0 && !isEventEmpty())) {
    allowContradictingEvents=true;
  }
  if (eventLevel == 0) {
    this.eventThread=Thread.currentThread();
    prepareEvent();
  }
  eventLevel++;
}

Fixed version (ground truth):
/** 
 * Starts a new atomic change to this list change queue.
 */
public final synchronized void beginEvent(boolean allowNestedEvents){
  if (!this.allowNestedEvents) {
    throw new ConcurrentModificationException("String_Node_Str" + eventThread.getName());
  }
  this.allowNestedEvents=allowNestedEvents;
  if (allowNestedEvents || (eventLevel == 0 && eventPending)) {
    setAllowContradictingEvents(true);
  }
  if (!eventPending) {
    this.eventPending=true;
    this.eventThread=Thread.currentThread();
    prepareEvent();
  }
  eventLevel++;
}
Program: 32611
Project: 32611
Buggy source:
public void postEvent(EventList<E> subject){
  assemblerDelegate.cleanup();
  ((ListSequencePublisherAdapter)assemblerDelegate.publisherAdapter).eventEnqueued=false;
}

Fixed version (ground truth):
public void postEvent(EventList<E> subject){
  assemblerDelegate.eventPending=false;
  assemblerDelegate.cleanup();
  ((ListSequencePublisherAdapter)assemblerDelegate.publisherAdapter).eventEnqueued=false;
}
Program: 32612
Project: 32612
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void cleanup(){
  atomicChangeBlocks=null;
  atomicLatestBlock=null;
  reorderMap=null;
  allowContradictingEvents=false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void cleanup(){
  atomicChangeBlocks=null;
  atomicLatestBlock=null;
  reorderMap=null;
  setAllowContradictingEvents(false);
}
Program: 32613
Project: 32613
Buggy source:
/** 
 * Creates a   {@link BasicEventList} using the specified{@link ListEventPublisher} and {@link ReadWriteLock}.
 * @since 2006-June-12
 */
BasicEventList(ListEventPublisher publisher,ReadWriteLock readWriteLock){
  super(publisher);
  this.data=new ArrayList<E>();
  this.readWriteLock=readWriteLock;
}

Fixed version (ground truth):
/** 
 * Creates a   {@link BasicEventList} using the specified{@link ListEventPublisher} and {@link ReadWriteLock}.
 * @since 2006-June-12
 */
public BasicEventList(ListEventPublisher publisher,ReadWriteLock readWriteLock){
  super(publisher);
  this.data=new ArrayList<E>();
  this.readWriteLock=readWriteLock;
}
Program: 32614
Project: 32614
Buggy source:
/** 
 * Adds the specified   {@link EventList} as a source to this {@link CompositeList}.
 */
public void addMemberList(EventList<E> list){
  source.add(list);
}

Fixed version (ground truth):
/** 
 * Adds the specified   {@link EventList} as a source to this {@link CompositeList}. <p> To ensure correct behaviour when this   {@link CompositeList} is used by multiple threads, thespecified EventList has to share the same  {@link ReadWriteLock} and{@link ListEventPublisher} with this CompositeList.
 * @throws IllegalArgumentException if the specified EventList uses a different{@link ReadWriteLock} or {@link ListEventPublisher}
 * @see #createMemberList()
 */
public void addMemberList(EventList<E> list){
  if (!getPublisher().equals(list.getPublisher()))   throw new IllegalArgumentException("String_Node_Str");
  if (!getReadWriteLock().equals(list.getReadWriteLock()))   throw new IllegalArgumentException("String_Node_Str");
  source.add(list);
}
Program: 32615
Project: 32615
Buggy source:
/** 
 * Create a   {@link CompositeList} that uses the given <code>lock</code>.Note that this lock will also be used when  {@link #createMemberList building new member lists}. <p>This can be a convenient constructor to use when the member lists are prebuilt ahead of time with a common   {@link ReadWriteLock} and itis desirable to compose their union with a  {@link CompositeList}.
 * @param lock the {@link ReadWriteLock} to use within the {@link CompositeList}
 */
public CompositeList(ReadWriteLock lock){
  this();
  readWriteLock=lock;
}

Fixed version (ground truth):
/** 
 * Create a   {@link CompositeList} that uses the given <code>publisher</code> and<code>lock</code>. Note that this publisher and lock will also be used when {@link #createMemberList building new member lists}. <p> This can be a convenient constructor to use when the member lists are prebuilt ahead of time with a common   {@link ListEventPublisher} and {@link ReadWriteLock} and it is desirable tocompose their union with a  {@link CompositeList}.
 * @param publisher the {@link ListEventPublisher} to use within the {@link CompositeList}
 * @param lock the {@link ReadWriteLock} to use within the {@link CompositeList}
 */
public CompositeList(ListEventPublisher publisher,ReadWriteLock lock){
  super(new BasicEventList<EventList<E>>(publisher,lock),(Model)GlazedLists.listCollectionListModel());
}
Program: 32616
Project: 32616
Buggy source:
/** 
 * Verifies that remove member list does so by reference.
 */
public void testRemoveByReference(){
  EventList<String> wendys=new BasicEventList<String>();
  EventList<String> mcDonalds=new BasicEventList<String>();
  EventList<String> tacoBell=new BasicEventList<String>();
  CompositeList<String> fastFood=new CompositeList<String>();
  ListConsistencyListener.install(fastFood);
  fastFood.addMemberList(wendys);
  fastFood.addMemberList(mcDonalds);
  fastFood.addMemberList(tacoBell);
  fastFood.removeMemberList(tacoBell);
  fastFood.removeMemberList(wendys);
  assertEquals(mcDonalds,fastFood);
  mcDonalds.add("String_Node_Str");
  assertEquals(mcDonalds,fastFood);
}

Fixed version (ground truth):
/** 
 * Verifies that remove member list does so by reference.
 */
public void testRemoveByReference(){
  CompositeList<String> fastFood=new CompositeList<String>();
  ListConsistencyListener.install(fastFood);
  EventList<String> wendys=fastFood.createMemberList();
  EventList<String> mcDonalds=fastFood.createMemberList();
  EventList<String> tacoBell=fastFood.createMemberList();
  fastFood.addMemberList(wendys);
  fastFood.addMemberList(mcDonalds);
  fastFood.addMemberList(tacoBell);
  fastFood.removeMemberList(tacoBell);
  fastFood.removeMemberList(wendys);
  assertEquals(mcDonalds,fastFood);
  mcDonalds.add("String_Node_Str");
  assertEquals(mcDonalds,fastFood);
}
Program: 32617
Project: 32617
Buggy source:
/** 
 * Verifies that multiple copies of the same list can be added.
 */
public void testMultipleCopies(){
  List<String> fastFoodVerify=new ArrayList<String>();
  EventList<String> wendys=new BasicEventList<String>();
  wendys.add("String_Node_Str");
  EventList<String> mcDonalds=new BasicEventList<String>();
  mcDonalds.add("String_Node_Str");
  mcDonalds.add("String_Node_Str");
  CompositeList<String> fastFood=new CompositeList<String>();
  fastFood.addMemberList(wendys);
  fastFood.addMemberList(mcDonalds);
  fastFoodVerify.clear();
  fastFoodVerify.addAll(wendys);
  fastFoodVerify.addAll(mcDonalds);
  assertEquals(fastFoodVerify,fastFood);
  fastFood.addMemberList(wendys);
  fastFood.addMemberList(mcDonalds);
  fastFoodVerify.clear();
  fastFoodVerify.addAll(wendys);
  fastFoodVerify.addAll(mcDonalds);
  fastFoodVerify.addAll(wendys);
  fastFoodVerify.addAll(mcDonalds);
  assertEquals(fastFoodVerify,fastFood);
  fastFood.removeMemberList(wendys);
  fastFood.removeMemberList(wendys);
  fastFoodVerify.clear();
  fastFoodVerify.addAll(mcDonalds);
  fastFoodVerify.addAll(mcDonalds);
  assertEquals(fastFoodVerify,fastFood);
}

Fixed version (ground truth):
/** 
 * Verifies that multiple copies of the same list can be added.
 */
public void testMultipleCopies(){
  List<String> fastFoodVerify=new ArrayList<String>();
  CompositeList<String> fastFood=new CompositeList<String>();
  EventList<String> wendys=fastFood.createMemberList();
  wendys.add("String_Node_Str");
  EventList<String> mcDonalds=fastFood.createMemberList();
  mcDonalds.add("String_Node_Str");
  mcDonalds.add("String_Node_Str");
  fastFood.addMemberList(wendys);
  fastFood.addMemberList(mcDonalds);
  fastFoodVerify.clear();
  fastFoodVerify.addAll(wendys);
  fastFoodVerify.addAll(mcDonalds);
  assertEquals(fastFoodVerify,fastFood);
  fastFood.addMemberList(wendys);
  fastFood.addMemberList(mcDonalds);
  fastFoodVerify.clear();
  fastFoodVerify.addAll(wendys);
  fastFoodVerify.addAll(mcDonalds);
  fastFoodVerify.addAll(wendys);
  fastFoodVerify.addAll(mcDonalds);
  assertEquals(fastFoodVerify,fastFood);
  fastFood.removeMemberList(wendys);
  fastFood.removeMemberList(wendys);
  fastFoodVerify.clear();
  fastFoodVerify.addAll(mcDonalds);
  fastFoodVerify.addAll(mcDonalds);
  assertEquals(fastFoodVerify,fastFood);
}
Program: 32619
Project: 32619
Buggy source:
/** 
 * Tests that after disposing   {@link CompositeList}, all installed ListEventListeners have been removed, e.g. changes to member lists are ignored.
 */
public void testDispose(){
  final EventList<String> memberListOne=new BasicEventList<String>();
  memberListOne.addAll(GlazedListsTests.stringToList("String_Node_Str"));
  final EventList<String> memberListTwo=new BasicEventList<String>();
  memberListTwo.addAll(GlazedListsTests.stringToList("String_Node_Str"));
  final CompositeList<String> composite=new CompositeList<String>();
  composite.addMemberList(memberListOne);
  composite.addMemberList(memberListTwo);
  final GlazedListsTests.ListEventCounter<String> eventCounter=new GlazedListsTests.ListEventCounter<String>();
  composite.addListEventListener(eventCounter);
  memberListOne.add("String_Node_Str");
  assertEquals(1,eventCounter.getCountAndReset());
  memberListTwo.remove("String_Node_Str");
  assertEquals(1,eventCounter.getCountAndReset());
  composite.dispose();
  memberListOne.remove("String_Node_Str");
  assertEquals(0,eventCounter.getCountAndReset());
  memberListTwo.add(0,"String_Node_Str");
  assertEquals(0,eventCounter.getCountAndReset());
}

Fixed version (ground truth):
/** 
 * Tests that after disposing   {@link CompositeList}, all installed ListEventListeners have been removed, e.g. changes to member lists are ignored.
 */
public void testDispose(){
  final CompositeList<String> composite=new CompositeList<String>();
  final EventList<String> memberListOne=composite.createMemberList();
  memberListOne.addAll(GlazedListsTests.stringToList("String_Node_Str"));
  final EventList<String> memberListTwo=composite.createMemberList();
  memberListTwo.addAll(GlazedListsTests.stringToList("String_Node_Str"));
  composite.addMemberList(memberListOne);
  composite.addMemberList(memberListTwo);
  final GlazedListsTests.ListEventCounter<String> eventCounter=new GlazedListsTests.ListEventCounter<String>();
  composite.addListEventListener(eventCounter);
  memberListOne.add("String_Node_Str");
  assertEquals(1,eventCounter.getCountAndReset());
  memberListTwo.remove("String_Node_Str");
  assertEquals(1,eventCounter.getCountAndReset());
  composite.dispose();
  memberListOne.remove("String_Node_Str");
  assertEquals(0,eventCounter.getCountAndReset());
  memberListTwo.add(0,"String_Node_Str");
  assertEquals(0,eventCounter.getCountAndReset());
}
Program: 32620
Project: 32620
Buggy source:
/** 
 * Verifies that a single source works.
 */
public void testSingleSource(){
  EventList<String> wendys=new BasicEventList<String>();
  wendys.add("String_Node_Str");
  wendys.add("String_Node_Str");
  wendys.add("String_Node_Str");
  wendys.add("String_Node_Str");
  CompositeList<String> fastFood=new CompositeList<String>();
  ListConsistencyListener.install(fastFood);
  fastFood.addMemberList(wendys);
  assertEquals(wendys,fastFood);
  wendys.add("String_Node_Str");
  wendys.add("String_Node_Str");
  assertEquals(wendys,fastFood);
  wendys.remove(1);
  fastFood.set(0,"String_Node_Str");
  fastFood.remove(1);
  assertEquals(wendys,fastFood);
}

Fixed version (ground truth):
/** 
 * Verifies that a single source works.
 */
public void testSingleSource(){
  CompositeList<String> fastFood=new CompositeList<String>();
  ListConsistencyListener.install(fastFood);
  EventList<String> wendys=fastFood.createMemberList();
  wendys.add("String_Node_Str");
  wendys.add("String_Node_Str");
  wendys.add("String_Node_Str");
  wendys.add("String_Node_Str");
  fastFood.addMemberList(wendys);
  assertEquals(wendys,fastFood);
  wendys.add("String_Node_Str");
  wendys.add("String_Node_Str");
  assertEquals(wendys,fastFood);
  wendys.remove(1);
  fastFood.set(0,"String_Node_Str");
  fastFood.remove(1);
  assertEquals(wendys,fastFood);
}
Program: 32621
Project: 32621
Buggy source:
/** 
 * Test that   {@link CompositeList} is well behaved when only a single elementis removed.
 */
public void testSingleElements(){
  EventList<String> alpha=new BasicEventList<String>();
  alpha.add("String_Node_Str");
  EventList<String> beta=new BasicEventList<String>();
  beta.add("String_Node_Str");
  CompositeList<String> aToB=new CompositeList<String>();
  ListConsistencyListener.install(aToB);
  aToB.addMemberList(alpha);
  aToB.removeMemberList(alpha);
  aToB.addMemberList(beta);
}

Fixed version (ground truth):
/** 
 * Test that   {@link CompositeList} is well behaved when only a single elementis removed.
 */
public void testSingleElements(){
  CompositeList<String> aToB=new CompositeList<String>();
  ListConsistencyListener.install(aToB);
  EventList<String> alpha=aToB.createMemberList();
  alpha.add("String_Node_Str");
  EventList<String> beta=aToB.createMemberList();
  beta.add("String_Node_Str");
  aToB.addMemberList(alpha);
  aToB.removeMemberList(alpha);
  aToB.addMemberList(beta);
}
Program: 32623
Project: 32623
Buggy source:
/** 
 * Toggle whether this node is sorted.
 */
public void setSorted(boolean sorted){
  this.sorted=sorted;
}

Fixed version (ground truth):
/** 
 * Toggle whether this node is sorted.
 */
public void setSorted(int sorted){
  this.sorted=sorted;
}
Program: 32625
Project: 32625
Buggy source:
void setSorted(boolean sorted);

Fixed version (ground truth):
void setSorted(int sorted);
Program: 32626
Project: 32626
Buggy source:
/** 
 * Toggle whether this node is sorted.
 */
public void setSorted(boolean sorted){
  this.sorted=sorted;
}

Fixed version (ground truth):
/** 
 * Toggle whether this node is sorted.
 */
public void setSorted(int sorted){
  this.sorted=sorted;
}
Program: 32628
Project: 32628
Buggy source:
/** 
 * Toggle whether this node is sorted.
 */
public void setSorted(boolean sorted){
  this.sorted=sorted;
}

Fixed version (ground truth):
/** 
 * Toggle whether this node is sorted.
 */
public void setSorted(int sorted){
  this.sorted=sorted;
}