nus-yam/ex-repair huggingface dataset:
Program: 190174
Project: 190174
Buggy source:
/** 
 * Creates and edge between source and target node (if does not already exist), directed or undirected. This will not create a self-loop.
 * @param source Source node
 * @param target Target node
 * @param directed Indicates if the edge has to be directed
 * @return True if the edge was created succesfully, false otherwise
 */
boolean createEdge(Node source,Node target,boolean directed);

Fixed version (ground truth):
/** 
 * Creates and edge between source and target node (if does not already exist), directed or undirected. If a edge with the given id already exists, no edge will be created. This will not create a self-loop.
 * @param source Source node
 * @param target Target node
 * @param directed Indicates if the edge has to be directed
 * @return New edge if the edge was created succesfully, null otherwise
 */
Edge createEdge(String id,Node source,Node target,boolean directed);
Program: 190175
Project: 190175
Buggy source:
public Node createNode(String label,String id){
  Graph graph=getGraph();
  if (graph.getNode(id) == null) {
    Node newNode=buildNode(label,id);
    graph.addNode(newNode);
    return newNode;
  }
 else   return null;
}

Fixed version (ground truth):
public Node createNode(String label,String id){
  Graph graph=getGraph();
  if (graph.getNode(id) == null) {
    Node newNode=buildNode(label,id);
    graph.addNode(newNode);
    return newNode;
  }
 else {
    return null;
  }
}
Program: 190176
Project: 190176
Buggy source:
public boolean createEdge(Node source,Node target,boolean directed){
  if (isNodeInGraph(source) && isNodeInGraph(target)) {
    if (source != target) {
      if (directed) {
        return getDirectedGraph().addEdge(source,target);
      }
 else {
        return getUndirectedGraph().addEdge(source,target);
      }
    }
 else {
      return false;
    }
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
public Edge createEdge(String id,Node source,Node target,boolean directed){
  Edge newEdge;
  if (getGraph().getEdge(id) == null) {
    if (source != target) {
      if (directed) {
        newEdge=buildEdge(id,source,target,true);
        if (getDirectedGraph().addEdge(newEdge)) {
          return newEdge;
        }
 else {
          return null;
        }
      }
 else {
        newEdge=buildEdge(id,source,target,false);
        if (getUndirectedGraph().addEdge(newEdge)) {
          return newEdge;
        }
 else {
          return null;
        }
      }
    }
 else {
      return null;
    }
  }
 else {
    return null;
  }
}
Program: 190177
Project: 190177
Buggy source:
private Node buildNode(String label,String id){
  Node newNode=Lookup.getDefault().lookup(GraphController.class).getModel().factory().newNode(id);
  newNode.getNodeData().setLabel(label);
  return newNode;
}

Fixed version (ground truth):
private Node buildNode(String label,String id){
  Node newNode=Lookup.getDefault().lookup(GraphController.class).getModel().factory().newNode(id);
  getGraph().setId(newNode,id);
  newNode.getNodeData().setLabel(label);
  return newNode;
}
Program: 190178
Project: 190178
Buggy source:
public void deleteWorkspace(Workspace workspace){
  fireWorkspaceEvent(EventType.CLOSE,workspace);
  WorkspaceInformation wi=workspace.getLookup().lookup(WorkspaceInformation.class);
  WorkspaceProviderImpl workspaceProvider=wi.getProject().getLookup().lookup(WorkspaceProviderImpl.class);
  if (getCurrentWorkspace() == workspace) {
    Workspace toSelectWorkspace=workspaceProvider.getPrecedingWorkspace(workspace);
    if (toSelectWorkspace == null) {
      closeCurrentProject();
      return;
    }
 else {
      openWorkspace(toSelectWorkspace);
    }
  }
  workspaceProvider.removeWorkspace(workspace);
}

Fixed version (ground truth):
public void deleteWorkspace(Workspace workspace){
  WorkspaceInformation wi=workspace.getLookup().lookup(WorkspaceInformation.class);
  WorkspaceProviderImpl workspaceProvider=wi.getProject().getLookup().lookup(WorkspaceProviderImpl.class);
  workspaceProvider.removeWorkspace(workspace);
  fireWorkspaceEvent(EventType.CLOSE,workspace);
  if (getCurrentWorkspace() == workspace) {
    Workspace toSelectWorkspace=workspaceProvider.getPrecedingWorkspace(workspace);
    if (toSelectWorkspace == null) {
      closeCurrentProject();
      return;
    }
 else {
      openWorkspace(toSelectWorkspace);
    }
  }
}
Program: 190179
Project: 190179
Buggy source:
public void close(Workspace workspace){
}

Fixed version (ground truth):
public void close(Workspace workspace){
  panel.refreshList();
}
Program: 190182
Project: 190182
Buggy source:
@Override public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
  NumberList numberList=(NumberList)value;
  if (numberList == null) {
    return super.getTableCellRendererComponent(table,"String_Node_Str",isSelected,hasFocus,row,column);
  }
 else   if (numberList.size() < 2) {
    return super.getTableCellRendererComponent(table,numberList.toString(),isSelected,hasFocus,row,column);
  }
  ArrayList<Number> numbers=new ArrayList<Number>();
  Number n;
  for (int i=0; i < numberList.size(); i++) {
    n=(Number)numberList.getItem(i);
    if (n != null) {
      numbers.add(n);
    }
  }
  JLabel label=new JLabel();
  Color background;
  if (isSelected) {
    background=SELECTED_BACKGROUND;
  }
 else {
    background=UNSELECTED_BACKGROUND;
  }
  final SizeParams size=new SizeParams(table.getColumnModel().getColumn(column).getWidth(),table.getRowHeight(row) - 1,1);
  final BufferedImage i=LineGraph.createGraph(numbers.toArray(new Number[0]),size,Color.BLUE,background);
  label.setIcon(new ImageIcon(i));
  label.setToolTipText(numberList.toString());
  return label;
}

Fixed version (ground truth):
@Override public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
  NumberList numberList=(NumberList)value;
  if (numberList == null) {
    return super.getTableCellRendererComponent(table,"String_Node_Str",isSelected,hasFocus,row,column);
  }
 else   if (numberList.size() < 2) {
    return super.getTableCellRendererComponent(table,numberList.toString(),isSelected,hasFocus,row,column);
  }
  JLabel label=new JLabel();
  ArrayList<Number> numbers=new ArrayList<Number>();
  Number n;
  for (int i=0; i < numberList.size(); i++) {
    n=(Number)numberList.getItem(i);
    if (n != null) {
      numbers.add(n);
    }
  }
  Color background;
  if (isSelected) {
    background=SELECTED_BACKGROUND;
  }
 else {
    background=UNSELECTED_BACKGROUND;
  }
  final SizeParams size=new SizeParams(table.getColumnModel().getColumn(column).getWidth(),table.getRowHeight(row) - 1,1);
  final BufferedImage i=LineGraph.createGraph(numbers.toArray(new Number[0]),size,Color.BLUE,background);
  label.setIcon(new ImageIcon(i));
  label.setToolTipText(numberList.toString());
  return label;
}
Program: 190183
Project: 190183
Buggy source:
private AbstractNode[] deleteNode(AbstractNode node){
  AbstractNode[] descendants=new AbstractNode[node.size + 1];
  int i=0;
  for (DescendantAndSelfIterator itr=new DescendantAndSelfIterator(treeStructure,node,Tautology.instance); itr.hasNext(); ) {
    AbstractNode descendant=itr.next();
    descendants[i]=descendant;
    if (descendant.isEnabled()) {
      edgeProcessor.clearMetaEdges(descendant);
      view.decNodesEnabled(1);
    }
    AbstractEdge[] deletedEdges=edgeProcessor.clearEdges(descendant);
    if (deletedEdges != null) {
      for (int j=0; j < deletedEdges.length; j++) {
        dhns.getGraphStructure().removeFromDictionnary(deletedEdges[j]);
        dhns.getEventManager().fireEvent(new EdgeEvent(EventType.REMOVE_EDGES,deletedEdges[j],view));
      }
    }
    if (node.countInViews() == 1) {
      dhns.getGraphStructure().removeFromDictionnary(descendant);
    }
    i++;
  }
  treeStructure.deleteDescendantAndSelf(node);
  return descendants;
}

