Program: 142909
Project: 142909
Buggy source:
public void group(){
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final Node[] newGroup=new Node[selectedNodeModels.length];
  for (int i=0; i < selectedNodeModels.length; i++) {
    newGroup[i]=((NodeData)selectedNodeModels[i].getObj()).getNode(graph.getView().getViewId());
  }
  new Thread(new Runnable(){
    public void run(){
      try {
        float centroidX=0;
        float centroidY=0;
        int len=0;
        float sizes=0;
        float r=0;
        float g=0;
        float b=0;
        Node group=graph.groupNodes(newGroup);
        group.getNodeData().setLabel("String_Node_Str" + newGroup.length + "String_Node_Str");
        group.getNodeData().setSize(10f);
        for (        Node child : newGroup) {
          centroidX+=child.getNodeData().x();
          centroidY+=child.getNodeData().y();
          len++;
          sizes+=child.getNodeData().getSize() / 10f;
          r+=child.getNodeData().r();
          g+=child.getNodeData().g();
          b+=child.getNodeData().b();
        }
        centroidX/=len;
        centroidY/=len;
        group.getNodeData().setSize(sizes);
        group.getNodeData().setColor(r / len,g / len,b / len);
        group.getNodeData().setX(centroidX);
        group.getNodeData().setY(centroidY);
      }
 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 group(){
  this.graph=graphController.getModel().getHierarchicalGraphVisible();
  ModelImpl[] selectedNodeModels=engine.getSelectedObjects(AbstractEngine.CLASS_NODE);
  final List<Node> newGroup=new ArrayList<Node>();
  for (int i=0; i < selectedNodeModels.length; i++) {
    Node node=((NodeData)selectedNodeModels[i].getObj()).getNode(graph.getView().getViewId());
    if (node != null) {
      newGroup.add(node);
    }
  }
  new Thread(new Runnable(){
    public void run(){
      try {
        float centroidX=0;
        float centroidY=0;
        int len=0;
        float sizes=0;
        float r=0;
        float g=0;
        float b=0;
        Node group=graph.groupNodes(newGroup.toArray(new Node[0]));
        group.getNodeData().setLabel("String_Node_Str" + newGroup.size() + "String_Node_Str");
        group.getNodeData().setSize(10f);
        for (        Node child : newGroup) {
          centroidX+=child.getNodeData().x();
          centroidY+=child.getNodeData().y();
          len++;
          sizes+=child.getNodeData().getSize() / 10f;
          r+=child.getNodeData().r();
          g+=child.getNodeData().g();
          b+=child.getNodeData().b();
        }
        centroidX/=len;
        centroidY/=len;
        group.getNodeData().setSize(sizes);
        group.getNodeData().setColor(r / len,g / len,b / len);
        group.getNodeData().setX(centroidX);
        group.getNodeData().setY(centroidY);
      }
 catch (      Exception e) {
        graph.readUnlockAll();
        NotifyDescriptor.Message nd=new NotifyDescriptor.Message(e.getMessage());
        DialogDisplayer.getDefault().notifyLater(nd);
      }
    }
  }
,"String_Node_Str").start();
}