nus-yam/ex-repair huggingface dataset:
Program: 189873
Project: 189873
Buggy source:
private double q(int node,Community community){
  Integer edgesToInt=structure.nodeConnections[node].get(community);
  double edgesTo=0;
  if (edgesToInt != null) {
    edgesTo=edgesToInt.doubleValue();
  }
  double weightSum=community.weightSum;
  double nodeWeight=structure.weights[node];
  double qValue=edgesTo - (nodeWeight * weightSum) / (2.0 * structure.graphWeightSum);
  if ((structure.nodeCommunities[node] == community) && (structure.nodeCommunities[node].size() > 1)) {
    qValue=edgesTo - (nodeWeight * (weightSum - nodeWeight)) / (2.0 * structure.graphWeightSum);
  }
  return qValue;
}

Fixed version (ground truth):
private double q(int node,Community community){
  Integer edgesToInt=structure.nodeConnections[node].get(community);
  double edgesTo=0;
  if (edgesToInt != null) {
    edgesTo=edgesToInt.doubleValue();
  }
  double weightSum=community.weightSum;
  double nodeWeight=structure.weights[node];
  double qValue=edgesTo - (nodeWeight * weightSum) / (2.0 * structure.graphWeightSum);
  if ((structure.nodeCommunities[node] == community) && (structure.nodeCommunities[node].size() > 1)) {
    qValue=edgesTo - (nodeWeight * (weightSum - nodeWeight)) / (2.0 * structure.graphWeightSum);
  }
  if ((structure.nodeCommunities[node] == community) && (structure.nodeCommunities[node].size() == 1)) {
    qValue=0.;
  }
  return qValue;
}
Program: 189874
Project: 189874
Buggy source:
public String getReport(){
  Map<Double,Integer> dist=new HashMap<Double,Integer>();
  for (int i=0; i < N; i++) {
    Double d=nodeClustering[i];
    if (dist.containsKey(d)) {
      Integer v=dist.get(d);
      dist.put(d,v + 1);
    }
 else {
      dist.put(d,1);
    }
  }
  XYSeries dSeries=ChartUtils.createXYSeries(dist,"String_Node_Str");
  XYSeriesCollection dataset=new XYSeriesCollection();
  dataset.addSeries(dSeries);
  JFreeChart chart=ChartFactory.createScatterPlot("String_Node_Str","String_Node_Str","String_Node_Str",dataset,PlotOrientation.VERTICAL,true,false,false);
  ChartUtils.decorateChart(chart);
  ChartUtils.scaleChart(chart,dSeries,false);
  String imageFile=ChartUtils.renderChart(chart,"String_Node_Str");
  NumberFormat f=new DecimalFormat("String_Node_Str");
  return "String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + (isDirected ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ f.format(avgClusteringCoeff)+ "String_Node_Str"+ imageFile+ "String_Node_Str"+ "String_Node_Str";
}

Fixed version (ground truth):
public String getReport(){
  Map<Double,Integer> dist=new HashMap<Double,Integer>();
  for (int i=0; i < N; i++) {
    Double d=nodeClustering[i];
    if (dist.containsKey(d)) {
      Integer v=dist.get(d);
      dist.put(d,v + 1);
    }
 else {
      dist.put(d,1);
    }
  }
  XYSeries dSeries=ChartUtils.createXYSeries(dist,"String_Node_Str");
  XYSeriesCollection dataset=new XYSeriesCollection();
  dataset.addSeries(dSeries);
  JFreeChart chart=ChartFactory.createScatterPlot("String_Node_Str","String_Node_Str","String_Node_Str",dataset,PlotOrientation.VERTICAL,true,false,false);
  ChartUtils.decorateChart(chart);
  ChartUtils.scaleChart(chart,dSeries,false);
  String imageFile=ChartUtils.renderChart(chart,"String_Node_Str");
  NumberFormat f=new DecimalFormat("String_Node_Str");
  return "String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + (isDirected ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ f.format(avgClusteringCoeff)+ "String_Node_Str"+ "String_Node_Str"+ totalTriangles+ "String_Node_Str"+ "String_Node_Str"+ imageFile+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
}
Program: 189875
Project: 189875
Buggy source:
public void execute(HierarchicalGraph hgraph,AttributeModel attributeModel){
  isCanceled=false;
  bruteForce(hgraph,attributeModel);
}

Fixed version (ground truth):
public void execute(HierarchicalGraph hgraph,AttributeModel attributeModel){
  isCanceled=false;
  triangles(hgraph,attributeModel);
}
Program: 189877
Project: 189877
Buggy source:
public String getReport(){
  String report="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + (isDirected ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ componentCount+ "String_Node_Str"+ (isDirected ? "String_Node_Str" + stronglyCount + "String_Node_Str" : "String_Node_Str")+ "String_Node_Str";
  return report;
}

Fixed version (ground truth):
public String getReport(){
  String report="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + (isDirected ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ componentCount+ "String_Node_Str"+ (isDirected ? "String_Node_Str" + stronglyCount + "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  return report;
}
Program: 189878
Project: 189878
Buggy source:
/** 
 * @return
 */