Fixed version (ground truth):
private AbstractNode[] deleteNode(AbstractNode node){
  AbstractNode[] descendants=new AbstractNode[node.size + 1];
  int i=0;
  for (DescendantAndSelfIterator itr=new DescendantAndSelfIterator(treeStructure,node,Tautology.instance); itr.hasNext(); ) {
    AbstractNode descendant=itr.next();
    descendants[i]=descendant;
    if (descendant.isEnabled()) {
      edgeProcessor.clearMetaEdges(descendant);
      view.decNodesEnabled(1);
    }
    AbstractEdge[] deletedEdges=edgeProcessor.clearEdges(descendant);
    if (deletedEdges != null) {
      for (int j=0; j < deletedEdges.length; j++) {
        if (deletedEdges[j] != null) {
          dhns.getGraphStructure().removeFromDictionnary(deletedEdges[j]);
          dhns.getEventManager().fireEvent(new EdgeEvent(EventType.REMOVE_EDGES,deletedEdges[j],view));
        }
      }
    }
    if (node.countInViews() == 1) {
      dhns.getGraphStructure().removeFromDictionnary(descendant);
    }
    i++;
  }
  treeStructure.deleteDescendantAndSelf(node);
  return descendants;
}
Program: 190184
Project: 190184
Buggy source:
public synchronized void removeColumn(AttributeColumn column){
  columns.remove((AttributeColumnImpl)column);
  columnsMap.remove(column.getId());
  if (column.getTitle() != null && !column.getTitle().equals(column.getId())) {
    columnsMap.remove(column.getTitle());
  }
  columnsSet.remove(column);
  fireAttributeEvent(new AttributeEventImpl(AttributeEvent.EventType.REMOVE_COLUMN,this,column));
  version++;
}

Fixed version (ground truth):
public synchronized void removeColumn(AttributeColumn column){
  int index=columns.indexOf(column);
  if (index == -1) {
    return;
  }
  AttributeColumnImpl c;
  for (index=index + 1; index < columns.size(); index++) {
    c=columns.get(index);
    c.index--;
  }
  columns.remove((AttributeColumnImpl)column);
  columnsMap.remove(column.getId());
  if (column.getTitle() != null && !column.getTitle().equals(column.getId())) {
    columnsMap.remove(column.getTitle());
  }
  columnsSet.remove(column);
  fireAttributeEvent(new AttributeEventImpl(AttributeEvent.EventType.REMOVE_COLUMN,this,column));
  version++;
}
Program: 190185
Project: 190185
Buggy source:
public AbstractEdge newEdge(String id,Node source,Node target,float weight,boolean directed){
  if (source == null || target == null) {
    throw new NullPointerException();
  }
  AbstractNode nodeSource=(AbstractNode)source;
  AbstractNode nodeTarget=(AbstractNode)target;
  AbstractEdge edge;
  if (source == target) {
    edge=new SelfLoopImpl(idGen.newEdgeId(),nodeSource);
  }
 else {
    edge=new MixedEdgeImpl(idGen.newEdgeId(),nodeSource,nodeTarget,directed);
  }
  edge.setWeight(weight);
  edge.setAttributes(newEdgeAttributes());
  edge.getEdgeData().setTextData(newTextData());
  if (id != null) {
    edge.getEdgeData().setId(id);
  }
 else {
    edge.getEdgeData().setId("String_Node_Str" + edge.getId());
  }
  return edge;
}

