nus-yam/ex-repair huggingface dataset:
Program: 90829
Project: 90829
Buggy source:
private void duplicateSelected(){
  final Item selected=(Item)comboBox.getSelectedItem();
  if (selected != null) {
    editor.storeProfile(selected.profile);
    final T duplicate=manager.duplicate(selected.profile);
    manager.select(duplicate);
    editor.loadProfile(duplicate);
    makeModel();
  }
}

Fixed version (ground truth):
private void duplicateSelected(){
  final Item selected=(Item)comboBox.getSelectedItem();
  if (selected != null) {
    if (selected.profile.isBuiltin()) {
      final T duplicate=manager.duplicate(selected.profile);
      editor.storeProfile(duplicate);
      manager.select(duplicate);
      selectionListeners.list.forEach(l -> l.deselected(selected.profile));
      selectionListeners.list.forEach(l -> l.selected(duplicate));
    }
 else {
      editor.storeProfile(selected.profile);
      final T duplicate=manager.duplicate(selected.profile);
      manager.select(duplicate);
      selectionListeners.list.forEach(l -> l.deselected(selected.profile));
      selectionListeners.list.forEach(l -> l.selected(duplicate));
      editor.loadProfile(duplicate);
    }
    makeModel();
  }
}
Program: 90830
Project: 90830
Buggy source:
/** 
 * @param treePath path of this page in the settings tree.
 * @param profileManager
 * @param profileEditPanel
 */
public SelectAndEditProfileSettingsPage(final String treePath,final ProfileManager<T> profileManager,final ProfileEditPanel<T> profileEditPanel){
  this.treePath=treePath;
  this.profileManager=profileManager;
  this.profileEditPanel=profileEditPanel;
  final ProfileSelectionPanel<T> profileSelectionPanel=new ProfileSelectionPanel<>(profileManager,profileEditPanel);
  profileSelectionPanel.setBorder(new EmptyBorder(0,0,10,0));
  profileEditPanel.modificationListeners().add(profileSelectionPanel);
  modificationListeners=new Listeners.SynchronizedList<>();
  profileEditPanel.modificationListeners().add(() -> modificationListeners.list.forEach(ModificationListener::modified));
  profileSelectionPanel.selectionListeners().add(p -> modificationListeners.list.forEach(ModificationListener::modified));
  contentPanel=new JPanel(new BorderLayout());
  contentPanel.add(profileSelectionPanel,BorderLayout.NORTH);
  contentPanel.add(profileEditPanel.getJPanel(),BorderLayout.CENTER);
}

Fixed version (ground truth):
/** 
 * @param treePath path of this page in the settings tree.
 * @param profileManager
 * @param profileEditPanel
 */