public String getReport(){
  String htmlIMG1="String_Node_Str";
  String htmlIMG2="String_Node_Str";
  String htmlIMG3="String_Node_Str";
  try {
    TempDir tempDir=TempDirUtils.createTempDir();
    htmlIMG1=createImageFile(tempDir,betweenness,"String_Node_Str","String_Node_Str","String_Node_Str");
    htmlIMG2=createImageFile(tempDir,closeness,"String_Node_Str","String_Node_Str","String_Node_Str");
    htmlIMG3=createImageFile(tempDir,eccentricity,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
 catch (  IOException ex) {
    Exceptions.printStackTrace(ex);
  }
  String report="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + (isDirected ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ diameter+ "String_Node_Str"+ "String_Node_Str"+ radius+ "String_Node_Str"+ "String_Node_Str"+ avgDist+ "String_Node_Str"+ "String_Node_Str"+ shortestPaths+ "String_Node_Str"+ htmlIMG1+ "String_Node_Str"+ htmlIMG2+ "String_Node_Str"+ htmlIMG3+ "String_Node_Str";
  return report;
}

Fixed version (ground truth):
/** 
 * @return
 */
public String getReport(){
  String htmlIMG1="String_Node_Str";
  String htmlIMG2="String_Node_Str";
  String htmlIMG3="String_Node_Str";
  try {
    TempDir tempDir=TempDirUtils.createTempDir();
    htmlIMG1=createImageFile(tempDir,betweenness,"String_Node_Str","String_Node_Str","String_Node_Str");
    htmlIMG2=createImageFile(tempDir,closeness,"String_Node_Str","String_Node_Str","String_Node_Str");
    htmlIMG3=createImageFile(tempDir,eccentricity,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
 catch (  IOException ex) {
    Exceptions.printStackTrace(ex);
  }
  String report="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + (isDirected ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ diameter+ "String_Node_Str"+ "String_Node_Str"+ radius+ "String_Node_Str"+ "String_Node_Str"+ avgDist+ "String_Node_Str"+ "String_Node_Str"+ shortestPaths+ "String_Node_Str"+ htmlIMG1+ "String_Node_Str"+ htmlIMG2+ "String_Node_Str"+ htmlIMG3+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  return report;
}
Program: 189880
Project: 189880
Buggy source:
public String getReport(){
  NumberFormat f=new DecimalFormat("String_Node_Str");
  String report="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str" + (isRandomized ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ f.format(modularity)+ "String_Node_Str"+ "String_Node_Str"+ structure.communities.size()+ "String_Node_Str";
  return report;
}

Fixed version (ground truth):
public String getReport(){
  NumberFormat f=new DecimalFormat("String_Node_Str");
  String report="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str" + (isRandomized ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ f.format(modularity)+ "String_Node_Str"+ "String_Node_Str"+ structure.communities.size()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  return report;
}
Program: 189881
Project: 189881
Buggy source:
/** 
 * @return
 */
public String getReport(){
  Map<Double,Integer> dist=new HashMap<Double,Integer>();
  for (int i=0; i < pageranks.length; i++) {
    Double d=pageranks[i];
    if (dist.containsKey(d)) {
      Integer v=dist.get(d);
      dist.put(d,v + 1);
    }
 else {
      dist.put(d,1);
    }
  }
  XYSeries dSeries=ChartUtils.createXYSeries(dist,"String_Node_Str");
  XYSeriesCollection dataset=new XYSeriesCollection();
  dataset.addSeries(dSeries);
  JFreeChart chart=ChartFactory.createXYLineChart("String_Node_Str","String_Node_Str","String_Node_Str",dataset,PlotOrientation.VERTICAL,true,false,false);
  ChartUtils.decorateChart(chart);
  ChartUtils.scaleChart(chart,dSeries,true);
  String imageFile=ChartUtils.renderChart(chart,"String_Node_Str");
  String report="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str" + epsilon + "String_Node_Str"+ "String_Node_Str"+ probability+ "String_Node_Str"+ imageFile+ "String_Node_Str";
  return report;
}

Fixed version (ground truth):
/** 
 * @return
 */
public String getReport(){
  Map<Double,Integer> dist=new HashMap<Double,Integer>();
  for (int i=0; i < pageranks.length; i++) {
    Double d=pageranks[i];
    if (dist.containsKey(d)) {
      Integer v=dist.get(d);
      dist.put(d,v + 1);
    }
 else {
      dist.put(d,1);
    }
  }
  XYSeries dSeries=ChartUtils.createXYSeries(dist,"String_Node_Str");
  XYSeriesCollection dataset=new XYSeriesCollection();
  dataset.addSeries(dSeries);
  JFreeChart chart=ChartFactory.createXYLineChart("String_Node_Str","String_Node_Str","String_Node_Str",dataset,PlotOrientation.VERTICAL,true,false,false);
  ChartUtils.decorateChart(chart);
  ChartUtils.scaleChart(chart,dSeries,true);
  String imageFile=ChartUtils.renderChart(chart,"String_Node_Str");
  String report="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str" + epsilon + "String_Node_Str"+ "String_Node_Str"+ probability+ "String_Node_Str"+ imageFile+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  return report;
}
Program: 189882
Project: 189882
Buggy source:
private PreviewTopComponent(){
  initComponents();
  setName(NbBundle.getMessage(PreviewTopComponent.class,"String_Node_Str"));
  setIcon(ImageUtilities.loadImage(ICON_PATH));
  if (UIUtils.isAquaLookAndFeel()) {
    previewPanel.setBackground(UIManager.getColor("String_Node_Str"));
  }
  if (UIUtils.isAquaLookAndFeel()) {
    southToolbar.setBackground(UIManager.getColor("String_Node_Str"));
  }
  bannerPanel.setVisible(false);
  sketch=new ProcessingPreview();
  sketchPanel.add(sketch,BorderLayout.CENTER);
  Thread initProcessing=new Thread(new Runnable(){
    public void run(){
      try {
        Thread.sleep(200);
      }
 catch (      InterruptedException ex) {
        Exceptions.printStackTrace(ex);
      }
      SwingUtilities.invokeLater(new Runnable(){
        public void run(){
          sketch.init();
          sketch.registerPost(processingListener);
          sketch.registerPre(processingListener);
        }
      }
);
    }
  }
);
  initProcessing.start();
  PreviewUIController.findInstance();
  ((JColorButton)backgroundButton).addPropertyChangeListener(JColorButton.EVENT_COLOR,new PropertyChangeListener(){
    public void propertyChange(    PropertyChangeEvent evt){
      PreviewController controller=Lookup.getDefault().lookup(PreviewController.class);
      controller.setBackgroundColor((Color)evt.getNewValue());
    }
  }
);
  southBusyLabel.setVisible(false);
  resetZoomButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      sketch.resetZoom();
    }
  }
);
}

Fixed version (ground truth):
private PreviewTopComponent(){
  initComponents();
  setName(NbBundle.getMessage(PreviewTopComponent.class,"String_Node_Str"));
  setIcon(ImageUtilities.loadImage(ICON_PATH));
  if (UIUtils.isAquaLookAndFeel()) {
    previewPanel.setBackground(UIManager.getColor("String_Node_Str"));
  }
  if (UIUtils.isAquaLookAndFeel()) {
    southToolbar.setBackground(UIManager.getColor("String_Node_Str"));
  }
  bannerPanel.setVisible(false);
  sketch=new ProcessingPreview();
  sketch.init();
  sketch.registerPost(processingListener);
  sketch.registerPre(processingListener);
  sketchPanel.add(sketch,BorderLayout.CENTER);
  PreviewUIController.findInstance();
  ((JColorButton)backgroundButton).addPropertyChangeListener(JColorButton.EVENT_COLOR,new PropertyChangeListener(){
    public void propertyChange(    PropertyChangeEvent evt){
      PreviewController controller=Lookup.getDefault().lookup(PreviewController.class);
      controller.setBackgroundColor((Color)evt.getNewValue());
    }
  }
);
  southBusyLabel.setVisible(false);
  resetZoomButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      sketch.resetZoom();
    }
  }
);
}
Program: 189884
Project: 189884
Buggy source:
public boolean execute(){
  GraphModel graphModel=workspace.getLookup().lookup(GraphModel.class);
  Graph graph=null;
  if (exportVisible) {
    graph=graphModel.getGraphVisible();
  }
 else {
    graph=graphModel.getGraph();
  }
  try {
    exportData(graph);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  return !cancel;
}

Fixed version (ground truth):
public boolean execute(){
  GraphModel graphModel=workspace.getLookup().lookup(GraphModel.class);
  HierarchicalGraph graph=null;
  if (exportVisible) {
    graph=graphModel.getHierarchicalGraphVisible();
  }
 else {
    graph=graphModel.getHierarchicalGraph();
  }
  try {
    exportData(graph);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  return !cancel;
}
Program: 189885
Project: 189885
Buggy source:
private void exportData(Graph graph) throws Exception {
  int max=graph.getNodeCount(), i=1;
  HashMap<Integer,Integer> idx=new HashMap<Integer,Integer>(3 * max / 2 + 1);
  Progress.start(progressTicket,max);
  writer.append("String_Node_Str" + max + "String_Node_Str");
  for (  Node node : graph.getNodes()) {
    writer.append(Integer.toString(i));
    writer.append("String_Node_Str" + node.getNodeData().getLabel() + "String_Node_Str");
    if (nodeCoords) {
      writer.append("String_Node_Str" + node.getNodeData().x() + "String_Node_Str"+ node.getNodeData().y()+ "String_Node_Str"+ node.getNodeData().z());
    }
    writer.append("String_Node_Str");
    idx.put(node.getId(),i++);
  }
  if (graph instanceof UndirectedGraph) {
    writer.append("String_Node_Str");
  }
 else {
    writer.append("String_Node_Str");
  }
  for (  Edge edge : graph.getEdges()) {
    if (cancel) {
      break;
    }
    if (edge != null) {
      writer.append(Integer.toString(idx.get(edge.getSource().getId())) + "String_Node_Str");
      writer.append(Integer.toString(idx.get(edge.getTarget().getId())));
      if (edgeWeight) {
        writer.append("String_Node_Str" + edge.getWeight());
      }
      writer.append("String_Node_Str");
    }
    Progress.progress(progressTicket);
  }
  graph.readUnlockAll();
  Progress.finish(progressTicket);
}

Fixed version (ground truth):
private void exportData(HierarchicalGraph graph) throws Exception {
  int max=graph.getNodeCount(), i=1;
  HashMap<String,Integer> idx=new HashMap<String,Integer>(3 * max / 2 + 1);
  Progress.start(progressTicket,max);
  graph.readLock();
  writer.append("String_Node_Str" + max + "String_Node_Str");
  for (  Node node : graph.getNodes()) {
    writer.append(Integer.toString(i));
    writer.append("String_Node_Str" + node.getNodeData().getLabel() + "String_Node_Str");
    if (nodeCoords) {
      writer.append("String_Node_Str" + node.getNodeData().x() + "String_Node_Str"+ node.getNodeData().y()+ "String_Node_Str"+ node.getNodeData().z());
    }
    writer.append("String_Node_Str");
    idx.put(node.getNodeData().getId(),i++);
  }
  if (graph instanceof UndirectedGraph) {
    writer.append("String_Node_Str");
  }
 else {
    writer.append("String_Node_Str");
  }
  for (  Edge edge : graph.getEdges()) {
    if (cancel) {
      break;
    }
    if (edge != null) {
      writer.append(Integer.toString(idx.get(edge.getSource().getNodeData().getId())) + "String_Node_Str");
      writer.append(Integer.toString(idx.get(edge.getTarget().getNodeData().getId())));
      if (edgeWeight) {
        writer.append("String_Node_Str" + edge.getWeight());
      }
      writer.append("String_Node_Str");
    }
    Progress.progress(progressTicket);
  }
  graph.readUnlockAll();
  Progress.finish(progressTicket);
}
Program: 189886
Project: 189886
Buggy source:
public void actionPerformed(ActionEvent e){
  ExporterUI exporterUI=exportController.getExportController().getUI(selectedExporter);
  if (exporterUI != null) {
    JPanel panel=exporterUI.getPanel();
    exporterUI.setup(selectedExporter);
    DialogDescriptor dd=new DialogDescriptor(panel,NbBundle.getMessage(GraphFileExporterUI.class,"String_Node_Str",selectedBuilder.getName()));
    Object result=DialogDisplayer.getDefault().notify(dd);
    exporterUI.unsetup(result == NotifyDescriptor.OK_OPTION);
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  ExporterUI exporterUI=exportController.getExportController().getUI(selectedExporter);
  if (exporterUI != null) {
    JPanel panel=exporterUI.getPanel();
    exporterUI.setup(selectedExporter);
    DialogDescriptor dd=new DialogDescriptor(panel,NbBundle.getMessage(GraphFileExporterUI.class,"String_Node_Str",selectedBuilder.getName()));
    TopDialog topDialog=new TopDialog(dialog,dd.getTitle(),dd.isModal(),dd,dd.getClosingOptions(),dd.getButtonListener());
    topDialog.setVisible(true);
    Object result=(dd.getValue() != null) ? dd.getValue() : NotifyDescriptor.CLOSED_OPTION;
    exporterUI.unsetup(result == NotifyDescriptor.OK_OPTION);
  }
}
Program: 189888
Project: 189888
Buggy source:
@Override protected JDialog createDialog(Component parent) throws HeadlessException {
  JDialog dialog=super.createDialog(parent);
  dialog.setSize(640,480);
  dialog.setResizable(true);
  Component c=dialog.getContentPane().getComponent(0);
  if (c != null && c instanceof JComponent) {
    Insets insets=((JComponent)c).getInsets();
    southPanel.setBorder(BorderFactory.createEmptyBorder(insets.top,insets.left,insets.bottom,insets.right));
  }
  dialog.getContentPane().add(southPanel,BorderLayout.SOUTH);
  return dialog;
}

Fixed version (ground truth):
@Override protected JDialog createDialog(Component parent) throws HeadlessException {
  dialog=super.createDialog(parent);
  dialog.setSize(640,480);
  dialog.setResizable(true);
  Component c=dialog.getContentPane().getComponent(0);
  if (c != null && c instanceof JComponent) {
    Insets insets=((JComponent)c).getInsets();
    southPanel.setBorder(BorderFactory.createEmptyBorder(insets.top,insets.left,insets.bottom,insets.right));
  }
  dialog.getContentPane().add(southPanel,BorderLayout.SOUTH);
  return dialog;
}
Program: 189890
Project: 189890
Buggy source:
public void stateChanged(ChangeEvent e){
  if (e.getSource() instanceof FilterUIModel) {
    if (uiModel.getSelectedQuery() != null && filterButton.isSelected()) {
      FilterController controller=Lookup.getDefault().lookup(FilterController.class);
      controller.filterVisible(uiModel.getSelectedRoot());
    }
 else     if (uiModel.getSelectedQuery() != null && selectButton.isSelected()) {
      FilterController controller=Lookup.getDefault().lookup(FilterController.class);
      controller.selectVisible(uiModel.getSelectedRoot());
    }
  }
  updateControls();
  updateEnabled(true);
}

Fixed version (ground truth):
public void stateChanged(ChangeEvent e){
  if (e.getSource() instanceof FilterUIModel) {
    if (uiModel.getSelectedQuery() != null && filterButton.isSelected()) {
      FilterController controller=Lookup.getDefault().lookup(FilterController.class);
      controller.filterVisible(uiModel.getSelectedRoot());
    }
 else     if (uiModel.getSelectedQuery() != null && selectButton.isSelected()) {
      FilterController controller=Lookup.getDefault().lookup(FilterController.class);
      controller.selectVisible(uiModel.getSelectedRoot());
    }
  }
 else   if (e.getSource() instanceof FilterModel) {
    if (uiModel.getSelectedQuery() != null && filterModel.getCurrentQuery() == null) {
      uiModel.setSelectedQuery(null);
    }
 else     if (filterModel.getCurrentQuery() != null && filterModel.getCurrentQuery() != uiModel.getSelectedQuery()) {
      uiModel.setSelectedQuery(filterModel.getCurrentQuery());
    }
  }
  updateControls();
  updateEnabled(true);
}
Program: 189891
Project: 189891
Buggy source:
public Graph filter(Graph graph){
  HierarchicalGraph hgraph=(HierarchicalGraph)graph;
  String str=pattern.toLowerCase();
  List<Node> nodes=new ArrayList<Node>();
  for (  Node n : hgraph.getNodes()) {
    if (n.getNodeData().getId().toLowerCase().equals(str)) {
      nodes.add(n);
    }
 else     if ((n.getNodeData().getLabel() != null) && n.getNodeData().getLabel().toLowerCase().equals(str)) {
      nodes.add(n);
    }
  }
  Set<Node> result=new HashSet<Node>();
  Set<Node> neighbours=new HashSet<Node>();
  neighbours.addAll(nodes);
  for (int i=0; i < depth; i++) {
    Node[] nei=neighbours.toArray(new Node[0]);
    neighbours.clear();
    for (    Node n : nei) {
      for (      Node neighbor : hgraph.getNeighbors(n)) {
        if (!result.contains(neighbor)) {
          neighbours.add(neighbor);
          result.add(neighbor);
        }
      }
    }
    if (neighbours.isEmpty()) {
      break;
    }
  }
  if (self) {
    result.addAll(nodes);
  }
  for (  Node node : hgraph.getNodes().toArray()) {
    if (!result.contains(node)) {
      hgraph.removeNode(node);
    }
  }
  return hgraph;
}

Fixed version (ground truth):
public Graph filter(Graph graph){
  HierarchicalGraph hgraph=(HierarchicalGraph)graph;
  String str=pattern.toLowerCase();
  List<Node> nodes=new ArrayList<Node>();
  for (  Node n : hgraph.getNodes()) {
    if (n.getNodeData().getId().toLowerCase().equals(str)) {
      nodes.add(n);
    }
 else     if ((n.getNodeData().getLabel() != null) && n.getNodeData().getLabel().toLowerCase().equals(str)) {
      nodes.add(n);
    }
  }
  Set<Node> result=new HashSet<Node>();
  Set<Node> neighbours=new HashSet<Node>();
  neighbours.addAll(nodes);
  for (int i=0; i < depth; i++) {
    Node[] nei=neighbours.toArray(new Node[0]);
    neighbours.clear();
    for (    Node n : nei) {
      for (      Node neighbor : hgraph.getNeighbors(n)) {
        if (!result.contains(neighbor)) {
          neighbours.add(neighbor);
          result.add(neighbor);
        }
      }
    }
    if (neighbours.isEmpty()) {
      break;
    }
  }
  if (self) {
    result.addAll(nodes);
  }
 else {
    result.removeAll(nodes);
  }
  for (  Node node : hgraph.getNodes().toArray()) {
    if (!result.contains(node)) {
      hgraph.removeNode(node);
    }
  }
  return hgraph;
}
Program: 189893
Project: 189893
Buggy source:
@Override protected JDialog createDialog(Component parent) throws HeadlessException {
  JDialog dialog=super.createDialog(parent);
  Component c=dialog.getContentPane().getComponent(0);
  if (c != null && c instanceof JComponent) {
    Insets insets=((JComponent)c).getInsets();
    southPanel.setBorder(BorderFactory.createEmptyBorder(insets.top,insets.left,insets.bottom,insets.right));
  }
  dialog.getContentPane().add(southPanel,BorderLayout.SOUTH);
  return dialog;
}

Fixed version (ground truth):
@Override protected JDialog createDialog(Component parent) throws HeadlessException {
  JDialog dialog=super.createDialog(parent);
  dialog.setSize(640,480);
  dialog.setResizable(true);
  Component c=dialog.getContentPane().getComponent(0);
  if (c != null && c instanceof JComponent) {
    Insets insets=((JComponent)c).getInsets();
    southPanel.setBorder(BorderFactory.createEmptyBorder(insets.top,insets.left,insets.bottom,insets.right));
  }
  dialog.getContentPane().add(southPanel,BorderLayout.SOUTH);
  return dialog;
}
Program: 189895
Project: 189895
Buggy source:
public void mousePressed(MouseEvent e){
  if (model == null) {
    return;
  }
  int x=e.getX();
  latestMousePositionX=x;
  currentMousePositionX=latestMousePositionX;
  int r=16;
  if (currentState == TimelineState.IDLE) {
    if (inRange(x,(int)sf - 1,(int)sf + r + 1)) {
      highlightedComponent=HighlightedComponent.LEFT_HOOK;
      currentState=TimelineState.RESIZE_FROM;
    }
 else     if (inRange(x,(int)sf + r,(int)st - r)) {
      highlightedComponent=HighlightedComponent.CENTER_HOOK;
      currentState=TimelineState.MOVING;
    }
 else     if (inRange(x,(int)st - r - 1,(int)st + 1)) {
      highlightedComponent=HighlightedComponent.RIGHT_HOOK;
      currentState=TimelineState.RESIZE_TO;
    }
  }
}

Fixed version (ground truth):
public void mousePressed(MouseEvent e){
  if (model == null) {
    return;
  }
  int x=e.getX();
  latestMousePositionX=x;
  currentMousePositionX=latestMousePositionX;
  int r=16;
  if (currentState == TimelineState.IDLE) {
    int position=inPosition(x,r);
switch (position) {
case LOC_RESIZE_FROM:
      highlightedComponent=HighlightedComponent.LEFT_HOOK;
    currentState=TimelineState.RESIZE_FROM;
  break;
case LOC_RESIZE_CENTER:
highlightedComponent=HighlightedComponent.CENTER_HOOK;
currentState=TimelineState.MOVING;
break;
case LOC_RESIZE_TO:
highlightedComponent=HighlightedComponent.RIGHT_HOOK;
currentState=TimelineState.RESIZE_TO;
break;
default :
break;
}
}
}
Program: 189896
Project: 189896
Buggy source:
public void mouseMoved(MouseEvent evt){
  if (model == null) {
    return;
  }
  currentMousePositionX=evt.getX();
  int x=currentMousePositionX;
  float w=getWidth();
  int r=settings.selection.visibleHookWidth;
  HighlightedComponent old=highlightedComponent;
  Cursor newCursor=null;
  int a=0;
  if (inRange(x,(int)sf - 1,(int)sf + r + 1)) {
    newCursor=CURSOR_LEFT_HOOK;
    highlightedComponent=HighlightedComponent.LEFT_HOOK;
  }
 else   if (inRange(x,(int)sf + r,(int)st - r)) {
    highlightedComponent=HighlightedComponent.CENTER_HOOK;
    newCursor=CURSOR_CENTRAL_HOOK;
  }
 else   if (inRange(x,(int)st - r - 1,(int)st + 1)) {
    highlightedComponent=HighlightedComponent.RIGHT_HOOK;
    newCursor=CURSOR_RIGHT_HOOK;
  }
 else {
    highlightedComponent=HighlightedComponent.NONE;
    newCursor=CURSOR_DEFAULT;
  }
  if (newCursor != getCursor()) {
    setCursor(newCursor);
  }
  repaint();
}

Fixed version (ground truth):
public void mouseMoved(MouseEvent evt){
  if (model == null) {
    return;
  }
  currentMousePositionX=evt.getX();
  int x=currentMousePositionX;
  float w=getWidth();
  int r=settings.selection.visibleHookWidth;
  HighlightedComponent old=highlightedComponent;
  Cursor newCursor=null;
  int a=0;
  int position=inPosition(x,r);
switch (position) {
case LOC_RESIZE_FROM:
    newCursor=CURSOR_LEFT_HOOK;
  highlightedComponent=HighlightedComponent.LEFT_HOOK;
break;
case LOC_RESIZE_CENTER:
highlightedComponent=HighlightedComponent.CENTER_HOOK;
newCursor=CURSOR_CENTRAL_HOOK;
break;
case LOC_RESIZE_TO:
highlightedComponent=HighlightedComponent.RIGHT_HOOK;
newCursor=CURSOR_RIGHT_HOOK;
break;
default :
highlightedComponent=HighlightedComponent.NONE;
newCursor=CURSOR_DEFAULT;
break;
}
if (newCursor != getCursor()) {
setCursor(newCursor);
}
repaint();
}
Program: 189897
Project: 189897
Buggy source:
@Override public Connection getConnection(String connectionUrl,String username,String passwd) throws SQLException {
  return DriverManager.getConnection(connectionUrl,username,passwd);
}

Fixed version (ground truth):
@Override public Connection getConnection(String connectionUrl,String username,String passwd) throws SQLException {
  if (!connectionUrl.contains("String_Node_Str")) {
    String dbname=connectionUrl.substring(connectionUrl.lastIndexOf('/') + 1);
    String url=connectionUrl.substring(0,connectionUrl.lastIndexOf('/'));
    connectionUrl=url + "String_Node_Str" + dbname;
  }
  return DriverManager.getConnection(connectionUrl,username,passwd);
}
Program: 189898
Project: 189898
Buggy source:
/** 
 * Hack to have a current workpace when opening workspace
 * @param temporaryOpeningWorkspace the opening workspace or null
 */
public void setTemporaryOpeningWorkspace(WorkspaceImpl temporaryOpeningWorkspace){
  this.temporaryOpeningWorkspace=temporaryOpeningWorkspace;
}

Fixed version (ground truth):
/** 
 * Hack to have a current workpace when opening workspace
 * @param temporaryOpeningWorkspace the opening workspace or null
 */
public void setTemporaryOpeningWorkspace(WorkspaceImpl temporaryOpeningWorkspace){
  this.temporaryOpeningWorkspace=temporaryOpeningWorkspace;
  if (temporaryOpeningWorkspace != null) {
    fireWorkspaceEvent(EventType.INITIALIZE,temporaryOpeningWorkspace);
  }
}
Program: 189899
Project: 189899
Buggy source:
public Float getUpperFloat(){
  return upperFloat;
}

Fixed version (ground truth):
public Float getUpperFloat(){
  return (Float)upperNumber;
}
Program: 189900
Project: 189900
Buggy source:
public boolean isInRange(Object value){
  if (rangeType == Double.class) {
    return isInRange((Double)value);
  }
 else   if (rangeType == Float.class) {
    return isInRange((Float)value);
  }
 else   if (rangeType == Integer.class) {
    return isInRange((Integer)value);
  }
 else   if (rangeType == Long.class) {
    return isInRange((Long)value);
  }
  return false;
}

Fixed version (ground truth):
public boolean isInRange(Number value){
  if (rangeType == Double.class) {
    return isInRange((Double)value);
  }
 else   if (rangeType == Float.class) {
    return isInRange((Float)value);
  }
 else   if (rangeType == Integer.class) {
    return isInRange((Integer)value);
  }
 else   if (rangeType == Long.class) {
    return isInRange((Long)value);
  }
 else   if (rangeType == Byte.class) {
    return isInRange((Byte)value);
  }
 else   if (rangeType == Short.class) {
    return isInRange((Short)value);
  }
  return false;
}
Program: 189901
Project: 189901
Buggy source:
public Object getUpperBound(){
  if (rangeType == Double.class) {
    return upperDouble;
  }
 else   if (rangeType == Float.class) {
    return upperFloat;
  }
 else   if (rangeType == Integer.class) {
    return upperInteger;
  }
 else   if (rangeType == Long.class) {
    return upperLong;
  }
  return null;
}

Fixed version (ground truth):
public Object getUpperBound(){
  return upperNumber;
}
Program: 189902
Project: 189902
Buggy source:
public Range(Object lowerBound,Object upperBound){
  if (lowerBound instanceof Double) {
    lowerDouble=(Double)lowerBound;
    upperDouble=(Double)upperBound;
    rangeType=Double.class;
  }
 else   if (lowerBound instanceof Float) {
    lowerFloat=(Float)lowerBound;
    upperFloat=(Float)upperBound;
    rangeType=Float.class;
  }
 else   if (lowerBound instanceof Integer) {
    lowerInteger=(Integer)lowerBound;
    upperInteger=(Integer)upperBound;
    rangeType=Integer.class;
  }
 else   if (lowerBound instanceof Long) {
    lowerLong=(Long)lowerBound;
    upperLong=(Long)upperBound;
    rangeType=Long.class;
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
public Range(Number lowerBound,Number upperBound,Number min,Number max){
  this(lowerBound,upperBound);
  if (!min.getClass().equals(lowerBound.getClass()) || !min.getClass().equals(max.getClass())) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.min=min;
  this.max=max;
}
Program: 189903
Project: 189903
Buggy source:
public Double getLowerDouble(){
  return lowerDouble;
}

Fixed version (ground truth):
public Double getLowerDouble(){
  return (Double)lowerNumber;
}
Program: 189904
Project: 189904
Buggy source:
public Float getLowerFloat(){
  return lowerFloat;
}

Fixed version (ground truth):
public Float getLowerFloat(){
  return (Float)lowerNumber;
}
Program: 189905
Project: 189905
Buggy source:
public Integer getUpperInteger(){
  return upperInteger;
}

Fixed version (ground truth):
public Integer getUpperInteger(){
  return (Integer)upperNumber;
}
Program: 189906
Project: 189906
Buggy source:
public Integer getLowerInteger(){
  return lowerInteger;
}

Fixed version (ground truth):
public Integer getLowerInteger(){
  return (Integer)lowerNumber;
}
Program: 189907
Project: 189907
Buggy source:
public Double getUpperDouble(){
  return upperDouble;
}

Fixed version (ground truth):
public Double getUpperDouble(){
  return (Double)upperNumber;
}
Program: 189908
Project: 189908
Buggy source:
@Override public String toString(){
  if (rangeType == Double.class) {
    return lowerDouble.toString() + "String_Node_Str" + upperDouble.toString();
  }
 else   if (rangeType == Float.class) {
    return lowerFloat.toString() + "String_Node_Str" + upperFloat.toString();
  }
 else   if (rangeType == Integer.class) {
    return lowerInteger.toString() + "String_Node_Str" + upperInteger.toString();
  }
 else   if (rangeType == Long.class) {
    return lowerLong.toString() + "String_Node_Str" + upperLong.toString();
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return lowerNumber + "String_Node_Str" + upperNumber;
}
Program: 189909
Project: 189909
Buggy source:
public Object getLowerBound(){
  if (rangeType == Double.class) {
    return lowerDouble;
  }
 else   if (rangeType == Float.class) {
    return lowerFloat;
  }
 else   if (rangeType == Integer.class) {
    return lowerInteger;
  }
 else   if (rangeType == Long.class) {
    return lowerLong;
  }
  return null;
}

Fixed version (ground truth):
public Number getLowerBound(){
  return lowerNumber;
}
Program: 189910
Project: 189910
Buggy source:
public Long getUpperLong(){
  return upperLong;
}

Fixed version (ground truth):
public Long getUpperLong(){
  return (Long)upperNumber;
}
Program: 189911
Project: 189911
Buggy source:
public Long getLowerLong(){
  return lowerLong;
}

Fixed version (ground truth):
public Long getLowerLong(){
  return (Long)lowerNumber;
}
Program: 189912
Project: 189912
Buggy source:
private boolean isDynamic(Filter filter){
  Query filterQuery=null;
  for (  Query q : filterModel.getCurrentQuery().getQueries(filter.getClass())) {
    if (q.getFilter() == filter) {
      filterQuery=q;
      break;
    }
  }
  if (filterQuery != null) {
    for (    Query query : filterQuery.getDescendantsAndSelf()) {
      if (query.getFilter().getClass().equals(DynamicRangeFilter.class)) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isDynamic(Filter filter){
  if (filterModel.getCurrentQuery() == null) {
    return false;
  }
  Query filterQuery=null;
  for (  Query q : filterModel.getCurrentQuery().getQueries(filter.getClass())) {
    if (q.getFilter() == filter) {
      filterQuery=q;
      break;
    }
  }
  if (filterQuery != null) {
    for (    Query query : filterQuery.getDescendantsAndSelf()) {
      if (query.getFilter().getClass().equals(DynamicRangeFilter.class)) {
        return true;
      }
    }
  }
  return false;
}
Program: 189913
Project: 189913
Buggy source:
public void finish(){
  refreshRange();
}

Fixed version (ground truth):
public void finish(){
}
Program: 189914
Project: 189914
Buggy source:
public boolean init(Graph graph){
  HierarchicalGraph hg=graph.getGraphModel().getHierarchicalGraphVisible();
  dynamicHelper=new DynamicAttributesHelper(this,hg);
  if (range == null) {
    getValues();
    refreshRange();
  }
  values=new ArrayList<Object>();
  return true;
}

Fixed version (ground truth):
public boolean init(Graph graph){
  HierarchicalGraph hg=graph.getGraphModel().getHierarchicalGraphVisible();
  if (AttributeUtils.getDefault().isNodeColumn(column)) {
    if (graph.getNodeCount() == 0) {
      return false;
    }
  }
 else   if (AttributeUtils.getDefault().isEdgeColumn(column)) {
    if (hg.getTotalEdgeCount() == 0) {
      return false;
    }
  }
  dynamicHelper=new DynamicAttributesHelper(this,hg);
  refreshValues(hg);
  return true;
}
Program: 189915
Project: 189915
Buggy source:
public Object[] getValues(){
  if (values == null) {
    GraphModel gm=Lookup.getDefault().lookup(GraphController.class).getModel();
    HierarchicalGraph hgraph=gm.getHierarchicalGraphVisible();
    List<Object> vals=new ArrayList<Object>();
    if (AttributeUtils.getDefault().isNodeColumn(column)) {
      for (      Node n : hgraph.getNodes()) {
        Object val=n.getNodeData().getAttributes().getValue(column.getIndex());
        val=dynamicHelper.getDynamicValue(val);
        if (val != null) {
          vals.add(val);
        }
      }
    }
 else {
      for (      Edge e : hgraph.getEdgesAndMetaEdges()) {
        Object val=e.getEdgeData().getAttributes().getValue(column.getIndex());
        val=dynamicHelper.getDynamicValue(val);
        if (val != null) {
          vals.add(val);
        }
      }
    }
    if (vals.isEmpty()) {
      vals.add(0);
    }
    Comparable[] comparableArray=ComparableArrayConverter.convert(vals);
    min=AttributeUtils.getDefault().getMin(column,comparableArray);
    max=AttributeUtils.getDefault().getMax(column,comparableArray);
    refreshRange();
    return comparableArray;
  }
 else {
    Comparable[] comparableArray=ComparableArrayConverter.convert(values);
    min=AttributeUtils.getDefault().getMin(column,comparableArray);
    max=AttributeUtils.getDefault().getMax(column,comparableArray);
    return comparableArray;
  }
}

Fixed version (ground truth):
public Object[] getValues(){
  return values;
}
Program: 189916
Project: 189916
Buggy source:
public boolean evaluate(Graph graph,Edge edge){
  Object val=edge.getEdgeData().getAttributes().getValue(column.getIndex());
  val=dynamicHelper.getDynamicValue(val);
  if (val != null) {
    values.add(val);
    return range.isInRange(val);
  }
  return false;
}

Fixed version (ground truth):
public boolean evaluate(Graph graph,Edge edge){
  Object val=edge.getEdgeData().getAttributes().getValue(column.getIndex());
  val=dynamicHelper.getDynamicValue(val);
  if (val != null) {
    return range.isInRange((Number)val);
  }
  return false;
}
Program: 189917
Project: 189917
Buggy source:
public boolean init(Graph graph){
  HierarchicalGraph hgraph=(HierarchicalGraph)graph;
  dynamicHelper=new DynamicAttributesHelper(this,hgraph);
  if (range == null) {
    getValues();
    refreshRange();
  }
  values=new ArrayList<Float>(hgraph.getTotalEdgeCount());
  min=Float.POSITIVE_INFINITY;
  max=Float.NEGATIVE_INFINITY;
  return true;
}

Fixed version (ground truth):
public boolean init(Graph graph){
  HierarchicalGraph hgraph=(HierarchicalGraph)graph;
  if (hgraph.getTotalEdgeCount() == 0) {
    return false;
  }
  dynamicHelper=new DynamicAttributesHelper(this,hgraph);
  refreshValues(graph);
  return true;
}
Program: 189918
Project: 189918
Buggy source:
public Object[] getValues(){
  if (values == null) {
    GraphModel gm=Lookup.getDefault().lookup(GraphController.class).getModel();
    HierarchicalGraph hgraph=gm.getHierarchicalGraphVisible();
    Float[] weights=new Float[hgraph.getTotalEdgeCount()];
    int i=0;
    min=Float.MAX_VALUE;
    max=Float.MIN_VALUE;
    for (    Edge e : hgraph.getEdgesAndMetaEdges()) {
      float weight=dynamicHelper.getEdgeWeight(e);
      min=Math.min(min,weight);
      max=Math.max(max,weight);
      weights[i++]=weight;
    }
    refreshRange();
    return weights;
  }
 else {
    return values.toArray(new Float[0]);
  }
}

Fixed version (ground truth):
public Object[] getValues(){
  return values.toArray(new Float[0]);
}
Program: 189919
Project: 189919
Buggy source:
public void finish(){
  refreshRange();
}

Fixed version (ground truth):
public void finish(){
}
Program: 189920
Project: 189920
Buggy source:
public boolean evaluate(Graph graph,Edge edge){
  float weight=dynamicHelper.getEdgeWeight(edge);
  min=Math.min(min,weight);
  max=Math.max(max,weight);
  values.add(new Float(weight));
  return range.isInRange(weight);
}

Fixed version (ground truth):
public boolean evaluate(Graph graph,Edge edge){
  float weight=dynamicHelper.getEdgeWeight(edge);
  return range.isInRange(weight);
}
Program: 189921
Project: 189921
Buggy source:
private void attributesEdgeColumns(AttributeModel attributeModel){
  List<AttributeColumn> cols=new ArrayList<AttributeColumn>();
  if (attributeModel != null) {
    for (    AttributeColumn column : attributeModel.getEdgeTable().getColumns()) {
      if (!isEdgeDefaultColumn(column.getId())) {
        cols.add(column);
      }
    }
  }
  edgeColumns=cols.toArray(new AttributeColumn[0]);
}

Fixed version (ground truth):
private void attributesEdgeColumns(AttributeModel attributeModel){
  List<AttributeColumn> cols=new ArrayList<AttributeColumn>();
  if (exportAttributes && attributeModel != null) {
    for (    AttributeColumn column : attributeModel.getEdgeTable().getColumns()) {
      if (!isEdgeDefaultColumn(column.getId())) {
        cols.add(column);
      }
    }
  }
  edgeColumns=cols.toArray(new AttributeColumn[0]);
}
Program: 189922
Project: 189922
Buggy source:
private void attributesNodeColumns(AttributeModel attributeModel){
  List<AttributeColumn> cols=new ArrayList<AttributeColumn>();
  if (attributeModel != null) {
    for (    AttributeColumn column : attributeModel.getNodeTable().getColumns()) {
      if (!isNodeDefaultColumn(column.getId())) {
        cols.add(column);
      }
    }
  }
  nodeColumns=cols.toArray(new AttributeColumn[0]);
}

Fixed version (ground truth):
private void attributesNodeColumns(AttributeModel attributeModel){
  List<AttributeColumn> cols=new ArrayList<AttributeColumn>();
  if (exportAttributes && attributeModel != null) {
    for (    AttributeColumn column : attributeModel.getNodeTable().getColumns()) {
      if (!isNodeDefaultColumn(column.getId())) {
        cols.add(column);
      }
    }
  }
  nodeColumns=cols.toArray(new AttributeColumn[0]);
}
Program: 189923
Project: 189923
Buggy source:
private void createDefaultGroups(){
  groups=new VizToolbarGroup[4];
  groups[0]=new GlobalGroupBar();
  groups[1]=new NodeGroupBar();
  groups[2]=new EdgeGroupBar();
  groups[3]=new LabelGroupBar();
  VizModel model=VizController.getInstance().getVizModel();
  model.addPropertyChangeListener(new PropertyChangeListener(){
    public void propertyChange(    PropertyChangeEvent evt){
      if (evt.getPropertyName().equals("String_Node_Str")) {
        VizModel model=VizController.getInstance().getVizModel();
        toolbar.setEnable(!model.isDefaultModel());
      }
    }
  }
);
}

Fixed version (ground truth):
private void createDefaultGroups(){
  groups=new VizToolbarGroup[4];
  groups[0]=new GlobalGroupBar();
  groups[1]=new NodeGroupBar();
  groups[2]=new EdgeGroupBar();
  groups[3]=new LabelGroupBar();
  VizModel model=VizController.getInstance().getVizModel();
  model.addPropertyChangeListener(new PropertyChangeListener(){
    public void propertyChange(    PropertyChangeEvent evt){
      if (evt.getPropertyName().equals("String_Node_Str")) {
        VizModel model=VizController.getInstance().getVizModel();
        toolbar.setEnable(!model.isDefaultModel());
        ((NodeGroupBar)groups[1]).setModelValues(model);
        ((EdgeGroupBar)groups[2]).setModelValues(model);
        ((LabelGroupBar)groups[3]).setModelValues(model);
      }
    }
  }
);
}
Program: 189925
Project: 189925
Buggy source:
public void setNodeFixed(Node node,boolean fixed){
  if (isNodeInGraph(node)) {
    node.getNodeData().setFixed(fixed);
  }
}

Fixed version (ground truth):
public void setNodeFixed(Node node,boolean fixed){
  node.getNodeData().setFixed(fixed);
}
Program: 189926
Project: 189926
Buggy source:
private void removeEdge(Edge edge,Graph graph){
  if (isEdgeInGraph(edge)) {
    graph.removeEdge(edge);
  }
}

Fixed version (ground truth):
private void removeEdge(Edge edge,Graph graph){
  graph.removeEdge(edge);
}
Program: 189927
Project: 189927
Buggy source:
public Node duplicateNode(Node node){
  if (isNodeInGraph(node)) {
    HierarchicalGraph hg=getHierarchicalGraph();
    Node copy=copyNodeRecursively(node,hg.getParent(node),hg);
    return copy;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public Node duplicateNode(Node node){
  HierarchicalGraph hg=getHierarchicalGraph();
  Node copy=copyNodeRecursively(node,hg.getParent(node),hg);
  return copy;
}
Program: 189928
Project: 189928
Buggy source:
private void removeNode(Node node,Graph graph){
  if (isNodeInGraph(node)) {
    graph.removeNode(node);
  }
}

Fixed version (ground truth):
private void removeNode(Node node,Graph graph){
  graph.removeNode(node);
}
Program: 189929
Project: 189929
Buggy source:
public void createEdges(Node source,Node[] allNodes,boolean directed){
  if (isNodeInGraph(source) && areNodesInGraph(allNodes)) {
    for (    Node n : allNodes) {
      if (n != source) {
        createEdge(source,n,directed);
      }
    }
  }
}

Fixed version (ground truth):
public void createEdges(Node source,Node[] allNodes,boolean directed){
  for (  Node n : allNodes) {
    if (n != source) {
      createEdge(source,n,directed);
    }
  }
}
Program: 189930
Project: 189930
Buggy source:
public boolean canMoveNodeToGroup(Node node,Node group){
  HierarchicalGraph hg=getHierarchicalGraph();
  return node != group && hg.getParent(node) == hg.getParent(group) && canUngroupNode(group) && isNodeInGraph(node);
}

Fixed version (ground truth):
public boolean canMoveNodeToGroup(Node node,Node group){
  HierarchicalGraph hg=getHierarchicalGraph();
  return node != group && hg.getParent(node) == hg.getParent(group) && canUngroupNode(group);
}
Program: 189931
Project: 189931
Buggy source:
public boolean canUngroupNode(Node node){
  if (!isNodeInGraph(node)) {
    return false;
  }
  boolean canUngroup;
  HierarchicalGraph hg=getHierarchicalGraph();
  canUngroup=getNodeChildrenCount(hg,node) > 0;
  return canUngroup;
}

Fixed version (ground truth):
public boolean canUngroupNode(Node node){
  boolean canUngroup;
  HierarchicalGraph hg=getHierarchicalGraph();
  canUngroup=getNodeChildrenCount(hg,node) > 0;
  return canUngroup;
}
Program: 189932
Project: 189932
Buggy source:
public boolean canGroupNodes(Node[] nodes){
  if (!areNodesInGraph(nodes)) {
    return false;
  }
  HierarchicalGraph hg=getHierarchicalGraph();
  Node parent=hg.getParent(nodes[0]);
  for (  Node n : nodes) {
    if (hg.getParent(n) != parent) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean canGroupNodes(Node[] nodes){
  HierarchicalGraph hg=getHierarchicalGraph();
  Node parent=hg.getParent(nodes[0]);
  for (  Node n : nodes) {
    if (hg.getParent(n) != parent) {
      return false;
    }
  }
  return true;
}
Program: 189933
Project: 189933
Buggy source:
public boolean isNodeInGroup(Node node){
  if (!isNodeInGraph(node)) {
    return false;
  }
  HierarchicalGraph hg=getHierarchicalGraph();
  return hg.getParent(node) != null;
}

Fixed version (ground truth):
public boolean isNodeInGroup(Node node){
  HierarchicalGraph hg=getHierarchicalGraph();
  return hg.getParent(node) != null;
}
Program: 189934
Project: 189934
Buggy source:
public void run(){
  JFrame frame=(JFrame)WindowManager.getDefault().getMainWindow();
  String title=frame.getTitle() + "String_Node_Str" + project.getLookup().lookup(ProjectInformation.class).getName();
  frame.setTitle(title);
}

Fixed version (ground truth):
public void run(){
  JFrame frame=(JFrame)WindowManager.getDefault().getMainWindow();
  String title=frame.getTitle();
  title=title.substring(0,title.indexOf('-') - 1);
  frame.setTitle(title);
}
Program: 189935
Project: 189935
Buggy source:
public void deleteWorkspace(){
  controller.deleteWorkspace(controller.getCurrentWorkspace());
}

Fixed version (ground truth):
public void deleteWorkspace(){
  if (controller.getCurrentProject().getLookup().lookup(WorkspaceProvider.class).getWorkspaces().length == 1) {
    saveProject=false;
    saveAsProject=false;
    projectProperties=false;
    closeProject=false;
    newWorkspace=false;
    deleteWorkspace=false;
    cleanWorkspace=false;
    duplicateWorkspace=false;
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        JFrame frame=(JFrame)WindowManager.getDefault().getMainWindow();
        String title=frame.getTitle();
        title=title.substring(0,title.indexOf('-') - 1);
        frame.setTitle(title);
      }
    }
);
  }
  controller.deleteWorkspace(controller.getCurrentWorkspace());
}