Fixed version (ground truth):
public AbstractEdge newEdge(String id,Node source,Node target,float weight,boolean directed){
  if (source == null || target == null) {
    throw new NullPointerException();
  }
  AbstractNode nodeSource=(AbstractNode)source;
  AbstractNode nodeTarget=(AbstractNode)target;
  AbstractEdge edge;
  if (source == target) {
    edge=new SelfLoopImpl(idGen.newEdgeId(),nodeSource);
  }
 else {
    edge=new MixedEdgeImpl(idGen.newEdgeId(),nodeSource,nodeTarget,directed);
  }
  edge.setAttributes(newEdgeAttributes());
  edge.setWeight(weight);
  edge.getEdgeData().setTextData(newTextData());
  if (id != null) {
    edge.getEdgeData().setId(id);
  }
 else {
    edge.getEdgeData().setId("String_Node_Str" + edge.getId());
  }
  return edge;
}
Program: 190188
Project: 190188
Buggy source:
public void setValue(FilterProperty property,Object value,Callback callback){
  if (model != null) {
    Query query=model.getQuery(property.getFilter());
    if (query == null) {
      callback.setValue(value);
      return;
    }
    AbstractQueryImpl rootQuery=((AbstractQueryImpl)query).getRoot();
    FilterThread filterThread=null;
    if ((filterThread=model.getFilterThread()) != null && model.getCurrentQuery() == rootQuery) {
      filterThread.addModifier(new PropertyModifier(query,property,value,callback));
      filterThread.setRootQuery(rootQuery);
    }
 else {
      callback.setValue(value);
      model.updateParameters(query);
    }
  }
}

Fixed version (ground truth):
public void setValue(FilterProperty property,Object value,Callback callback){
  if (model != null) {
    Query query=model.getQuery(property.getFilter());
    if (query == null) {
      callback.setValue(value);
      return;
    }
    AbstractQueryImpl rootQuery=((AbstractQueryImpl)query).getRoot();
    FilterThread filterThread=null;
    if ((filterThread=model.getFilterThread()) != null && model.getCurrentQuery() == rootQuery) {
      filterThread.addModifier(new PropertyModifier(query,property,value,callback));
      filterThread.setRootQuery(rootQuery);
    }
 else {
      callback.setValue(value);
      model.updateParameters(query);
    }
  }
 else {
    callback.setValue(value);
  }
}
Program: 190189
Project: 190189
Buggy source:
private Query readQuery(Element queryE){
  String builderClassName=queryE.getAttribute("String_Node_Str");
  FilterBuilder builder=null;
  for (  FilterBuilder fb : filterLibraryImpl.getLookup().lookupAll(FilterBuilder.class)) {
    if (fb.getClass().getName().equals(builderClassName)) {
      builder=fb;
    }
  }
  if (builder != null) {
    Filter filter=builder.getFilter();
    FilterController fc=Lookup.getDefault().lookup(FilterController.class);
    Query query=fc.createQuery(filter);
    NodeList paramList=queryE.getElementsByTagName("String_Node_Str");
    for (int i=0; i < paramList.getLength(); i++) {
      Node n=paramList.item(i);
      if (n.getNodeType() == Node.ELEMENT_NODE) {
        Element paramE=(Element)n;
        int index=Integer.parseInt(paramE.getAttribute("String_Node_Str"));
        FilterProperty property=query.getFilter().getProperties()[index];
        try {
          PropertyEditor editor=property.getPropertyEditor();
          if (editor == null) {
            editor=PropertyEditorManager.findEditor(property.getValueType());
          }
          if (editor != null) {
            String textValue=paramE.getTextContent();
            editor.setAsText(textValue);
            property.setValue(editor.getValue());
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
      }
    }
    return query;
  }
  return null;
}

Fixed version (ground truth):
private Query readQuery(Element queryE){
  String builderClassName=queryE.getAttribute("String_Node_Str");
  FilterBuilder builder=null;
  for (  FilterBuilder fb : filterLibraryImpl.getLookup().lookupAll(FilterBuilder.class)) {
    if (fb.getClass().getName().equals(builderClassName)) {
      builder=fb;
    }
  }
  if (builder != null) {
    Filter filter=builder.getFilter();
    FilterController fc=Lookup.getDefault().lookup(FilterController.class);
    Query query=fc.createQuery(filter);
    NodeList paramList=queryE.getElementsByTagName("String_Node_Str");
    for (int i=0; i < paramList.getLength(); i++) {
      Node n=paramList.item(i);
      if (n.getNodeType() == Node.ELEMENT_NODE) {
        Element paramE=(Element)n;
        int index=Integer.parseInt(paramE.getAttribute("String_Node_Str"));
        FilterProperty property=query.getFilter().getProperties()[index];
        try {
          PropertyEditor editor=property.getPropertyEditor();
          if (editor == null) {
            editor=PropertyEditorManager.findEditor(property.getValueType());
          }
          if (editor != null) {
            String textValue=paramE.getTextContent();
            editor.setAsText(textValue);
            property.setValue(editor.getValue());
            updateParameters(query);
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
      }
    }
    return query;
  }
  return null;
}
Program: 190191
Project: 190191
Buggy source:
public synchronized void removeColumn(AttributeColumn column){
  columns.remove((AttributeColumnImpl)column);
  columnsMap.remove(column.getId());
  if (column.getTitle() != null && !column.getTitle().equals(column.getId())) {
    columnsMap.remove(column.getTitle());
  }
  columnsSet.remove(column);
  fireAttributeEvent(new AttributeEventImpl(AttributeEvent.EventType.REMOVE_COLUMN,this,column));
  version++;
}

Fixed version (ground truth):
public synchronized void removeColumn(AttributeColumn column){
  int index=columns.indexOf(column);
  if (index == -1) {
    return;
  }
  AttributeColumnImpl c;
  for (index=index + 1; index < columns.size(); index++) {
    c=columns.get(index);
    c.index--;
  }
  columns.remove((AttributeColumnImpl)column);
  columnsMap.remove(column.getId());
  if (column.getTitle() != null && !column.getTitle().equals(column.getId())) {
    columnsMap.remove(column.getTitle());
  }
  columnsSet.remove(column);
  fireAttributeEvent(new AttributeEventImpl(AttributeEvent.EventType.REMOVE_COLUMN,this,column));
  version++;
}
Program: 190192
Project: 190192
Buggy source:
public void contract(){
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        Set<Node> parents=new HashSet<Node>();
        for (        ModelImpl metaModelImpl : models) {
          NodeData nodeData=(NodeData)metaModelImpl.getObj();
          Node node=nodeData.getNode(graph.getView().getViewId());
          Node nodeParent=graph.getParent(node);
          if (nodeParent != null) {
            parents.add(nodeParent);
          }
        }
        for (        Node parent : parents) {
          GroupData gd=(GroupData)parent.getNodeData();
          if (gd.getHullModel() != null) {
            ConvexHull hull=((ConvexHullModel)gd.getHullModel()).getObj();
            contractPositioning(hull);
          }
          graph.retract(parent);
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
        graph.readUnlockAll();
      }
    }
  }
,"String_Node_Str").start();
}

Fixed version (ground truth):
public void contract(){
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        Set<Node> parents=new HashSet<Node>();
        for (        ModelImpl metaModelImpl : models) {
          NodeData nodeData=(NodeData)metaModelImpl.getObj();
          Node node=nodeData.getNode(graph.getView().getViewId());
          if (node != null) {
            Node nodeParent=graph.getParent(node);
            if (nodeParent != null) {
              parents.add(nodeParent);
            }
          }
        }
        for (        Node parent : parents) {
          GroupData gd=(GroupData)parent.getNodeData();
          if (gd.getHullModel() != null) {
            ConvexHull hull=((ConvexHullModel)gd.getHullModel()).getObj();
            contractPositioning(hull);
          }
          graph.retract(parent);
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
        graph.readUnlockAll();
      }
    }
  }