public SelectAndEditProfileSettingsPage(final String treePath,final ProfileManager<T> profileManager,final ProfileEditPanel<T> profileEditPanel){
  this.treePath=treePath;
  this.profileManager=profileManager;
  this.profileEditPanel=profileEditPanel;
  profileSelectionPanel=new ProfileSelectionPanel<>(profileManager,profileEditPanel);
  profileSelectionPanel.setBorder(new EmptyBorder(0,0,10,0));
  profileEditPanel.modificationListeners().add(profileSelectionPanel);
  modificationListeners=new Listeners.SynchronizedList<>();
  profileEditPanel.modificationListeners().add(() -> modificationListeners.list.forEach(ModificationListener::modified));
  profileSelectionPanel.selectionListeners().add(p -> modificationListeners.list.forEach(ModificationListener::modified));
  contentPanel=new JPanel(new BorderLayout());
  contentPanel.add(profileSelectionPanel,BorderLayout.NORTH);
  contentPanel.add(profileEditPanel.getJPanel(),BorderLayout.CENTER);
}
Program: 90831
Project: 90831
Buggy source:
private void renameSelected(){
  final Item selected=(Item)comboBox.getSelectedItem();
  if (selected != null) {
    final String oldName=selected.getName();
    final String newName=(String)JOptionPane.showInputDialog(this,"String_Node_Str","String_Node_Str",JOptionPane.PLAIN_MESSAGE,null,null,oldName);
    if (newName != null && !newName.equals(oldName)) {
      try {
        manager.rename(selected.profile,newName);
        makeModel();
      }
 catch (      final IllegalArgumentException e) {
        JOptionPane.showMessageDialog(this,e.getMessage(),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
      }
    }
  }
}

Fixed version (ground truth):
private void renameSelected(){
  final Item selected=(Item)comboBox.getSelectedItem();
  if (selected != null) {
    final String oldName=selected.getName();
    final String newName=(String)JOptionPane.showInputDialog(this,"String_Node_Str","String_Node_Str",JOptionPane.PLAIN_MESSAGE,null,null,oldName);
    if (newName != null && !newName.equals(oldName)) {
      try {
        manager.rename(selected.profile,newName);
        selectionListeners.list.forEach(l -> l.selected(selected.profile));
        makeModel();
      }
 catch (      final IllegalArgumentException e) {
        JOptionPane.showMessageDialog(this,e.getMessage(),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
      }
    }
  }
}
Program: 90832
Project: 90832
Buggy source:
private void removeSelectedRow(){
  int row=table.getSelectedRow();
  if (row >= 0 || row < elements.size()) {
    elements.remove(elements.get(row));
    notifyListeners();
    tableModel.fireTableRowsDeleted(row,row);
    int s=Math.max(row - 1,0);
    table.setRowSelectionInterval(s,s);
    update();
  }
}

Fixed version (ground truth):
private void removeSelectedRow(){
  int row=table.getSelectedRow();
  if (row >= 0 && row < elements.size()) {
    elements.remove(elements.get(row));
    notifyListeners();
    tableModel.fireTableRowsDeleted(row,row);
    int s=Math.max(row - 1,0);
    table.setRowSelectionInterval(s,s);
    update();
  }
}
Program: 90833
Project: 90833
Buggy source:
private void editSelectedRow(){
  final int row=table.getSelectedRow();
  if (row < 0)   return;
 else   if (row == elements.size())   addAndEditRow();
 else   table.editCellAt(row,0);
}

Fixed version (ground truth):
private void editSelectedRow(){
  final int row=table.getSelectedRow();
  if (row == elements.size())   addAndEditRow();
 else   if (row >= 0)   table.editCellAt(row,0);
}
Program: 90834
Project: 90834
Buggy source:
public NavigationActionsMamut(final ViewerPanelMamut viewer){
  this.viewer=viewer;
}

Fixed version (ground truth):
public NavigationActionsMamut(final ViewerPanelMamut viewer){
  this.viewer=viewer;
  this.vg=viewer.getVisibilityAndGrouping();
}
Program: 90835
Project: 90835
Buggy source:
public ProfileSelectionPanel(final ProfileManager<T> manager,final ProfileEditPanel<T> editor){
  this.manager=manager;
  this.editor=editor;
  selectionListeners=new Listeners.SynchronizedList<>();
  comboBox=new JComboBox<>();
  comboBox.setEditable(false);
  final Dimension dim=new Dimension(300,comboBox.getPreferredSize().height);
  comboBox.setPreferredSize(dim);
  comboBox.setMaximumSize(dim);
  buttonDuplicate=new JButton("String_Node_Str");
  buttonRename=new JButton("String_Node_Str");
  buttonDelete=new JButton("String_Node_Str");
  comboBox.addItemListener(e -> {
    final T profile=((Item)e.getItem()).profile;
    if (e.getStateChange() == ItemEvent.SELECTED) {
      manager.select(profile);
      buttonDelete.setEnabled(!profile.isBuiltin());
      buttonRename.setEnabled(!profile.isBuiltin());
      selectionListeners.list.forEach(l -> l.selected(profile));
      editor.loadProfile(profile);
    }
 else {
      selectionListeners.list.forEach(l -> l.deselected(profile));
      editor.storeProfile(profile);
    }
  }
);
  buttonDuplicate.addActionListener(e -> duplicateSelected());
  buttonRename.addActionListener(e -> renameSelected());
  buttonDelete.addActionListener(e -> deleteSelected());
  setLayout(new BoxLayout(this,BoxLayout.LINE_AXIS));
  add(Box.createHorizontalGlue());
  add(comboBox);
  add(buttonDuplicate);
  add(buttonRename);
  add(buttonDelete);
  add(Box.createHorizontalGlue());
  makeModel();
}

Fixed version (ground truth):
public ProfileSelectionPanel(final ProfileManager<T> manager,final ProfileEditPanel<T> editor){
  this.manager=manager;
  this.editor=editor;
  selectionListeners=new Listeners.SynchronizedList<>();
  comboBox=new JComboBox<>();
  comboBox.setEditable(false);
  final Dimension dim=new Dimension(300,comboBox.getPreferredSize().height);
  comboBox.setPreferredSize(dim);
  comboBox.setMaximumSize(dim);
  buttonDuplicate=new JButton("String_Node_Str");
  buttonRename=new JButton("String_Node_Str");
  buttonDelete=new JButton("String_Node_Str");
  comboBox.addItemListener(e -> {
    if (blockComboBoxItemListener)     return;
    final T profile=((Item)e.getItem()).profile;
    if (e.getStateChange() == ItemEvent.SELECTED) {
      manager.select(profile);
      buttonDelete.setEnabled(!profile.isBuiltin());
      buttonRename.setEnabled(!profile.isBuiltin());
      selectionListeners.list.forEach(l -> l.selected(profile));
      editor.loadProfile(profile);
    }
 else {
      selectionListeners.list.forEach(l -> l.deselected(profile));
      editor.storeProfile(profile);
    }
  }
);
  buttonDuplicate.addActionListener(e -> duplicateSelected());
  buttonRename.addActionListener(e -> renameSelected());
  buttonDelete.addActionListener(e -> deleteSelected());
  setLayout(new BoxLayout(this,BoxLayout.LINE_AXIS));
  add(Box.createHorizontalGlue());
  add(comboBox);
  add(buttonDuplicate);
  add(buttonRename);
  add(buttonDelete);
  add(Box.createHorizontalGlue());
  makeModel();
}
Program: 90836
Project: 90836
Buggy source:
private void duplicateSelected(){
  final Item selected=(Item)comboBox.getSelectedItem();
  if (selected != null) {
    final T duplicate=manager.duplicate(selected.profile);
    editor.storeProfile(duplicate);
    manager.select(duplicate);
    editor.loadProfile(selected.profile);
    makeModel();
  }
}

Fixed version (ground truth):
private void duplicateSelected(){
  final Item selected=(Item)comboBox.getSelectedItem();
  if (selected != null) {
    editor.storeProfile(selected.profile);
    final T duplicate=manager.duplicate(selected.profile);
    manager.select(duplicate);
    editor.loadProfile(duplicate);
    makeModel();
  }
}
Program: 90837
Project: 90837
Buggy source:
private void makeModel(){
  final Vector<Item> items=new Vector<>();
  manager.getProfiles().forEach(profile -> items.add(new Item(profile)));
  comboBox.setModel(new DefaultComboBoxModel<>(items));
  final Item selectedItem=new Item(manager.getSelectedProfile());
  buttonDelete.setEnabled(!selectedItem.isBuiltin());
  buttonRename.setEnabled(!selectedItem.isBuiltin());
  comboBox.setSelectedIndex(items.indexOf(selectedItem));
}

Fixed version (ground truth):
private void makeModel(){
  final Vector<Item> items=new Vector<>();
  manager.getProfiles().forEach(profile -> items.add(new Item(profile)));
  comboBox.setModel(new DefaultComboBoxModel<>(items));
  final Item selectedItem=new Item(manager.getSelectedProfile());
  buttonDelete.setEnabled(!selectedItem.isBuiltin());
  buttonRename.setEnabled(!selectedItem.isBuiltin());
  blockComboBoxItemListener=true;
  comboBox.setSelectedIndex(items.indexOf(selectedItem));
  blockComboBoxItemListener=false;
}
Program: 90841
Project: 90841
Buggy source:
private void duplicateSelected(){
  final Item selected=(Item)comboBox.getSelectedItem();
  if (selected != null) {
    final T duplicate=manager.duplicate(selected.profile);
    manager.select(duplicate);
    editor.storeProfile(duplicate);
    editor.loadProfile(selected.profile);
    makeModel();
  }
}

Fixed version (ground truth):
private void duplicateSelected(){
  final Item selected=(Item)comboBox.getSelectedItem();
  if (selected != null) {
    final T duplicate=manager.duplicate(selected.profile);
    editor.storeProfile(duplicate);
    manager.select(duplicate);
    editor.loadProfile(selected.profile);
    makeModel();
  }
}
Program: 90842
Project: 90842
Buggy source:
/** 
 * Returns the   {@link TrackSchemeEdge} currently painted on this display atscreen coordinates specified by  {@code x} and {@code y} and within adistance tolerance. <p> This method exists to facilitate writing mouse handlers. <p> Note that this really only looks at edges that are individually painted on the screen. Edges inside dense ranges are ignored.
 * @param x the x screen coordinate
 * @param y the y screen coordinate
 * @param tolerance the maximal distance to the closest edge.
 * @param ref a reference that will be used to retrieve the result.
 * @return the {@link TrackSchemeEdge} at {@code (x, y)}, or   {@code null} ifthere is no edge within the distance tolerance.
 */
public TrackSchemeEdge getEdgeAt(final int x,final int y,final double tolerance,final TrackSchemeEdge ref){
synchronized (entities) {
    final RealPoint pos=new RealPoint(x,y);
    final RefList<ScreenVertex> vertices=entities.getVertices();
    final ScreenVertex vt=vertices.createRef();
    final ScreenVertex vs=vertices.createRef();
    int i=-1;
    for (    final ScreenEdge e : entities.getEdges()) {
      vertices.get(e.getSourceScreenVertexIndex(),vs);
      vertices.get(e.getTargetScreenVertexIndex(),vt);
      if (distanceToPaintedEdge(pos,e,vs,vt) <= tolerance) {
        i=e.getTrackSchemeEdgeId();
        break;
      }
    }
    vertices.releaseRef(vs);
    vertices.releaseRef(vt);
    if (i < 0)     return null;
    graph.getEdgePool().getObject(i,ref);
    return ref;
  }
}

Fixed version (ground truth):
/** 
 * Returns the   {@link TrackSchemeEdge} currently painted on this display atscreen coordinates specified by  {@code x} and {@code y} and within adistance tolerance. <p> This method exists to facilitate writing mouse handlers. <p> Note that this really only looks at edges that are individually painted on the screen. Edges inside dense ranges are ignored.
 * @param x the x screen coordinate
 * @param y the y screen coordinate
 * @param tolerance the maximal distance to the closest edge.
 * @param ref a reference that will be used to retrieve the result.
 * @return the {@link TrackSchemeEdge} at {@code (x, y)}, or   {@code null} ifthere is no edge within the distance tolerance.
 */
public TrackSchemeEdge getEdgeAt(final int x,final int y,final double tolerance,final TrackSchemeEdge ref){
synchronized (entities) {
    final RealPoint pos=new RealPoint(x,y);
    final RefList<ScreenVertex> vertices=entities.getVertices();
    final ScreenVertex vt=vertices.createRef();
    final ScreenVertex vs=vertices.createRef();
    int i=-1;
    for (    final ScreenEdge e : entities.getEdges()) {
      vertices.get(e.getSourceScreenVertexIndex(),vs);
      vertices.get(e.getTargetScreenVertexIndex(),vt);
      if (distanceToPaintedEdge(pos,e,vs,vt) <= tolerance) {
        i=e.getTrackSchemeEdgeId();
        break;
      }
    }
    vertices.releaseRef(vs);
    vertices.releaseRef(vt);
    return (i >= 0) ? graph.getEdgePool().getObjectIfExists(i,ref) : null;
  }
}
Program: 90843
Project: 90843
Buggy source:
/** 
 * Returns the   {@link TrackSchemeVertex} currently painted on this displayat screen coordinates specified by  {@code x} and {@code y}. <p> This method exists to facilitate writing mouse handlers. <p> Note that this really only looks at vertices that are individually painted on the screen. Vertices inside dense ranges are ignored.
 * @param x the x screen coordinate
 * @param y the y screen coordinate
 * @param ref a reference that will be used to retrieve the result.
 * @return the {@link TrackSchemeVertex} at{@code (x, y)}, or   {@code null} if there is no vertex at this position.
 */
public TrackSchemeVertex getVertexAt(final int x,final int y,final TrackSchemeVertex ref){
synchronized (entities) {
    double d2Best=Double.POSITIVE_INFINITY;
    int iBest=-1;
    final RealPoint pos=new RealPoint(x,y);
    for (    final ScreenVertex v : entities.getVertices()) {
      if (isInsidePaintedVertex(pos,v)) {
        final int i=v.getTrackSchemeVertexId();
        if (i >= 0) {
          final double dx=v.getX() - x;
          final double dy=v.getY() - y;
          final double d2=dx * dx + dy * dy;
          if (d2 < d2Best) {
            d2Best=d2;
            iBest=i;
          }
        }
      }
    }
    if (iBest >= 0) {
      graph.getVertexPool().getObject(iBest,ref);
      return ref;
    }
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Returns the   {@link TrackSchemeVertex} currently painted on this displayat screen coordinates specified by  {@code x} and {@code y}. <p> This method exists to facilitate writing mouse handlers. <p> Note that this really only looks at vertices that are individually painted on the screen. Vertices inside dense ranges are ignored.
 * @param x the x screen coordinate
 * @param y the y screen coordinate
 * @param ref a reference that will be used to retrieve the result.
 * @return the {@link TrackSchemeVertex} at{@code (x, y)}, or   {@code null} if there is no vertex at this position.
 */
public TrackSchemeVertex getVertexAt(final int x,final int y,final TrackSchemeVertex ref){
synchronized (entities) {
    double d2Best=Double.POSITIVE_INFINITY;
    int iBest=-1;
    final RealPoint pos=new RealPoint(x,y);
    for (    final ScreenVertex v : entities.getVertices()) {
      if (isInsidePaintedVertex(pos,v)) {
        final int i=v.getTrackSchemeVertexId();
        if (i >= 0) {
          final double dx=v.getX() - x;
          final double dy=v.getY() - y;
          final double d2=dx * dx + dy * dy;
          if (d2 < d2Best) {
            d2Best=d2;
            iBest=i;
          }
        }
      }
    }
    return (iBest >= 0) ? graph.getVertexPool().getObjectIfExists(iBest,ref) : null;
  }
}
Program: 90844
Project: 90844
Buggy source:
/** 
 * Saves this model to the specified raw file using the specified serializer.
 * @param file the raw file to save.
 * @param serializer the serializer used for writing individual vertices.
 * @param vertexFeaturesToSerialize the vertex features to serialize.
 * @param edgeFeaturesToSerialize the edge features to serialize.
 * @throws IOException if an I/O error occurs while writing the file.
 */
public void saveRaw(final File file,final GraphSerializer<V,E> serializer) throws IOException {
  final FileOutputStream fos=new FileOutputStream(file);
  final ObjectOutputStream oos=new ObjectOutputStream(new BufferedOutputStream(fos,1024 * 1024));
  final GraphToFileIdMap<V,E> fileIdMap=RawGraphIO.write(this,idmap,serializer,oos);
  RawPropertyIO.writePropertyMaps(fileIdMap.vertices(),vertexPropertySerializers,oos);
  oos.close();
}

Fixed version (ground truth):
/** 
 * Saves this model to the specified raw file using the specified serializer.
 * @param file the raw file to save.
 * @param serializer the serializer used for writing individual vertices. //	 * @param vertexFeaturesToSerialize //	 *            the vertex features to serialize. //	 * @param edgeFeaturesToSerialize //	 *            the edge features to serialize.
 * @throws IOException if an I/O error occurs while writing the file.
 */
public void saveRaw(final File file,final GraphSerializer<V,E> serializer) throws IOException {
  final FileOutputStream fos=new FileOutputStream(file);
  final ObjectOutputStream oos=new ObjectOutputStream(new BufferedOutputStream(fos,1024 * 1024));
  final GraphToFileIdMap<V,E> fileIdMap=RawGraphIO.write(this,idmap,serializer,oos);
  RawPropertyIO.writePropertyMaps(fileIdMap.vertices(),vertexPropertySerializers,oos);
  oos.close();
}
Program: 90845
Project: 90845
Buggy source:
/** 
 * Sets the selected state of an edge.
 * @param e an edge.
 * @param selected selected state to set for specified edge.
 */
public void setSelected(final E edge,final boolean selected);

Fixed version (ground truth):
/** 
 * Sets the selected state of an edge.
 * @param edge an edge.
 * @param selected selected state to set for specified edge.
 */
public void setSelected(final E edge,final boolean selected);
Program: 90846
Project: 90846
Buggy source:
/** 
 * Get the selected state of an edge.
 * @param e an edge.
 * @return {@code true} if specified edge is selected.
 */
public boolean isSelected(final E edge);

Fixed version (ground truth):
/** 
 * Get the selected state of an edge.
 * @param edge an edge.
 * @return {@code true} if specified edge is selected.
 */
public boolean isSelected(final E edge);
Program: 90847
Project: 90847
Buggy source:
/** 
 * Toggles the selected state of an edge.
 * @param e an edge.
 */
public void toggle(final E edge);

Fixed version (ground truth):
/** 
 * Toggles the selected state of an edge.
 * @param edge an edge.
 */
public void toggle(final E edge);
Program: 90848
Project: 90848
Buggy source:
/** 
 * Get the   {@link ConvexPolytope} bounding the visible region of globalspace, extended by a large enough border to ensure that it contains center of every ellipsoid that intersects the visible volume.
 * @param transform
 * @param timepoint
 * @return
 */
ConvexPolytope getVisiblePolytopeGlobal(final AffineTransform3D transform,final int timepoint){
  return getOverlappingPolytopeGlobal(0,width,0,height,transform,timepoint);
}

Fixed version (ground truth):
/** 
 * Get the   {@link ConvexPolytope} bounding the visible region of globalspace, extended by a large enough border to ensure that it contains the center of every ellipsoid that intersects the visible volume.
 * @param transform
 * @param timepoint
 * @return
 */
ConvexPolytope getVisiblePolytopeGlobal(final AffineTransform3D transform,final int timepoint){
  return getOverlappingPolytopeGlobal(0,width,0,height,transform,timepoint);
}
Program: 90850
Project: 90850
Buggy source:
/** 
 * Get the   {@link ConvexPolytope} around the specified viewer coordinatethat is large enough border to ensure that it contains center of every ellipsoid containing the specified coordinate.
 * @param x position on the z=0 plane in viewer coordinates.
 * @param y position on the z=0 plane in viewer coordinates.
 * @param transform
 * @param timepoint
 * @return
 */
private ConvexPolytope getSurroundingPolytopeGlobal(final double x,final double y,final AffineTransform3D transform,final int timepoint){
  return getOverlappingPolytopeGlobal(x,x,y,y,transform,timepoint);
}

Fixed version (ground truth):
/** 
 * Get the   {@link ConvexPolytope} around the specified viewer coordinatethat is large enough to ensure that it contains the center of every ellipsoid containing the specified coordinate.
 * @param x position on the z=0 plane in viewer coordinates.
 * @param y position on the z=0 plane in viewer coordinates.
 * @param transform
 * @param timepoint
 * @return
 */
private ConvexPolytope getSurroundingPolytopeGlobal(final double x,final double y,final AffineTransform3D transform,final int timepoint){
  return getOverlappingPolytopeGlobal(x,x,y,y,transform,timepoint);
}
Program: 90851
Project: 90851
Buggy source:
@Override public double getDistance(){
  return wrappedNNS.getDistance();
}

Fixed version (ground truth):
@Override public double getDistance(){
  return wrappedINNS.getDistance();
}
Program: 90852
Project: 90852
Buggy source:
@Override public double getSquareDistance(){
  return wrappedNNS.getSquareDistance();
}

Fixed version (ground truth):
@Override public double getSquareDistance(){
  return wrappedINNS.getSquareDistance();
}
Program: 90853
Project: 90853
Buggy source:
@Override public void search(final RealLocalizable pos){
  wrappedNNS.search(pos);
}

Fixed version (ground truth):
@Override public void search(final RealLocalizable reference){
  wrappedINNS.search(reference);
}
Program: 90854
Project: 90854
Buggy source:
@Override public OverlayVertexWrapper<V,E> get(){
  final V nnv=wrappedNNS.getSampler().get();
  if (nnv == null)   return null;
  final int id=graphWrapper.idmap.getVertexId(nnv);
  v.wv=graphWrapper.idmap.getVertex(id,v.ref);
  return v;
}

Fixed version (ground truth):
@Override public OverlayVertexWrapper<V,E> get(){
  final V nnv=wrappedINNS.get();
  if (nnv == null)   return null;
  final int id=graphWrapper.idmap.getVertexId(nnv);
  v.wv=graphWrapper.idmap.getVertex(id,v.ref);
  return v;
}
Program: 90855
Project: 90855
Buggy source:
@Override public NNS copy(){
  return new NNS(this);
}

Fixed version (ground truth):
@Override public INNS copy(){
  return new INNS(this);
}
Program: 90858
Project: 90858
Buggy source:
@Override public void processEdge(final Link edge,final Spot from,final Spot to,final DepthFirstSearch<Spot,Link> search){
  tmp.set(edge.feature(DISP).getDouble());
  dr.add(tmp);
  n.inc();
}

Fixed version (ground truth):
@Override public void processEdge(final Link edge,final Spot from,final Spot to,final DepthFirstSearch<Spot,Link> search){
  tmp.set(displacement.getDouble(edge));
  dr.add(tmp);
  n.inc();
}
Program: 90859
Project: 90859
Buggy source:
@Override public void releaseRef(final OverlayEdgeWrapper<V,E> e){
  releaseRef(e);
}

Fixed version (ground truth):
@Override public void releaseRef(final OverlayEdgeWrapper<V,E> e){
  OverlayGraphWrapper.this.releaseRef(e);
}
Program: 90860
Project: 90860
Buggy source:
@Override public void notifySet(final Spot spot){
  spot.modelGraph.notifyBeforeVertexCovarianceChange(spot);
}

Fixed version (ground truth):
@Override public void notifySet(final Spot spot){
  spot.modelGraph.notifyRadiusChanged(spot);
}
Program: 90861
Project: 90861
Buggy source:
static AttributeUndoSerializer<Spot> createCovarianceAttributeSerializer(){
  return new PoolObjectAttributeSerializer<Spot>(COVARIANCE_OFFSET,6 * DOUBLE_SIZE + DOUBLE_SIZE){
    @Override public void notifySet(    final Spot spot){
      spot.modelGraph.notifyBeforeVertexCovarianceChange(spot);
    }
  }
;
}

Fixed version (ground truth):
static AttributeUndoSerializer<Spot> createCovarianceAttributeSerializer(){
  return new PoolObjectAttributeSerializer<Spot>(COVARIANCE_OFFSET,6 * DOUBLE_SIZE + DOUBLE_SIZE){
    @Override public void notifySet(    final Spot spot){
      spot.modelGraph.notifyRadiusChanged(spot);
    }
  }
;
}
Program: 90862
Project: 90862
Buggy source:
/** 
 * Create Undo/Redo actions and install them in the specified  {@link InputActionBindings}.
 * @param inputActionBindings {@link InputMap} and {@link ActionMap} are installed here.
 * @param model Actions are targeted at this  {@link Model}s   {@code undo()} and{@code redo()} methods.
 * @param keyProperties user-defined key-bindings.
 */
public static void installActionBindings(final InputActionBindings inputActionBindings,final Model model,final KeyStrokeAdder.Factory keyConfig){
  final UndoActions actions=new UndoActions(keyConfig);
  actions.runnableAction(model::undo,UNDO,UNDO_KEYS);
  actions.runnableAction(model::redo,REDO,REDO_KEYS);
  actions.install(inputActionBindings,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Create Undo/Redo actions and install them in the specified  {@link InputActionBindings}.
 * @param inputActionBindings {@link InputMap} and {@link ActionMap} are installed here.
 * @param model Actions are targeted at this  {@link Model}s   {@code undo()} and{@code redo()} methods.
 */
public static void installActionBindings(final InputActionBindings inputActionBindings,final Model model,final KeyStrokeAdder.Factory keyConfig){
  final UndoActions actions=new UndoActions(keyConfig);
  actions.runnableAction(model::undo,UNDO,UNDO_KEYS);
  actions.runnableAction(model::redo,REDO,REDO_KEYS);
  actions.install(inputActionBindings,"String_Node_Str");
}
Program: 90863
Project: 90863
Buggy source:
/** 
 * Create TrackScheme actions and install them in the specified  {@link InputActionBindings}.
 * @param inputActionBindings {@link InputMap} and {@link ActionMap} are installed here.
 * @param keyProperties user-defined key-bindings.
 */
public static void installActionBindings(final InputActionBindings inputActionBindings,final TrackSchemeFrame frame,final KeyStrokeAdder.Factory keyConfig){
  final TrackSchemeActions actions=new TrackSchemeActions(keyConfig);
  actions.runnableAction(frame.getEditFocusVertex(),EDIT_FOCUS,EDIT_FOCUS_KEYS);
  actions.runnableAction(() -> frame.setSettingsPanelVisible(!frame.isSettingsPanelVisible()),TOGGLE_SETTINGS_PANEL,TOGGLE_SETTINGS_PANEL_KEYS);
  actions.install(inputActionBindings,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Create TrackScheme actions and install them in the specified  {@link InputActionBindings}.
 * @param inputActionBindings {@link InputMap} and {@link ActionMap} are installed here.
 */
public static void installActionBindings(final InputActionBindings inputActionBindings,final TrackSchemeFrame frame,final KeyStrokeAdder.Factory keyConfig){
  final TrackSchemeActions actions=new TrackSchemeActions(keyConfig);
  actions.runnableAction(frame.getEditFocusVertex(),EDIT_FOCUS,EDIT_FOCUS_KEYS);
  actions.runnableAction(() -> frame.setSettingsPanelVisible(!frame.isSettingsPanelVisible()),TOGGLE_SETTINGS_PANEL,TOGGLE_SETTINGS_PANEL_KEYS);
  actions.install(inputActionBindings,"String_Node_Str");
}
Program: 90864
Project: 90864
Buggy source:
public Element toXml(final MamutProject project,final File xmlFileDirectory){
  final Element root=new Element(MAMUTPROJECT_TAG);
  root.setAttribute(SPIMDATA_VERSION_ATTRIBUTE_NAME,SPIMDATA_VERSION_ATTRIBUTE_CURRENT);
  root.addContent(XmlHelpers.pathElement(BASEPATH_TAG,project.getBasePath(),xmlFileDirectory));
  root.addContent(XmlHelpers.pathElement(SPIMDATAFILE_TAG,project.getDatasetXmlFile(),project.getBasePath()));
  root.addContent(XmlHelpers.pathElement(RAWMODELFILE_TAG,project.getRawModelFile(),project.getBasePath()));
  return root;
}

Fixed version (ground truth):
public Element toXml(final MamutProject project,final File xmlFileDirectory){
  final Element root=new Element(MAMUTPROJECT_TAG);
  root.setAttribute(MAMUTPROJECT_VERSION_ATTRIBUTE_NAME,MAMUTPROJECT_VERSION_ATTRIBUTE_CURRENT);
  root.addContent(XmlHelpers.pathElement(BASEPATH_TAG,project.getBasePath(),xmlFileDirectory));
  root.addContent(XmlHelpers.pathElement(SPIMDATAFILE_TAG,project.getDatasetXmlFile(),project.getBasePath()));
  root.addContent(XmlHelpers.pathElement(RAWMODELFILE_TAG,project.getRawModelFile(),project.getBasePath()));
  return root;
}
Program: 90865
Project: 90865
Buggy source:
@Override protected V targetOf(E edge,V ref){
  return edge.getSource(ref);
}

Fixed version (ground truth):
@Override protected V targetOf(final E edge,final V ref){
  return edge.getSource(ref);
}
Program: 90866
Project: 90866
Buggy source:
@Override protected V targetOf(E edge,V ref){
  return edge.getSource(ref);
}

Fixed version (ground truth):
@Override protected V targetOf(final E edge,final V ref){
  return edge.getSource(ref);
}
Program: 90867
Project: 90867
Buggy source:
/** 
 * Clear resources associated with thie UndoableEdit. Currently, this is only implemented in   {@link Other}, where it is used to remove non-ref edits from   {@link UndoableEditList#nonRefEdits}.
 */
public default void clear(){
}

Fixed version (ground truth):
/** 
 * Clear resources associated with thie UndoableEdit. Currently, this is only implemented in   {@code UndoableEditList.Other}, where it is used to remove non-ref edits from   {@link UndoableEditList#nonRefEdits}.
 */
public default void clear(){
}
Program: 90868
Project: 90868
Buggy source:
/** 
 * Notify that bytes have been written (  {@link #setBytes(Object,byte[])}) to   {@code obj}. <p> Note: Currently nothing is ever done in between   {@code setBytes()} and{@code notifySet()}, so maybe this will be removed later and notifications directly linked to   {@codes setBytes}. For now, we keep it explicit.
 */
public void notifySet(final O obj);

Fixed version (ground truth):
/** 
 * Notify that bytes have been written (  {@link #setBytes(Object,byte[])}) to   {@code obj}. <p> Note: Currently nothing is ever done in between   {@code setBytes()} and{@code notifySet()}, so maybe this will be removed later and notifications directly linked to   {@code setBytes()}. For now, we keep it explicit.
 */
public void notifySet(final O obj);
Program: 90869
Project: 90869
Buggy source:
@Override public void drag(final int x,final int y){
  renderer.getGlobalPosition(x,y,pos);
  LinAlgHelpers.add(pos,start,pos);
  vertex.setPosition(pos);
}

Fixed version (ground truth):
@Override public void drag(final int x,final int y){
  if (moving) {
    renderer.getGlobalPosition(x,y,pos);
    LinAlgHelpers.add(pos,start,pos);
    vertex.setPosition(pos);
  }
}
Program: 90870
Project: 90870
Buggy source:
@Override public OverlayEdgeWrapper<V,E> next(){
  edge.we=idmap.getEdge(idmap.getEdgeId(wrappedIterator.next()),edge.we);
  return edge;
}

Fixed version (ground truth):
@Override public OverlayEdgeWrapper<V,E> next(){
  edge.we=idmap.getEdge(idmap.getEdgeId(wrappedIterator.next()),edge.ref);
  return edge;
}
Program: 90871
Project: 90871
Buggy source:
OverlayEdgeWrapper(final OverlayGraphWrapper<V,E> wrapper){
  this.wrapper=wrapper;
  we=wrapper.wrappedGraph.edgeRef();
  overlayProperties=wrapper.overlayProperties;
}

Fixed version (ground truth):
OverlayEdgeWrapper(final OverlayGraphWrapper<V,E> wrapper){
  this.wrapper=wrapper;
  ref=wrapper.wrappedGraph.edgeRef();
  overlayProperties=wrapper.overlayProperties;
}
Program: 90872
Project: 90872
Buggy source:
@Override public OverlayVertexWrapper<V,E> getTarget(final OverlayVertexWrapper<V,E> vertex){
  vertex.wv=we.getTarget(vertex.wv);
  return vertex;
}

Fixed version (ground truth):
@Override public OverlayVertexWrapper<V,E> getTarget(final OverlayVertexWrapper<V,E> vertex){
  vertex.wv=we.getTarget(vertex.ref);
  return vertex;
}
Program: 90873
Project: 90873
Buggy source:
@Override public OverlayVertexWrapper<V,E> getSource(final OverlayVertexWrapper<V,E> vertex){
  vertex.wv=we.getSource(vertex.wv);
  return vertex;
}

Fixed version (ground truth):
@Override public OverlayVertexWrapper<V,E> getSource(final OverlayVertexWrapper<V,E> vertex){
  vertex.wv=we.getSource(vertex.ref);
  return vertex;
}
Program: 90874
Project: 90874
Buggy source:
@Override public OverlayEdgeWrapper<V,E> refTo(final OverlayEdgeWrapper<V,E> obj){
  we=wrapper.idmap.getEdge(obj.getInternalPoolIndex(),we);
  return this;
}

Fixed version (ground truth):
@Override public OverlayEdgeWrapper<V,E> refTo(final OverlayEdgeWrapper<V,E> obj){
  we=wrapper.idmap.getEdge(obj.getInternalPoolIndex(),ref);
  return this;
}
Program: 90875
Project: 90875
Buggy source:
@Override public OverlayVertexWrapper<V,E> getFocusedVertex(final OverlayVertexWrapper<V,E> ref){
  final V h=wrappedFocusModel.getFocusedVertex(ref.wv);
  if (h == null)   return null;
 else {
    ref.wv=idmap.getVertex(idmap.getVertexId(h),ref.wv);
    return ref;
  }
}

Fixed version (ground truth):
@Override public OverlayVertexWrapper<V,E> getFocusedVertex(final OverlayVertexWrapper<V,E> ref){
  ref.wv=wrappedFocusModel.getFocusedVertex(ref.ref);
  return ref.orNull();
}
Program: 90876
Project: 90876
Buggy source:
@Override public void focusVertex(final OverlayVertexWrapper<V,E> vertex){
  if (vertex == null)   wrappedFocusModel.focusVertex(null);
 else   wrappedFocusModel.focusVertex(vertex.wv);
}

Fixed version (ground truth):
@Override public void focusVertex(final OverlayVertexWrapper<V,E> vertex){
  wrappedFocusModel.focusVertex(OverlayVertexWrapper.wrappedOrNull(vertex));
}
Program: 90877
Project: 90877
Buggy source:
@Override public OverlayEdgeWrapper<V,E> getObject(final int index,final OverlayEdgeWrapper<V,E> e){
  e.we=idmap.getEdge(index,e.we);
  return e;
}

Fixed version (ground truth):
@Override public OverlayEdgeWrapper<V,E> getObject(final int index,final OverlayEdgeWrapper<V,E> e){
  e.we=idmap.getEdge(index,e.ref);
  return e;
}
Program: 90878
Project: 90878
Buggy source:
@Override public OverlayEdgeWrapper<V,E> getEdge(final OverlayVertexWrapper<V,E> source,final OverlayVertexWrapper<V,E> target,final OverlayEdgeWrapper<V,E> edge){
  final E we=wrappedGraph.getEdge(source.wv,target.wv,edge.we);
  return we == null ? null : edge;
}

Fixed version (ground truth):
@Override public OverlayEdgeWrapper<V,E> getEdge(final OverlayVertexWrapper<V,E> source,final OverlayVertexWrapper<V,E> target,final OverlayEdgeWrapper<V,E> edge){
  edge.we=wrappedGraph.getEdge(source.wv,target.wv,edge.ref);
  return edge.orNull();
}
Program: 90879
Project: 90879
Buggy source:
@Override public OverlayVertexWrapper<V,E> addVertex(final int timepoint,final double[] position,final double[][] covariance,final OverlayVertexWrapper<V,E> ref){
  ref.wv=overlayProperties.addVertex(timepoint,position,covariance,ref.wv);
  return ref;
}

Fixed version (ground truth):
@Override public OverlayVertexWrapper<V,E> addVertex(final int timepoint,final double[] position,final double[][] covariance,final OverlayVertexWrapper<V,E> ref){
  ref.wv=overlayProperties.addVertex(timepoint,position,covariance,ref.ref);
  return ref;
}
Program: 90880
Project: 90880
Buggy source:
@Override public OverlayEdgeWrapper<V,E> addEdge(final OverlayVertexWrapper<V,E> source,final OverlayVertexWrapper<V,E> target,final OverlayEdgeWrapper<V,E> ref){
  ref.we=overlayProperties.addEdge(source.wv,target.wv,ref.we);
  return ref;
}

Fixed version (ground truth):
@Override public OverlayEdgeWrapper<V,E> addEdge(final OverlayVertexWrapper<V,E> source,final OverlayVertexWrapper<V,E> target,final OverlayEdgeWrapper<V,E> ref){
  ref.we=overlayProperties.addEdge(source.wv,target.wv,ref.ref);
  return ref;
}
Program: 90881
Project: 90881
Buggy source:
@Override public OverlayEdgeWrapper<V,E> getHighlightedEdge(final OverlayEdgeWrapper<V,E> ref){
  final E h=wrappedHighlightModel.getHighlightedEdge(ref.we);
  if (h == null)   return null;
 else {
    ref.we=idmap.getEdge(idmap.getEdgeId(h),ref.we);
    return ref;
  }
}

Fixed version (ground truth):
@Override public OverlayEdgeWrapper<V,E> getHighlightedEdge(final OverlayEdgeWrapper<V,E> ref){
  ref.we=wrappedHighlightModel.getHighlightedEdge(ref.ref);
  return ref.orNull();
}
Program: 90882
Project: 90882
Buggy source:
@Override public OverlayVertexWrapper<V,E> getHighlightedVertex(final OverlayVertexWrapper<V,E> ref){
  final V h=wrappedHighlightModel.getHighlightedVertex(ref.wv);
  if (h == null)   return null;
 else {
    ref.wv=idmap.getVertex(idmap.getVertexId(h),ref.wv);
    return ref;
  }
}

Fixed version (ground truth):
@Override public OverlayVertexWrapper<V,E> getHighlightedVertex(final OverlayVertexWrapper<V,E> ref){
  ref.wv=wrappedHighlightModel.getHighlightedVertex(ref.ref);
  return ref.orNull();
}
Program: 90883
Project: 90883
Buggy source:
@Override public void highlightEdge(final OverlayEdgeWrapper<V,E> edge){
  if (edge == null)   wrappedHighlightModel.highlightEdge(null);
 else   wrappedHighlightModel.highlightEdge(edge.we);
}

Fixed version (ground truth):
@Override public void highlightEdge(final OverlayEdgeWrapper<V,E> edge){
  wrappedHighlightModel.highlightEdge(OverlayEdgeWrapper.wrappedOrNull(edge));
}
Program: 90884
Project: 90884
Buggy source:
@Override public void highlightVertex(final OverlayVertexWrapper<V,E> vertex){
  if (vertex == null)   wrappedHighlightModel.highlightVertex(null);
 else   wrappedHighlightModel.highlightVertex(vertex.wv);
}

Fixed version (ground truth):
@Override public void highlightVertex(final OverlayVertexWrapper<V,E> vertex){
  wrappedHighlightModel.highlightVertex(OverlayVertexWrapper.wrappedOrNull(vertex));
}
Program: 90885
Project: 90885
Buggy source:
@Override public OverlayVertexWrapper<V,E> next(){
  vertex.wv=idmap.getVertex(idmap.getVertexId(wrappedIterator.next()),vertex.wv);
  return vertex;
}

Fixed version (ground truth):
@Override public OverlayVertexWrapper<V,E> next(){
  vertex.wv=idmap.getVertex(idmap.getVertexId(wrappedIterator.next()),vertex.ref);
  return vertex;
}
Program: 90886
Project: 90886
Buggy source:
@Override public Iterator<OverlayEdgeWrapper<V,E>> safe_iterator(){
  return new OverlayEdgeIteratorWrapper<V,E>(wrapper,wrapper.edgeRef(),edges.iterator());
}

Fixed version (ground truth):
@Override public Iterator<OverlayEdgeWrapper<V,E>> safe_iterator(){
  return new OverlayEdgeIteratorWrapper<>(wrapper,wrapper.edgeRef(),wrappedEdges.iterator());
}
Program: 90887
Project: 90887
Buggy source:
@Override public Iterator<OverlayEdgeWrapper<V,E>> iterator(){
  if (iterator == null)   iterator=new OverlayEdgeIteratorWrapper<V,E>(wrapper,wrapper.edgeRef(),edges.iterator());
 else   iterator.wrap(edges.iterator());
  return iterator;
}

Fixed version (ground truth):
@Override public Iterator<OverlayEdgeWrapper<V,E>> iterator(){
  if (iterator == null)   iterator=new OverlayEdgeIteratorWrapper<>(wrapper,wrapper.edgeRef(),wrappedEdges.iterator());
 else   iterator.wrap(wrappedEdges.iterator());
  return iterator;
}
Program: 90888
Project: 90888
Buggy source:
@Override public Edges<OverlayEdgeWrapper<V,E>> incomingEdges(){
  return incomingEdges;
}

Fixed version (ground truth):
@Override public Edges<OverlayEdgeWrapper<V,E>> incomingEdges(){
  incomingEdges.wrap(wv.incomingEdges());
  return incomingEdges;
}
Program: 90889
Project: 90889
Buggy source:
@Override public OverlayEdgeWrapper<V,E> get(final int i,final OverlayEdgeWrapper<V,E> edge){
  edge.we=edges.get(i,edge.we);
  return edge;
}

Fixed version (ground truth):
@Override public OverlayEdgeWrapper<V,E> get(final int i,final OverlayEdgeWrapper<V,E> edge){
  edge.we=wrappedEdges.get(i,edge.ref);
  return edge;
}
Program: 90890
Project: 90890
Buggy source:
@Override public OverlayVertexWrapper<V,E> refTo(final OverlayVertexWrapper<V,E> obj){
  wv=wrapper.idmap.getVertex(obj.getInternalPoolIndex(),wv);
  return this;
}

Fixed version (ground truth):
@Override public OverlayVertexWrapper<V,E> refTo(final OverlayVertexWrapper<V,E> obj){
  wv=wrapper.idmap.getVertex(obj.getInternalPoolIndex(),ref);
  return this;
}
Program: 90891
Project: 90891
Buggy source:
@Override public Edges<OverlayEdgeWrapper<V,E>> edges(){
  return edges;
}

Fixed version (ground truth):
@Override public Edges<OverlayEdgeWrapper<V,E>> edges(){
  edges.wrap(wv.edges());
  return edges;
}
Program: 90892
Project: 90892
Buggy source:
@Override public boolean isEmpty(){
  return edges.isEmpty();
}

Fixed version (ground truth):
@Override public boolean isEmpty(){
  return wrappedEdges.isEmpty();
}
Program: 90893
Project: 90893
Buggy source:
@Override public Edges<OverlayEdgeWrapper<V,E>> outgoingEdges(){
  return outgoingEdges;
}

Fixed version (ground truth):
@Override public Edges<OverlayEdgeWrapper<V,E>> outgoingEdges(){
  outgoingEdges.wrap(wv.outgoingEdges());
  return outgoingEdges;
}
Program: 90894
Project: 90894
Buggy source:
@Override public int size(){
  return edges.size();
}

Fixed version (ground truth):
@Override public int size(){
  return wrappedEdges.size();
}
Program: 90895
Project: 90895
Buggy source:
OverlayVertexWrapper(final OverlayGraphWrapper<V,E> wrapper){
  this.wrapper=wrapper;
  wv=wrapper.wrappedGraph.vertexRef();
  incomingEdges=new EdgesWrapper(wv.incomingEdges());
  outgoingEdges=new EdgesWrapper(wv.outgoingEdges());
  edges=new EdgesWrapper(wv.edges());
  overlayProperties=wrapper.overlayProperties;
}

Fixed version (ground truth):
OverlayVertexWrapper(final OverlayGraphWrapper<V,E> wrapper){
  this.wrapper=wrapper;
  ref=wrapper.wrappedGraph.vertexRef();
  incomingEdges=new EdgesWrapper();
  outgoingEdges=new EdgesWrapper();
  edges=new EdgesWrapper();
  overlayProperties=wrapper.overlayProperties;
}
Program: 90896
Project: 90896
Buggy source:
@Override public void vertexAdded(final Spot v){
  writeLock.lock();
  try {
    final int t=v.getTimepoint();
    Stats stats=timepointToStats.get(t);
    if (stats == null) {
      stats=new Stats(graph.vertexRef());
      timepointToStats.put(t,stats);
    }
    stats.add(v);
  }
  finally {
    writeLock.lock();
  }
}

Fixed version (ground truth):
@Override public void vertexAdded(final Spot v){
  writeLock.lock();
  try {
    final int t=v.getTimepoint();
    Stats stats=timepointToStats.get(t);
    if (stats == null) {
      stats=new Stats(graph.vertexRef());
      timepointToStats.put(t,stats);
    }
    stats.add(v);
  }
  finally {
    writeLock.unlock();
  }
}
Program: 90898
Project: 90898
Buggy source:
public ModelSpotUndoRecorder(final AbstractModelGraph<?,?,?,Spot,Link,?> graph,final GraphFeatures<Spot,Link> graphFeatures,final GraphIdBimap<Spot,Link> idmap,final UndoSerializer<Spot,Link> serializer){
  super(graph,graphFeatures,new ModelSpotUndoableEditList(defaultCapacity,graph,graphFeatures,serializer,new UndoIdBimap<>(idmap.vertexIdBimap()),new UndoIdBimap<>(idmap.edgeIdBimap())));
  graph.addAbstractSpotListener(this);
}

Fixed version (ground truth):
public ModelSpotUndoRecorder(final AbstractModelGraph<?,?,?,Spot,Link,?> graph,final Features<Spot> vertexFeatures,final Features<Link> edgeFeatures,final GraphIdBimap<Spot,Link> idmap,final UndoSerializer<Spot,Link> serializer){
  super(graph,vertexFeatures,edgeFeatures,new ModelSpotUndoableEditList(defaultCapacity,graph,vertexFeatures,edgeFeatures,serializer,new UndoIdBimap<>(idmap.vertexIdBimap()),new UndoIdBimap<>(idmap.edgeIdBimap())));
  graph.addAbstractSpotListener(this);
}
Program: 90899
Project: 90899
Buggy source:
@Override public SetVertexCovariance createInstance(final UndoableEditRef<Spot,Link> ref){
  return new SetVertexCovariance(ref,typeIndex());
}

Fixed version (ground truth):
@Override public SetVertexCovariance createInstance(final UndoableEditRef ref){
  return new SetVertexCovariance(ref,typeIndex());
}
Program: 90900
Project: 90900
Buggy source:
public ModelSpotUndoableEditList(final int initialCapacity,final ListenableGraph<Spot,Link> graph,final GraphFeatures<Spot,Link> graphFeatures,final UndoSerializer<Spot,Link> serializer,final UndoIdBimap<Spot> vertexUndoIdBimap,final UndoIdBimap<Link> edgeUndoIdBimap){
  super(initialCapacity,graph,graphFeatures,serializer,vertexUndoIdBimap,edgeUndoIdBimap);
}

Fixed version (ground truth):
public ModelSpotUndoableEditList(final int initialCapacity,final ListenableGraph<Spot,Link> graph,final Features<Spot> vertexFeatures,final Features<Link> edgeFeatures,final UndoSerializer<Spot,Link> serializer,final UndoIdBimap<Spot> vertexUndoIdBimap,final UndoIdBimap<Link> edgeUndoIdBimap){
  super(initialCapacity,graph,vertexFeatures,edgeFeatures,serializer,vertexUndoIdBimap,edgeUndoIdBimap);
}
Program: 90901
Project: 90901
Buggy source:
public void recordSetCovariance(final Spot vertex){
  final UndoableEditRef<Spot,Link> ref=createRef();
  boolean createNewEdit=true;
  if (nextEditIndex > 0) {
    final UndoableEditRef<Spot,Link> edit=get(nextEditIndex - 1,ref);
    createNewEdit=!setVertexPosition.isInstance(edit) || edit.isUndoPoint();
  }
  if (createNewEdit)   create(ref).getEdit(setVertexCovariance).init(vertex);
  releaseRef(ref);
}

Fixed version (ground truth):
public void recordSetCovariance(final Spot vertex){
  final UndoableEditRef ref=createRef();
  boolean createNewEdit=true;
  if (nextEditIndex > 0) {
    final UndoableEditRef edit=get(nextEditIndex - 1,ref);
    createNewEdit=!setVertexPosition.isInstance(edit) || edit.isUndoPoint();
  }
  if (createNewEdit)   create(ref).getEdit(setVertexCovariance).init(vertex);
  releaseRef(ref);
}
Program: 90902
Project: 90902
Buggy source:
SetVertexCovariance(final UndoableEditRef<Spot,Link> ref,final int typeIndex){
  super(ref,typeIndex);
  mat=new double[numDimensions][numDimensions];
  tmp=new double[numDimensions][numDimensions];
}

Fixed version (ground truth):
SetVertexCovariance(final UndoableEditRef ref,final int typeIndex){
  super(ref,typeIndex);
  mat=new double[numDimensions][numDimensions];
  tmp=new double[numDimensions][numDimensions];
}
Program: 90903
Project: 90903
Buggy source:
public void recordSetCovariance(final Spot vertex){
  final UndoableEditRef ref=createRef();
  boolean createNewEdit=true;
  if (nextEditIndex > 0) {
    final UndoableEditRef edit=get(nextEditIndex - 1,ref);
    createNewEdit=!setVertexPosition.isInstance(edit) || edit.isUndoPoint();
  }
  if (createNewEdit)   create(ref).getEdit(setVertexCovariance).init(vertex);
  releaseRef(ref);
}

Fixed version (ground truth):
public void recordSetCovariance(final Spot vertex){
  final UndoableEditRef ref=createRef();
  boolean createNewEdit=true;
  if (nextEditIndex > 0) {
    final UndoableEditRef edit=get(nextEditIndex - 1,ref);
    createNewEdit=!setVertexCovariance.isInstance(edit) || edit.isUndoPoint();
  }
  if (createNewEdit)   create(ref).getEdit(setVertexCovariance).init(vertex);
  releaseRef(ref);
}
Program: 90904
Project: 90904
Buggy source:
public <F extends FeatureValue<?>,M>F feature(final EdgeFeature<M,E,F> feature);

Fixed version (ground truth):
public <F extends FeatureValue<?>,M>F feature(final Feature<M,E,F> feature);
Program: 90905
Project: 90905
Buggy source:
public IntRefMap<O> createIntRefMap(final int noEntryKey,final int initialCapacity);

Fixed version (ground truth):
public static <O>IntRefMap<O> createIntRefMap(final RefCollection<O> collection,final int noEntryKey,final int initialCapacity){
  if (collection instanceof MapCreator)   return ((MapCreator<O>)collection).createIntRefMap(noEntryKey,initialCapacity);
 else   return new IntRefMapWrapper<O>(noEntryKey,initialCapacity);
}