,"String_Node_Str").start();
}
Program: 190193
Project: 190193
Buggy source:
public void ungroup(){
  this.graph=graphController.getModel().getHierarchicalGraph();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        Set<Node> parents=new HashSet<Node>();
        for (        ModelImpl metaModelImpl : models) {
          NodeData nodeData=(NodeData)metaModelImpl.getObj();
          Node node=nodeData.getNode(graph.getView().getViewId());
          if (graph.getDescendantCount(node) > 0) {
            parents.add(node);
          }
 else           if (graph.getParent(node) != null) {
            parents.add(graph.getParent(node));
          }
        }
        for (        Node parent : parents) {
          graph.ungroupNodes(parent);
        }
      }
 catch (      Exception e) {
        graph.readUnlockAll();
        NotifyDescriptor.Message nd=new NotifyDescriptor.Message(e.getMessage());
        DialogDisplayer.getDefault().notifyLater(nd);
      }
    }
  }
,"String_Node_Str").start();
}

Fixed version (ground truth):
public void ungroup(){
  this.graph=graphController.getModel().getHierarchicalGraph();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        Set<Node> parents=new HashSet<Node>();
        for (        ModelImpl metaModelImpl : models) {
          NodeData nodeData=(NodeData)metaModelImpl.getObj();
          Node node=nodeData.getNode(graph.getView().getViewId());
          if (node != null && graph.getDescendantCount(node) > 0) {
            parents.add(node);
          }
 else           if (node != null && graph.getParent(node) != null) {
            parents.add(graph.getParent(node));
          }
        }
        for (        Node parent : parents) {
          graph.ungroupNodes(parent);
        }
      }
 catch (      Exception e) {
        graph.readUnlockAll();
        NotifyDescriptor.Message nd=new NotifyDescriptor.Message(e.getMessage());
        DialogDisplayer.getDefault().notifyLater(nd);
      }
    }
  }
,"String_Node_Str").start();
}
Program: 190194
Project: 190194
Buggy source:
public void run(){
  try {
    Set<Node> parents=new HashSet<Node>();
    for (    ModelImpl metaModelImpl : models) {
      NodeData nodeData=(NodeData)metaModelImpl.getObj();
      Node node=nodeData.getNode(graph.getView().getViewId());
      if (graph.getDescendantCount(node) > 0) {
        parents.add(node);
      }
 else       if (graph.getParent(node) != null) {
        parents.add(graph.getParent(node));
      }
    }
    for (    Node parent : parents) {
      graph.ungroupNodes(parent);
    }
  }
 catch (  Exception e) {
    graph.readUnlockAll();
    NotifyDescriptor.Message nd=new NotifyDescriptor.Message(e.getMessage());
    DialogDisplayer.getDefault().notifyLater(nd);
  }
}

Fixed version (ground truth):
public void run(){
  try {
    Set<Node> parents=new HashSet<Node>();
    for (    ModelImpl metaModelImpl : models) {
      NodeData nodeData=(NodeData)metaModelImpl.getObj();
      Node node=nodeData.getNode(graph.getView().getViewId());
      if (node != null && graph.getDescendantCount(node) > 0) {
        parents.add(node);
      }
 else       if (node != null && graph.getParent(node) != null) {
        parents.add(graph.getParent(node));
      }
    }
    for (    Node parent : parents) {
      graph.ungroupNodes(parent);
    }
  }
 catch (  Exception e) {
    graph.readUnlockAll();
    NotifyDescriptor.Message nd=new NotifyDescriptor.Message(e.getMessage());
    DialogDisplayer.getDefault().notifyLater(nd);
  }
}
Program: 190195
Project: 190195
Buggy source:
public boolean canGroup(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  return selectedNodeModels.length >= 1;
}

Fixed version (ground truth):
public boolean canGroup(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  int nodesReallyPresent=0;
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    Node node=nodeData.getNode(graph.getView().getViewId());
    if (node != null) {
      nodesReallyPresent++;
    }
  }
  return nodesReallyPresent >= 1;
}
Program: 190196
Project: 190196
Buggy source:
public void delete(){
  this.graph=graphController.getModel().getHierarchicalGraph();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    graph.removeNode(nodeData.getRootNode());
  }
}

Fixed version (ground truth):
public void delete(){
  this.graph=graphController.getModel().getHierarchicalGraph();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl model : selectedNodeModels) {
    NodeData nodeData=(NodeData)model.getObj();
    Node node=nodeData.getRootNode();
    if (node != null) {
      graph.removeNode(node);
    }
  }
}
Program: 190197
Project: 190197
Buggy source:
public boolean canExpand(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    Node node=nodeData.getNode(graph.getView().getViewId());
    if (graph.getDescendantCount(node) > 0) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean canExpand(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    Node node=nodeData.getNode(graph.getView().getViewId());
    if (node != null && graph.getDescendantCount(node) > 0) {
      return true;
    }
  }
  return false;
}
Program: 190198
Project: 190198
Buggy source:
public void expand(){
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        for (        ModelImpl metaModelImpl : models) {
          Node node=((NodeData)metaModelImpl.getObj()).getNode(graph.getView().getViewId());
          if (graph.getDescendantCount(node) > 0) {
            expandPositioning(node);
            graph.expand(node);
          }
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
        graph.readUnlockAll();
      }
    }
  }
,"String_Node_Str").start();
}

Fixed version (ground truth):
public void expand(){
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        for (        ModelImpl metaModelImpl : models) {
          Node node=((NodeData)metaModelImpl.getObj()).getNode(graph.getView().getViewId());
          if (node != null && graph.getDescendantCount(node) > 0) {
            expandPositioning(node);
            graph.expand(node);
          }
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
        graph.readUnlockAll();
      }
    }
  }
,"String_Node_Str").start();
}
Program: 190199
Project: 190199
Buggy source:
public boolean canDelete(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  return selectedNodeModels.length >= 1;
}

Fixed version (ground truth):
public boolean canDelete(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  int nodesReallyPresent=0;
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    Node node=nodeData.getNode(graph.getView().getViewId());
    if (node != null) {
      nodesReallyPresent++;
    }
  }
  return nodesReallyPresent >= 1;
}
Program: 190200
Project: 190200
Buggy source:
public boolean canContract(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    Node node=nodeData.getNode(graph.getView().getViewId());
    if (graph.getParent(node) != null) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean canContract(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    Node node=nodeData.getNode(graph.getView().getViewId());
    if (node != null && graph.getParent(node) != null) {
      return true;
    }
  }
  return false;
}
Program: 190202
Project: 190202
Buggy source:
/** 
 * Used for iterating through all nodes of the graph
 * @return Array with all graph nodes
 */
private Node[] getNodesArray(){
  Graph graph=Lookup.getDefault().lookup(GraphController.class).getModel().getGraph();
  return graph.getNodes().toArray();
}

Fixed version (ground truth):
/** 
 * Used for iterating through all nodes of the graph
 * @return Array with all graph nodes
 */
private Node[] getNodesArray(){
  return Lookup.getDefault().lookup(GraphController.class).getModel().getHierarchicalGraph().getNodesTree().toArray();
}
Program: 190203
Project: 190203
Buggy source:
protected void createPropertiesColumn(){
  PropertiesColumn[] columnsForNodeTable={PropertiesColumn.NODE_ID,PropertiesColumn.NODE_LABEL};
  PropertiesColumn[] columnsForEdgeTable={PropertiesColumn.EDGE_ID,PropertiesColumn.EDGE_LABEL};
  for (  PropertiesColumn columnForNodeTable : columnsForNodeTable)   nodeTable.addPropertiesColumn(columnForNodeTable);
  for (  PropertiesColumn columnForEdgeTable : columnsForEdgeTable)   edgeTable.addPropertiesColumn(columnForEdgeTable);
}

Fixed version (ground truth):
protected void createPropertiesColumn(){
  PropertiesColumn[] columnsForNodeTable={PropertiesColumn.NODE_ID,PropertiesColumn.NODE_LABEL};
  PropertiesColumn[] columnsForEdgeTable={PropertiesColumn.EDGE_ID,PropertiesColumn.EDGE_LABEL,PropertiesColumn.EDGE_WEIGHT};
  for (  PropertiesColumn columnForNodeTable : columnsForNodeTable)   nodeTable.addPropertiesColumn(columnForNodeTable);
  for (  PropertiesColumn columnForEdgeTable : columnsForEdgeTable)   edgeTable.addPropertiesColumn(columnForEdgeTable);
}
Program: 190204
Project: 190204
Buggy source:
public AbstractEdge(AbstractEdge edge,AbstractNode source,AbstractNode target){
  this.source=source;
  this.target=target;
  this.ID=edge.ID;
  this.edgeData=edge.edgeData;
  this.weight=edge.weight;
}

Fixed version (ground truth):
public AbstractEdge(AbstractEdge edge,AbstractNode source,AbstractNode target){
  this.source=source;
  this.target=target;
  this.ID=edge.ID;
  this.edgeData=edge.edgeData;
}
Program: 190205
Project: 190205
Buggy source:
public float getWeight(){
  return weight;
}

Fixed version (ground truth):
public float getWeight(){
  return edgeData.getWeight();
}
Program: 190206
Project: 190206
Buggy source:
public void setWeight(float weight){
  this.weight=weight;
}

Fixed version (ground truth):
public void setWeight(float weight){
  edgeData.setWeight(weight);
}
Program: 190207
Project: 190207
Buggy source:
public void pushEdge(AbstractEdge edge,AbstractNode source,AbstractNode target,MetaEdgeImpl metaEdge){
  float edgeWeight=edge.weight;
  float metaWeight=metaEdge.getWeight();
  float edgeCount=metaEdge.getCount();
  float div=1f;
  if (source == metaEdge.getSource() || source == metaEdge.getTarget() || target == metaEdge.getTarget() || target == metaEdge.getSource()) {
    div=nonDeepDivisor;
  }
  edgeWeight/=div;
  metaWeight=(metaWeight * edgeCount + edgeWeight) / (edgeCount + 1);
  if (metaWeight > weightLimit) {
    metaWeight=weightLimit;
  }
  metaEdge.setWeight(metaWeight);
}

Fixed version (ground truth):
public void pushEdge(AbstractEdge edge,AbstractNode source,AbstractNode target,MetaEdgeImpl metaEdge){
  float edgeWeight=edge.getWeight();
  float metaWeight=metaEdge.getWeight();
  float edgeCount=metaEdge.getCount();
  float div=1f;
  if (source == metaEdge.getSource() || source == metaEdge.getTarget() || target == metaEdge.getTarget() || target == metaEdge.getSource()) {
    div=nonDeepDivisor;
  }
  edgeWeight/=div;
  metaWeight=(metaWeight * edgeCount + edgeWeight) / (edgeCount + 1);
  if (metaWeight > weightLimit) {
    metaWeight=weightLimit;
  }
  metaEdge.setWeight(metaWeight);
}
Program: 190208
Project: 190208
Buggy source:
public void pullEdge(AbstractEdge edge,AbstractNode source,AbstractNode target,MetaEdgeImpl metaEdge){
  float edgeWeight=edge.weight;
  float metaWeight=metaEdge.getWeight();
  float edgeCount=metaEdge.getCount();
  float div=1f;
  if (source == metaEdge.getSource() || source == metaEdge.getTarget() || target == metaEdge.getTarget() || target == metaEdge.getSource()) {
    div=nonDeepDivisor;
  }
  edgeWeight/=div;
  metaWeight=(metaWeight * edgeCount - edgeWeight) / (edgeCount - 1);
  if (metaWeight < weightMinimum) {
    metaWeight=weightMinimum;
  }
  metaEdge.setWeight(metaWeight);
}

Fixed version (ground truth):
public void pullEdge(AbstractEdge edge,AbstractNode source,AbstractNode target,MetaEdgeImpl metaEdge){
  float edgeWeight=edge.getWeight();
  float metaWeight=metaEdge.getWeight();
  float edgeCount=metaEdge.getCount();
  float div=1f;
  if (source == metaEdge.getSource() || source == metaEdge.getTarget() || target == metaEdge.getTarget() || target == metaEdge.getSource()) {
    div=nonDeepDivisor;
  }
  edgeWeight/=div;
  metaWeight=(metaWeight * edgeCount - edgeWeight) / (edgeCount - 1);
  if (metaWeight < weightMinimum) {
    metaWeight=weightMinimum;
  }
  metaEdge.setWeight(metaWeight);
}
Program: 190209
Project: 190209
Buggy source:
public MetaEdgeImpl(int ID,AbstractNode source,AbstractNode target){
  super(ID,source,target);
  this.weight=0f;
}

Fixed version (ground truth):
public MetaEdgeImpl(int ID,AbstractNode source,AbstractNode target){
  super(ID,source,target);
  setWeight(0f);
}
Program: 190210
Project: 190210
Buggy source:
public void pushEdge(AbstractEdge edge,AbstractNode source,AbstractNode target,MetaEdgeImpl metaEdge){
  float edgeWeight=edge.weight;
  float metaWeight=metaEdge.getWeight();
  float div=1f;
  if (edge.getSource() == metaEdge.getSource() || edge.getSource() == metaEdge.getTarget() || edge.getTarget() == metaEdge.getTarget() || edge.getTarget() == metaEdge.getSource()) {
    div=nonDeepDivisor;
  }
  metaWeight+=edgeWeight / div;
  if (metaWeight > weightLimit) {
    metaWeight=weightLimit;
  }
  metaEdge.setWeight(metaWeight);
}

Fixed version (ground truth):
public void pushEdge(AbstractEdge edge,AbstractNode source,AbstractNode target,MetaEdgeImpl metaEdge){
  float edgeWeight=edge.getWeight();
  float metaWeight=metaEdge.getWeight();
  float div=1f;
  if (edge.getSource() == metaEdge.getSource() || edge.getSource() == metaEdge.getTarget() || edge.getTarget() == metaEdge.getTarget() || edge.getTarget() == metaEdge.getSource()) {
    div=nonDeepDivisor;
  }
  metaWeight+=edgeWeight / div;
  if (metaWeight > weightLimit) {
    metaWeight=weightLimit;
  }
  metaEdge.setWeight(metaWeight);
}
Program: 190211
Project: 190211
Buggy source:
public void pullEdge(AbstractEdge edge,AbstractNode source,AbstractNode target,MetaEdgeImpl metaEdge){
  float edgeWeight=edge.weight;
  float metaWeight=metaEdge.getWeight();
  float div=1f;
  if (source == metaEdge.getSource() || source == metaEdge.getTarget() || target == metaEdge.getTarget() || target == metaEdge.getSource()) {
    div=nonDeepDivisor;
  }
  metaWeight-=edgeWeight / div;
  if (metaWeight < weightMinimum) {
    metaWeight=weightMinimum;
  }
  metaEdge.setWeight(metaWeight);
}

Fixed version (ground truth):
public void pullEdge(AbstractEdge edge,AbstractNode source,AbstractNode target,MetaEdgeImpl metaEdge){
  float edgeWeight=edge.getWeight();
  float metaWeight=metaEdge.getWeight();
  float div=1f;
  if (source == metaEdge.getSource() || source == metaEdge.getTarget() || target == metaEdge.getTarget() || target == metaEdge.getSource()) {
    div=nonDeepDivisor;
  }
  metaWeight-=edgeWeight / div;
  if (metaWeight < weightMinimum) {
    metaWeight=weightMinimum;
  }
  metaEdge.setWeight(metaWeight);
}
Program: 190212
Project: 190212
Buggy source:
/** 
 * @return
 */
public String getReport(){
  String report=new String("String_Node_Str" + "String_Node_Str" + mGraphRevision + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ mAvgInDegree+ "String_Node_Str"+ mAvgOutDegree+ "String_Node_Str");
  return report;
}

Fixed version (ground truth):
/** 
 * @return
 */
public String getReport(){
  String report=new String("String_Node_Str" + "String_Node_Str" + mGraphRevision + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ mAvgDegree+ "String_Node_Str"+ mAvgInDegree+ "String_Node_Str"+ mAvgOutDegree+ "String_Node_Str");
  return report;
}
Program: 190214
Project: 190214
Buggy source:
private AbstractNode[] deleteNode(AbstractNode node){
  AbstractNode[] descendants=new AbstractNode[node.size + 1];
  int i=0;
  for (DescendantAndSelfIterator itr=new DescendantAndSelfIterator(treeStructure,node,Tautology.instance); itr.hasNext(); ) {
    AbstractNode descendant=itr.next();
    descendants[i]=descendant;
    if (descendant.isEnabled()) {
      edgeProcessor.clearMetaEdges(descendant);
      view.decNodesEnabled(1);
    }
    edgeProcessor.clearEdges(descendant);
    if (node.countInViews() == 1) {
      dhns.getGraphStructure().removeFromDictionnary(descendant);
    }
    i++;
  }
  treeStructure.deleteDescendantAndSelf(node);
  return descendants;
}

Fixed version (ground truth):
private AbstractNode[] deleteNode(AbstractNode node){
  AbstractNode[] descendants=new AbstractNode[node.size + 1];
  int i=0;
  for (DescendantAndSelfIterator itr=new DescendantAndSelfIterator(treeStructure,node,Tautology.instance); itr.hasNext(); ) {
    AbstractNode descendant=itr.next();
    descendants[i]=descendant;
    if (descendant.isEnabled()) {
      edgeProcessor.clearMetaEdges(descendant);
      view.decNodesEnabled(1);
    }
    AbstractEdge[] deletedEdges=edgeProcessor.clearEdges(descendant);
    if (deletedEdges != null) {
      for (int j=0; j < deletedEdges.length; j++) {
        dhns.getGraphStructure().removeFromDictionnary(deletedEdges[j]);
        dhns.getEventManager().fireEvent(new EdgeEvent(EventType.REMOVE_EDGES,deletedEdges[j],view));
      }
    }
    if (node.countInViews() == 1) {
      dhns.getGraphStructure().removeFromDictionnary(descendant);
    }
    i++;
  }
  treeStructure.deleteDescendantAndSelf(node);
  return descendants;
}
Program: 190217
Project: 190217
Buggy source:
public void contract(){
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        Set<Node> parents=new HashSet<Node>();
        for (        ModelImpl metaModelImpl : models) {
          NodeData nodeData=(NodeData)metaModelImpl.getObj();
          Node node=nodeData.getNode(graph.getView().getViewId());
          Node nodeParent=graph.getParent(node);
          if (nodeParent != null) {
            parents.add(nodeParent);
          }
        }
        for (        Node parent : parents) {
          GroupData gd=(GroupData)parent.getNodeData();
          if (gd.getHullModel() != null) {
            ConvexHull hull=((ConvexHullModel)gd.getHullModel()).getObj();
            contractPositioning(hull);
          }
          graph.retract(parent);
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
        graph.readUnlockAll();
      }
    }
  }
,"String_Node_Str").start();
}

Fixed version (ground truth):
public void contract(){
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        Set<Node> parents=new HashSet<Node>();
        for (        ModelImpl metaModelImpl : models) {
          NodeData nodeData=(NodeData)metaModelImpl.getObj();
          Node node=nodeData.getNode(graph.getView().getViewId());
          if (node != null) {
            Node nodeParent=graph.getParent(node);
            if (nodeParent != null) {
              parents.add(nodeParent);
            }
          }
        }
        for (        Node parent : parents) {
          GroupData gd=(GroupData)parent.getNodeData();
          if (gd.getHullModel() != null) {
            ConvexHull hull=((ConvexHullModel)gd.getHullModel()).getObj();
            contractPositioning(hull);
          }
          graph.retract(parent);
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
        graph.readUnlockAll();
      }
    }
  }
,"String_Node_Str").start();
}
Program: 190218
Project: 190218
Buggy source:
public void ungroup(){
  this.graph=graphController.getModel().getHierarchicalGraph();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        Set<Node> parents=new HashSet<Node>();
        for (        ModelImpl metaModelImpl : models) {
          NodeData nodeData=(NodeData)metaModelImpl.getObj();
          Node node=nodeData.getNode(graph.getView().getViewId());
          if (graph.getDescendantCount(node) > 0) {
            parents.add(node);
          }
 else           if (graph.getParent(node) != null) {
            parents.add(graph.getParent(node));
          }
        }
        for (        Node parent : parents) {
          graph.ungroupNodes(parent);
        }
      }
 catch (      Exception e) {
        graph.readUnlockAll();
        NotifyDescriptor.Message nd=new NotifyDescriptor.Message(e.getMessage());
        DialogDisplayer.getDefault().notifyLater(nd);
      }
    }
  }
,"String_Node_Str").start();
}

Fixed version (ground truth):
public void ungroup(){
  this.graph=graphController.getModel().getHierarchicalGraph();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final ModelImpl[] models=Arrays.copyOf(selectedNodeModels,selectedNodeModels.length);
  new Thread(new Runnable(){
    public void run(){
      try {
        Set<Node> parents=new HashSet<Node>();
        for (        ModelImpl metaModelImpl : models) {
          NodeData nodeData=(NodeData)metaModelImpl.getObj();
          Node node=nodeData.getNode(graph.getView().getViewId());
          if (node != null && graph.getDescendantCount(node) > 0) {
            parents.add(node);
          }
 else           if (node != null && graph.getParent(node) != null) {
            parents.add(graph.getParent(node));
          }
        }
        for (        Node parent : parents) {
          graph.ungroupNodes(parent);
        }
      }
 catch (      Exception e) {
        graph.readUnlockAll();
        NotifyDescriptor.Message nd=new NotifyDescriptor.Message(e.getMessage());
        DialogDisplayer.getDefault().notifyLater(nd);
      }
    }
  }
,"String_Node_Str").start();
}
Program: 190219
Project: 190219
Buggy source:
public void run(){
  try {
    Set<Node> parents=new HashSet<Node>();
    for (    ModelImpl metaModelImpl : models) {
      NodeData nodeData=(NodeData)metaModelImpl.getObj();
      Node node=nodeData.getNode(graph.getView().getViewId());
      if (graph.getDescendantCount(node) > 0) {
        parents.add(node);
      }
 else       if (graph.getParent(node) != null) {
        parents.add(graph.getParent(node));
      }
    }
    for (    Node parent : parents) {
      graph.ungroupNodes(parent);
    }
  }
 catch (  Exception e) {
    graph.readUnlockAll();
    NotifyDescriptor.Message nd=new NotifyDescriptor.Message(e.getMessage());
    DialogDisplayer.getDefault().notifyLater(nd);
  }
}

Fixed version (ground truth):
public void run(){
  try {
    Set<Node> parents=new HashSet<Node>();
    for (    ModelImpl metaModelImpl : models) {
      NodeData nodeData=(NodeData)metaModelImpl.getObj();
      Node node=nodeData.getNode(graph.getView().getViewId());
      if (node != null && graph.getDescendantCount(node) > 0) {
        parents.add(node);
      }
 else       if (node != null && graph.getParent(node) != null) {
        parents.add(graph.getParent(node));
      }
    }
    for (    Node parent : parents) {
      graph.ungroupNodes(parent);
    }
  }
 catch (  Exception e) {
    graph.readUnlockAll();
    NotifyDescriptor.Message nd=new NotifyDescriptor.Message(e.getMessage());
    DialogDisplayer.getDefault().notifyLater(nd);
  }
}
Program: 190220
Project: 190220
Buggy source:
public boolean canGroup(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  return selectedNodeModels.length >= 1;
}

Fixed version (ground truth):
public boolean canGroup(){
  GraphModel graphModel=graphController.getModel();
  if (graphModel == null) {
    return false;
  }
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  int nodesReallyPresent=0;
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    Node node=nodeData.getNode(graph.getView().getViewId());
    if (node != null) {
      nodesReallyPresent++;
    }
  }
  return nodesReallyPresent >= 1;
}
Program: 190221
Project: 190221
Buggy source:
public void delete(){
  this.graph=graphController.getModel().getHierarchicalGraph();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl metaModelImpl : selectedNodeModels) {
    NodeData nodeData=(NodeData)metaModelImpl.getObj();
    graph.removeNode(nodeData.getRootNode());
  }
}

Fixed version (ground truth):
public void delete(){
  this.graph=graphController.getModel().getHierarchicalGraph();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  for (  ModelImpl model : selectedNodeModels) {
    NodeData nodeData=(NodeData)model.getObj();
    Node node=nodeData.getRootNode();
    if (node != null) {
      graph.removeNode(node);
    }
  }
}