nus-yam/ex-repair huggingface dataset:
Program: 189779
Project: 189779
Buggy source:
public void compute(){
  graph.readLock();
  Set<Node> unsettledNodes=new HashSet<Node>();
  Set<Node> settledNodes=new HashSet<Node>();
  for (  Node node : graph.getNodes()) {
    distances.put(node,Double.POSITIVE_INFINITY);
  }
  distances.put(sourceNode,0d);
  unsettledNodes.add(sourceNode);
  while (!unsettledNodes.isEmpty()) {
    Double minDistance=Double.POSITIVE_INFINITY;
    Node minDistanceNode=null;
    for (    Node k : unsettledNodes) {
      Double dist=distances.get(k);
      if (minDistanceNode == null) {
        minDistanceNode=k;
      }
 else       if (dist.compareTo(minDistance) < 0) {
        minDistance=dist;
        minDistanceNode=k;
      }
    }
    unsettledNodes.remove(minDistanceNode);
    settledNodes.add(minDistanceNode);
    for (    Edge edge : graph.getEdges(minDistanceNode)) {
      Node neighbor=graph.getOpposite(minDistanceNode,edge);
      if (!settledNodes.contains(neighbor)) {
        double dist=getShortestDistance(minDistanceNode) + edgeWeight(edge);
        if (getShortestDistance(neighbor) > dist) {
          distances.put(neighbor,dist);
          predecessors.put(neighbor,edge);
          unsettledNodes.add(neighbor);
          maxDistance=Math.max(maxDistance,dist);
        }
      }
    }
  }
  graph.readUnlock();
}

Fixed version (ground truth):
public void compute(){
  graph.readLock();
  Set<Node> unsettledNodes=new HashSet<Node>();
  Set<Node> settledNodes=new HashSet<Node>();
  for (  Node node : graph.getNodes()) {
    distances.put(node,Double.POSITIVE_INFINITY);
  }
  distances.put(sourceNode,0d);
  unsettledNodes.add(sourceNode);
  while (!unsettledNodes.isEmpty()) {
    Double minDistance=Double.POSITIVE_INFINITY;
    Node minDistanceNode=null;
    for (    Node k : unsettledNodes) {
      Double dist=distances.get(k);
      if (minDistanceNode == null) {
        minDistanceNode=k;
      }
      if (dist.compareTo(minDistance) < 0) {
        minDistance=dist;
        minDistanceNode=k;
      }
    }
    unsettledNodes.remove(minDistanceNode);
    settledNodes.add(minDistanceNode);
    for (    Edge edge : graph.getEdges(minDistanceNode)) {
      Node neighbor=graph.getOpposite(minDistanceNode,edge);
      if (!settledNodes.contains(neighbor)) {
        double dist=getShortestDistance(minDistanceNode) + edgeWeight(edge);
        if (getShortestDistance(neighbor) > dist) {
          distances.put(neighbor,dist);
          predecessors.put(neighbor,edge);
          unsettledNodes.add(neighbor);
          maxDistance=Math.max(maxDistance,dist);
        }
      }
    }
  }
  graph.readUnlock();
}
Program: 189780
Project: 189780
Buggy source:
public void export(Graph graph,String filename) throws IOException {
  if (graph.getNodeCount() <= 1)   return;
  for (  Node node : graph.getNodes()) {
    minX=Math.min((int)node.getNodeData().x(),minX);
    minY=Math.min((int)node.getNodeData().y(),minY);
    maxX=Math.max((int)node.getNodeData().x(),maxX);
    maxY=Math.max((int)node.getNodeData().y(),maxY);
  }
  int width=1024 * 4;
  int height=width * (maxY - minY) / (maxX - minX);
  image=new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
  points=new float[image.getWidth()][image.getHeight()];
  for (int i=0; i < image.getWidth(); i++) {
    for (int j=0; j < image.getHeight(); j++) {
      image.setRGB(i,j,Color.WHITE.getRGB());
    }
  }
  for (  Edge edge : graph.getEdges()) {
    FDEBLayoutData data=edge.getEdgeData().getLayoutData();
    for (int i=0; i < data.subdivisionPoints.length - 1; i++) {
      makeLine(data.subdivisionPoints[i].x,data.subdivisionPoints[i].y,data.subdivisionPoints[i + 1].x,data.subdivisionPoints[i + 1].y);
    }
  }
  float max=0;
  for (int i=0; i < image.getWidth(); i++) {
    for (int j=0; j < image.getHeight(); j++) {
      max=Math.max(max,points[i][j]);
    }
  }
  for (int i=0; i < image.getWidth(); i++) {
    for (int j=0; j < image.getHeight(); j++) {
      if (points[i][j] > 0) {
        image.setRGB(i,j,generateGradient(points[i][j] / max));
      }
    }
  }
  System.err.println("String_Node_Str" + ImageIO.write(image,"String_Node_Str",new File(filename + "String_Node_Str")));
}

Fixed version (ground truth):
public void export(Graph graph,String filename) throws IOException {
  if (graph.getNodeCount() <= 1)   return;
  for (  Node node : graph.getNodes()) {
    minX=Math.min((int)node.getNodeData().x(),minX);
    minY=Math.min((int)node.getNodeData().y(),minY);
    maxX=Math.max((int)node.getNodeData().x(),maxX);
    maxY=Math.max((int)node.getNodeData().y(),maxY);
  }
  int width=maxX - minX;
  int height=width * (maxY - minY) / (maxX - minX);
  image=new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
  points=new float[image.getWidth()][image.getHeight()];
  for (int i=0; i < image.getWidth(); i++) {
    for (int j=0; j < image.getHeight(); j++) {
      image.setRGB(i,j,Color.WHITE.getRGB());
    }
  }
  for (  Edge edge : graph.getEdges()) {
    FDEBLayoutData data=edge.getEdgeData().getLayoutData();
    for (int i=0; i < data.subdivisionPoints.length - 1; i++) {
      makeLine(data.subdivisionPoints[i].x,data.subdivisionPoints[i].y,data.subdivisionPoints[i + 1].x,data.subdivisionPoints[i + 1].y);
    }
  }
  float max=0;
  for (int i=0; i < image.getWidth(); i++) {
    for (int j=0; j < image.getHeight(); j++) {
      max=Math.max(max,points[i][j]);
    }
  }
  for (int i=0; i < image.getWidth(); i++) {
    for (int j=0; j < image.getHeight(); j++) {
      if (points[i][j] > 0) {
        image.setRGB(i,j,generateGradient(points[i][j] / max));
      }
    }
  }
  System.err.println("String_Node_Str" + ImageIO.write(image,"String_Node_Str",new File(filename + "String_Node_Str")));
}
Program: 189786
Project: 189786
Buggy source:
private double q(int node,Community community){
  Float edgesToFloat=structure.nodeConnections[node].get(community);
  double edgesTo=0;
  if (edgesToFloat != null) {
    edgesTo=edgesToFloat.doubleValue();
  }
  double weightSum=community.weightSum;
  double nodeWeight=structure.weights[node];
  double qValue=resolution * edgesTo - (nodeWeight * weightSum) / (2.0 * structure.graphWeightSum);
  if ((structure.nodeCommunities[node] == community) && (structure.nodeCommunities[node].size() > 1)) {
    qValue=resolution * edgesTo - (nodeWeight * (weightSum - nodeWeight)) / (2.0 * structure.graphWeightSum);
  }
  if ((structure.nodeCommunities[node] == community) && (structure.nodeCommunities[node].size() == 1)) {
    qValue=0.;
  }
  return qValue;
}

Fixed version (ground truth):
private double q(int node,Community community){
  Float edgesToFloat=structure.nodeConnectionsWeight[node].get(community);
  double edgesTo=0;
  if (edgesToFloat != null) {
    edgesTo=edgesToFloat.doubleValue();
  }
  double weightSum=community.weightSum;
  double nodeWeight=structure.weights[node];
  double qValue=resolution * edgesTo - (nodeWeight * weightSum) / (2.0 * structure.graphWeightSum);
  if ((structure.nodeCommunities[node] == community) && (structure.nodeCommunities[node].size() > 1)) {
    qValue=resolution * edgesTo - (nodeWeight * (weightSum - nodeWeight)) / (2.0 * structure.graphWeightSum);
  }
  if ((structure.nodeCommunities[node] == community) && (structure.nodeCommunities[node].size() == 1)) {
    qValue=0.;
  }
  return qValue;
}
Program: 189787
Project: 189787
Buggy source:
public Community(CommunityStructure structure){
  this.structure=structure;
  connections=new HashMap<Modularity.Community,Float>();
  nodes=new LinkedList<Integer>();
}

Fixed version (ground truth):
public Community(CommunityStructure structure){
  this.structure=structure;
  connectionsWeight=new HashMap<Modularity.Community,Float>();
  connectionsCount=new HashMap<Modularity.Community,Integer>();
  nodes=new LinkedList<Integer>();
}
Program: 189789
Project: 189789
Buggy source:
public BufferedImage getImage(TimelineModel model,int width,int height){
  double newMin=model.getCustomMin();
  double newMax=model.getCustomMax();
  if (parameters == null || newMax != max || newMin != min || parameters.getWidth() != width || parameters.getHeight() != height) {
    min=newMin;
    max=newMax;
    parameters=new TickParameters(model.getTimeFormat().equals(TimeFormat.DOUBLE) ? TickParameters.TickType.DOUBLE : TickParameters.TickType.DATE);
    parameters.setWidth(width);
    parameters.setHeight(height);
    image=draw();
  }
  return image;
}

Fixed version (ground truth):
public BufferedImage getImage(TimelineModel model,int width,int height){
  double newMin=model.getCustomMin();
  double newMax=model.getCustomMax();
  TickParameters.TickType timeFormat=model.getTimeFormat().equals(TimeFormat.DOUBLE) ? TickParameters.TickType.DOUBLE : TickParameters.TickType.DATE;
  if (parameters == null || newMax != max || newMin != min || parameters.getWidth() != width || parameters.getHeight() != height || !parameters.getType().equals(timeFormat)) {
    min=newMin;
    max=newMax;
    parameters=new TickParameters(timeFormat);
    parameters.setWidth(width);
    parameters.setHeight(height);
    image=draw();
  }
  return image;
}
Program: 189790
Project: 189790
Buggy source:
public Range(Number lowerBound,Number upperBound,Number min,Number max,Number[] values){
  this(lowerBound,upperBound,min,max);
  this.values=values;
}

Fixed version (ground truth):
public Range(Number lowerBound,Number upperBound,Number min,Number max,boolean leftInclusive,boolean rightInclusive,Number[] values){
  this(lowerBound,upperBound,min,max,values);
  this.leftInclusive=leftInclusive;
  this.rightInclusive=rightInclusive;
}
Program: 189793
Project: 189793
Buggy source:
public void setDefaults(){
  if (model.getTimeFormat().equals(TimeFormat.DATE)) {
    Date min=DynamicUtilities.getDateFromDouble(model.getMin());
    Date max=DynamicUtilities.getDateFromDouble(model.getMax());
    Date from=DynamicUtilities.getDateFromDouble(model.getMin());
    Date to=DynamicUtilities.getDateFromDouble(model.getMax());
    minTextField.setText(DATE_FORMAT.format(min));
    maxTextField.setText(DATE_FORMAT.format(max));
    startTextField.setText(DATE_FORMAT.format(from));
    endTextField.setText(DATE_FORMAT.format(to));
  }
 else   if (model.getTimeFormat().equals(TimeFormat.DATETIME)) {
    Date min=DynamicUtilities.getDateFromDouble(model.getMin());
    Date max=DynamicUtilities.getDateFromDouble(model.getMax());
    Date from=DynamicUtilities.getDateFromDouble(model.getMin());
    Date to=DynamicUtilities.getDateFromDouble(model.getMax());
    minTextField.setText(DATETIME_FORMAT.format(min));
    maxTextField.setText(DATETIME_FORMAT.format(max));
    startTextField.setText(DATETIME_FORMAT.format(from));
    endTextField.setText(DATETIME_FORMAT.format(to));
  }
 else {
    NumberFormat f=NumberFormat.getInstance(Locale.ENGLISH);
    f.setGroupingUsed(false);
    minTextField.setText(f.format(model.getMin()));
    maxTextField.setText(f.format(model.getMax()));
    startTextField.setText(f.format(model.getMin()));
    endTextField.setText(f.format(model.getMax()));
  }
}

Fixed version (ground truth):
public void setDefaults(){
  if (model.getTimeFormat().equals(TimeFormat.DATE)) {
    Date min=DynamicUtilities.getDateFromDouble(model.getMin());
    Date max=DynamicUtilities.getDateFromDouble(model.getMax());
    Date from=DynamicUtilities.getDateFromDouble(model.getMin());
    Date to=DynamicUtilities.getDateFromDouble(model.getMax());
    minTextField.setText(DATE_FORMAT.format(min));
    maxTextField.setText(DATE_FORMAT.format(max));
    startTextField.setText(DATE_FORMAT.format(from));
    endTextField.setText(DATE_FORMAT.format(to));
  }
 else   if (model.getTimeFormat().equals(TimeFormat.DATETIME)) {
    Date min=DynamicUtilities.getDateFromDouble(model.getMin());
    Date max=DynamicUtilities.getDateFromDouble(model.getMax());
    Date from=DynamicUtilities.getDateFromDouble(model.getMin());
    Date to=DynamicUtilities.getDateFromDouble(model.getMax());
    minTextField.setText(DATETIME_FORMAT.format(min));
    maxTextField.setText(DATETIME_FORMAT.format(max));
    startTextField.setText(DATETIME_FORMAT.format(from));
    endTextField.setText(DATETIME_FORMAT.format(to));
  }
 else {
    NumberFormat f=NumberFormat.getInstance(Locale.ENGLISH);
    f.setGroupingUsed(false);
    f.setMaximumFractionDigits(20);
    minTextField.setText(f.format(model.getMin()));
    maxTextField.setText(f.format(model.getMax()));
    startTextField.setText(f.format(model.getMin()));
    endTextField.setText(f.format(model.getMax()));
  }
}
Program: 189794
Project: 189794
Buggy source:
public Graph filter(Graph graph,Filter[] filters){
  if (filters.length > 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  HierarchicalGraph hgraph=(HierarchicalGraph)graph;
  Filter filter=filters[0];
  if (filter instanceof EdgeFilter && ((EdgeFilter)filter).init(hgraph)) {
    EdgeFilter edgeFilter=(EdgeFilter)filter;
    for (    Edge e : hgraph.getEdgesAndMetaEdges().toArray()) {
      if (edgeFilter.evaluate(hgraph,e)) {
        hgraph.removeEdge(e);
      }
    }
    edgeFilter.finish();
  }
  return hgraph;
}

Fixed version (ground truth):
public Graph filter(Graph graph,Filter[] filters){
  if (filters.length > 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  HierarchicalGraph hgraph=(HierarchicalGraph)graph;
  Filter filter=filters[0];
  if (filter instanceof EdgeFilter && ((EdgeFilter)filter).init(hgraph)) {
    EdgeFilter edgeFilter=(EdgeFilter)filter;
    List<Edge> edgesToRemove=new ArrayList<Edge>();
    for (    Edge e : hgraph.getEdgesAndMetaEdges().toArray()) {
      if (edgeFilter.evaluate(hgraph,e)) {
        edgesToRemove.add(e);
      }
    }
    for (    Edge e : edgesToRemove) {
      hgraph.removeEdge(e);
    }
    edgeFilter.finish();
  }
  return hgraph;
}
Program: 189795
Project: 189795
Buggy source:
public Graph filter(Graph graph,Filter[] filters){
  if (filters.length > 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  HierarchicalGraph hgraph=(HierarchicalGraph)graph;
  Filter filter=filters[0];
  if (filter instanceof NodeFilter && ((NodeFilter)filter).init(hgraph)) {
    NodeFilter nodeFilter=(NodeFilter)filter;
    for (    Node n : hgraph.getNodes().toArray()) {
      if (nodeFilter.evaluate(hgraph,n)) {
        hgraph.removeNode(n);
      }
    }
    nodeFilter.finish();
  }
  return hgraph;
}

Fixed version (ground truth):
public Graph filter(Graph graph,Filter[] filters){
  if (filters.length > 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  HierarchicalGraph hgraph=(HierarchicalGraph)graph;
  Filter filter=filters[0];
  if (filter instanceof NodeFilter && ((NodeFilter)filter).init(hgraph)) {
    List<Node> nodeToRemove=new ArrayList<Node>();
    NodeFilter nodeFilter=(NodeFilter)filter;
    for (    Node n : hgraph.getNodes().toArray()) {
      if (nodeFilter.evaluate(hgraph,n)) {
        nodeToRemove.add(n);
      }
    }
    for (    Node n : nodeToRemove) {
      hgraph.removeNode(n);
    }
    nodeFilter.finish();
  }
  return hgraph;
}
Program: 189796
Project: 189796
Buggy source:
public NodePencil(){
  color=Color.BLACK;
  size=10f;
}

Fixed version (ground truth):
public NodePencil(){
  color=new Color(153,153,153);
  size=10f;
}
Program: 189797
Project: 189797
Buggy source:
public EqualNumberFilter(AttributeColumn column){
  super(NbBundle.getMessage(AttributeEqualBuilder.class,"String_Node_Str"),column);
  this.dynamicHelper=new DynamicAttributesHelper(this,null);
  addProperty(Number.class,"String_Node_Str");
  ;
}

Fixed version (ground truth):
public EqualNumberFilter(AttributeColumn column){
  super(NbBundle.getMessage(AttributeEqualBuilder.class,"String_Node_Str"),column);
  addProperty(Number.class,"String_Node_Str");
  addProperty(Range.class,"String_Node_Str");
}
Program: 189798
Project: 189798
Buggy source:
public void setRange(Range range){
  if (range.getMinimum() == null && range.getMaximum() == null && this.range != null) {
    this.range=new Range(range.getLowerBound(),range.getUpperBound(),this.range.getMinimum(),this.range.getMaximum());
  }
 else {
    this.range=range;
  }
}

Fixed version (ground truth):
public void setRange(Range range){
  this.range=range;
}
Program: 189799
Project: 189799
Buggy source:
public AttributeRangeFilter(AttributeColumn column){
  super(column.getTitle() + "String_Node_Str" + NbBundle.getMessage(AttributeRangeBuilder.class,"String_Node_Str"),column);
  addProperty(Range.class,"String_Node_Str");
}

Fixed version (ground truth):
public AttributeRangeFilter(AttributeColumn column){
  super(NbBundle.getMessage(AttributeRangeBuilder.class,"String_Node_Str"),column);
  addProperty(Range.class,"String_Node_Str");
}
Program: 189800
Project: 189800
Buggy source:
public PartitionCountFilter(Partition partition){
  super(NbBundle.getMessage(PartitionCountBuilder.class,"String_Node_Str"),partition.getColumn());
  this.partition=partition;
}

Fixed version (ground truth):
public PartitionCountFilter(Partition partition){
  super(NbBundle.getMessage(PartitionCountBuilder.class,"String_Node_Str"),partition.getColumn());
  this.partition=partition;
  addProperty(Range.class,"String_Node_Str");
}
Program: 189802
Project: 189802
Buggy source:
public AbstractAttributeFilter(String name,AttributeColumn column){
  super(name);
  this.column=column;
  this.type=AttributeUtils.getDefault().isNodeColumn(column) ? Type.NODE : Type.EDGE;
  addProperty(AttributeColumn.class,"String_Node_Str");
}

Fixed version (ground truth):
public AbstractAttributeFilter(String name,AttributeColumn column){
  super(name + "String_Node_Str" + column.getTitle()+ "String_Node_Str");
  this.column=column;
  this.type=AttributeUtils.getDefault().isNodeColumn(column) ? Type.NODE : Type.EDGE;
  addProperty(AttributeColumn.class,"String_Node_Str");
}
Program: 189803
Project: 189803
Buggy source:
@Override public String getName(){
  return NbBundle.getMessage(InterEdgesBuilder.class,"String_Node_Str");
}

Fixed version (ground truth):
@Override public String getName(){
  return NbBundle.getMessage(IntraEdgesBuilder.class,"String_Node_Str") + "String_Node_Str" + partition.getColumn().getTitle()+ "String_Node_Str";
}
Program: 189804
Project: 189804
Buggy source:
@Override public String getName(){
  return NbBundle.getMessage(IntraEdgesBuilder.class,"String_Node_Str");
}

Fixed version (ground truth):
@Override public String getName(){
  return NbBundle.getMessage(IntraEdgesBuilder.class,"String_Node_Str") + "String_Node_Str" + partition.getColumn().getTitle()+ "String_Node_Str";
}
Program: 189805
Project: 189805
Buggy source:
public String getName(){
  return NbBundle.getMessage(PartitionBuilder.class,"String_Node_Str");
}

Fixed version (ground truth):
public String getName(){
  return NbBundle.getMessage(PartitionBuilder.class,"String_Node_Str") + "String_Node_Str" + partition.getColumn().getTitle()+ "String_Node_Str";
}
Program: 189806
Project: 189806
Buggy source:
@Override public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
  if (value == null) {
    return super.getTableCellRendererComponent(table,null,isSelected,hasFocus,row,column);
  }
  TimeInterval timeInterval=(TimeInterval)value;
  String stringRepresentation=timeInterval.toString(timeFormat == TimeFormat.DOUBLE);
  if (drawGraphics) {
    JLabel label=new JLabel();
    Color background;
    if (isSelected) {
      background=SELECTED_BACKGROUND;
    }
 else {
      background=UNSELECTED_BACKGROUND;
    }
    final BufferedImage i=timeIntervalGraphics.createTimeIntervalImage(timeInterval.getLow(),timeInterval.getHigh(),table.getColumnModel().getColumn(column).getWidth() - 1,table.getRowHeight(row) - 1,FILL_COLOR,BORDER_COLOR,background);
    label.setIcon(new ImageIcon(i));
    label.setToolTipText(stringRepresentation);
    return label;
  }
 else {
    return super.getTableCellRendererComponent(table,stringRepresentation,isSelected,hasFocus,row,column);
  }
}

Fixed version (ground truth):
@Override public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
  if (value == null) {
    return super.getTableCellRendererComponent(table,null,isSelected,hasFocus,row,column);
  }
  TimeInterval timeInterval=(TimeInterval)value;
  String stringRepresentation=timeInterval.toString(timeFormat == TimeFormat.DOUBLE);
  if (drawGraphics) {
    JLabel label=new JLabel();
    Color background;
    if (isSelected) {
      background=SELECTED_BACKGROUND;
    }
 else {
      background=UNSELECTED_BACKGROUND;
    }
    List<Interval<Double[]>> intervals=timeInterval.getIntervals();
    double starts[]=new double[intervals.size()];
    double ends[]=new double[intervals.size()];
    for (int i=0; i < intervals.size(); i++) {
      starts[i]=intervals.get(i).getLow();
      ends[i]=intervals.get(i).getHigh();
    }
    final BufferedImage i=timeIntervalGraphics.createTimeIntervalImage(starts,ends,table.getColumnModel().getColumn(column).getWidth() - 1,table.getRowHeight(row) - 1,FILL_COLOR,BORDER_COLOR,background);
    label.setIcon(new ImageIcon(i));
    label.setToolTipText(stringRepresentation);
    return label;
  }
 else {
    return super.getTableCellRendererComponent(table,stringRepresentation,isSelected,hasFocus,row,column);
  }
}
Program: 189807
Project: 189807
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);
  chart.removeLegend();
  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";
}

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);
  chart.removeLegend();
  ChartUtils.decorateChart(chart);
  ChartUtils.scaleChart(chart,dSeries,false);
  String imageFile=ChartUtils.renderChart(chart,"String_Node_Str");
  NumberFormat f=new DecimalFormat("String_Node_Str");
  if (isDirected) {
    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"+ imageFile+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  }
 else {
    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: 189808
Project: 189808
Buggy source:
public void execute(HierarchicalGraph hgraph,AttributeModel attributeModel){
  isCanceled=false;
  triangles(hgraph);
  AttributeTable nodeTable=attributeModel.getNodeTable();
  AttributeColumn clusteringCol=nodeTable.getColumn(CLUSTERING_COEFF);
  if (clusteringCol == null) {
    clusteringCol=nodeTable.addColumn(CLUSTERING_COEFF,"String_Node_Str",AttributeType.DOUBLE,AttributeOrigin.COMPUTED,new Double(0));
  }
  AttributeColumn triCount=nodeTable.getColumn("String_Node_Str");
  if (triCount == null) {
    triCount=nodeTable.addColumn("String_Node_Str","String_Node_Str",AttributeType.INT,AttributeOrigin.COMPUTED,new Integer(0));
  }
  for (int v=0; v < N; v++) {
    if (network[v].length() > 1) {
      AttributeRow row=(AttributeRow)network[v].node.getNodeData().getAttributes();
      row.setValue(clusteringCol,nodeClustering[v]);
      row.setValue(triCount,triangles[v]);
    }
  }
}

Fixed version (ground truth):
public void execute(HierarchicalGraph hgraph,AttributeModel attributeModel){
  isCanceled=false;
  if (isDirected)   bruteForce(hgraph,attributeModel);
 else   triangles(hgraph);
  AttributeTable nodeTable=attributeModel.getNodeTable();
  AttributeColumn clusteringCol=nodeTable.getColumn(CLUSTERING_COEFF);
  if (clusteringCol == null) {
    clusteringCol=nodeTable.addColumn(CLUSTERING_COEFF,"String_Node_Str",AttributeType.DOUBLE,AttributeOrigin.COMPUTED,new Double(0));
  }
  AttributeColumn triCount=null;
  if (!isDirected) {
    triCount=nodeTable.getColumn("String_Node_Str");
    if (triCount == null) {
      triCount=nodeTable.addColumn("String_Node_Str","String_Node_Str",AttributeType.INT,AttributeOrigin.COMPUTED,new Integer(0));
    }
  }
  for (int v=0; v < N; v++) {
    if (network[v].length() > 1) {
      AttributeRow row=(AttributeRow)network[v].node.getNodeData().getAttributes();
      row.setValue(clusteringCol,nodeClustering[v]);
      if (!isDirected)       row.setValue(triCount,triangles[v]);
    }
  }
}
Program: 189810
Project: 189810
Buggy source:
private void exportData(Graph graph) throws IOException {
  if (normalize) {
    calculateMinMaxForNormalization(graph);
  }
  if (exportAttributes) {
    exportNodeData(graph);
  }
  exportNodeProperties(graph);
  exportEdgeData(graph);
}

Fixed version (ground truth):
private void exportData(Graph graph) throws IOException {
  if (normalize) {
    calculateMinMaxForNormalization(graph);
  }
  if (exportAttributes) {
    exportNodeData(graph);
  }
  exportNodeProperties(graph);
  exportEdgeData(graph);
  writer.write(stringBuilder.toString());
  writer.flush();
  progressTicket.finish();
}
Program: 189811
Project: 189811
Buggy source:
private void calculateMinMaxForNormalization(Graph graph){
  minX=Double.POSITIVE_INFINITY;
  maxX=Double.NEGATIVE_INFINITY;
  minY=Double.POSITIVE_INFINITY;
  maxY=Double.NEGATIVE_INFINITY;
  minSize=Double.POSITIVE_INFINITY;
  maxSize=Double.NEGATIVE_INFINITY;
  for (NodeIterator nodeIterator=graph.getNodes().iterator(); nodeIterator.hasNext(); ) {
    Node node=nodeIterator.next();
    minX=Math.min(minX,node.getNodeData().x());
    maxX=Math.max(maxX,node.getNodeData().x());
    minY=Math.min(minY,node.getNodeData().y());
    maxY=Math.max(maxY,node.getNodeData().y());
    minSize=Math.min(minSize,node.getNodeData().r());
    maxSize=Math.max(maxSize,node.getNodeData().r());
  }
}

Fixed version (ground truth):
private void calculateMinMaxForNormalization(Graph graph){
  minX=Double.POSITIVE_INFINITY;
  maxX=Double.NEGATIVE_INFINITY;
  minY=Double.POSITIVE_INFINITY;
  maxY=Double.NEGATIVE_INFINITY;
  minSize=Double.POSITIVE_INFINITY;
  maxSize=Double.NEGATIVE_INFINITY;
  for (  Node node : graph.getNodes()) {
    minX=Math.min(minX,node.getNodeData().x());
    maxX=Math.max(maxX,node.getNodeData().x());
    minY=Math.min(minY,node.getNodeData().y());
    maxY=Math.max(maxY,node.getNodeData().y());
    minSize=Math.min(minSize,node.getNodeData().r());
    maxSize=Math.max(maxSize,node.getNodeData().r());
  }
}
Program: 189813
Project: 189813
Buggy source:
private void exportNodeData(Graph graph) throws IOException {
  writer.write("String_Node_Str");
  writer.write("String_Node_Str");
  for (int i=0; i < attributeModel.getNodeTable().getColumns().length; i++) {
    if (!attributeModel.getNodeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str") && !attributeModel.getNodeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str")) {
      writer.write("String_Node_Str" + attributeModel.getNodeTable().getColumn(i).getTitle().replace(' ','_'));
    }
  }
  writer.write("String_Node_Str");
  for (NodeIterator nodeIterator=graph.getNodes().iterator(); nodeIterator.hasNext(); ) {
    Node node=nodeIterator.next();
    writer.write(node.getNodeData().getId());
    for (int i=0; i < attributeModel.getNodeTable().getColumns().length; i++) {
      if (!attributeModel.getNodeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str") && !attributeModel.getNodeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str")) {
        if (node.getNodeData().getAttributes().getValue(i) != null) {
          writer.write("String_Node_Str" + node.getNodeData().getAttributes().getValue(i));
        }
 else {
          writer.write("String_Node_Str" + valueForEmptyAttributes);
        }
      }
    }
    writer.write("String_Node_Str");
  }
}

Fixed version (ground truth):
private void exportNodeData(Graph graph) throws IOException {
  stringBuilder.append("String_Node_Str");
  stringBuilder.append("String_Node_Str");
  for (int i=0; i < attributeModel.getNodeTable().getColumns().length; i++) {
    if (!attributeModel.getNodeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str") && !attributeModel.getNodeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str") && !attributeModel.getNodeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str")) {
      stringBuilder.append("String_Node_Str").append(attributeModel.getNodeTable().getColumn(i).getTitle().replace(' ','_').toString());
    }
  }
  stringBuilder.append("String_Node_Str");
  for (  Node node : graph.getNodes()) {
    progressTicket.progress();
    stringBuilder.append(printParameter(node.getNodeData().getId()));
    for (int i=0; i < attributeModel.getNodeTable().getColumns().length; i++) {
      if (!attributeModel.getNodeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str") && !attributeModel.getNodeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str") && !attributeModel.getNodeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str")) {
        if (node.getNodeData().getAttributes().getValue(i) != null) {
          stringBuilder.append("String_Node_Str").append(printParameter(node.getNodeData().getAttributes().getValue(i)));
        }
 else {
          stringBuilder.append("String_Node_Str").append(valueForEmptyAttributes);
        }
      }
    }
    stringBuilder.append("String_Node_Str");
  }
}
Program: 189814
Project: 189814
Buggy source:
public boolean execute(){
  attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  GraphModel graphModel=workspace.getLookup().lookup(GraphModel.class);
  Graph graph=null;
  if (exportVisible) {
    graph=graphModel.getGraphVisible();
  }
 else {
    graph=graphModel.getGraph();
  }
  graph.readLock();
  try {
    exportData(graph);
    writer.flush();
  }
 catch (  Exception e) {
    graph.readUnlockAll();
    throw new RuntimeException(e);
  }
  graph.readUnlockAll();
  return !cancel;
}

Fixed version (ground truth):
public boolean execute(){
  attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  GraphModel graphModel=workspace.getLookup().lookup(GraphModel.class);
  Graph graph=null;
  if (exportVisible) {
    graph=graphModel.getGraphVisible();
  }
 else {
    graph=graphModel.getGraph();
  }
  dynamicModel=workspace.getLookup().lookup(DynamicModel.class);
  visibleInterval=dynamicModel != null && exportVisible ? dynamicModel.getVisibleInterval() : new TimeInterval();
  graph.readLock();
  progressTicket.start(graph.getNodeCount() * 2 + graph.getEdgeCount());
  stringBuilder=new StringBuilder();
  try {
    exportData(graph);
  }
 catch (  Exception e) {
    graph.readUnlockAll();
    throw new RuntimeException(e);
  }
  graph.readUnlockAll();
  return !cancel;
}
Program: 189815
Project: 189815
Buggy source:
private String printParameter(Object s){
  Object val=DynamicUtilities.getDynamicValue(s,visibleInterval.getLow(),visibleInterval.getHigh());
  if (val == null) {
    return valueForEmptyAttributes;
  }
  String res=val.toString().replace('\n',' ').replace('\"',' ');
  System.err.println(visibleInterval.getLow() + "String_Node_Str" + visibleInterval.getHigh());
  System.err.println(s.getClass().toString() + "String_Node_Str" + (s instanceof DynamicType)+ "String_Node_Str"+ res);
  System.err.println(s.toString() + "String_Node_Str" + val.toString()+ "String_Node_Str");
  if (res.contains("String_Node_Str")) {
    return "String_Node_Str" + res + "String_Node_Str";
  }
 else {
    return res;
  }
}

Fixed version (ground truth):
private String printParameter(Object s){
  Object val=DynamicUtilities.getDynamicValue(s,visibleInterval.getLow(),visibleInterval.getHigh());
  if (val == null) {
    return valueForEmptyAttributes;
  }
  String res=val.toString().replaceAll("String_Node_Str","String_Node_Str").replace('\"',' ');
  if (res.contains("String_Node_Str")) {
    return "String_Node_Str" + res + "String_Node_Str";
  }
 else {
    return res;
  }
}
Program: 189816
Project: 189816
Buggy source:
private void exportEdgeData(Graph graph) throws IOException {
  stringBuilder.append("String_Node_Str");
  stringBuilder.append("String_Node_Str");
  if (exportEdgeWeight) {
    stringBuilder.append("String_Node_Str");
  }
  if (exportAttributes) {
    for (int i=0; i < attributeModel.getEdgeTable().getColumns().length; i++) {
      if (!attributeModel.getEdgeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str") && !attributeModel.getEdgeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str") && !attributeModel.getEdgeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str")&& !attributeModel.getEdgeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str")) {
        stringBuilder.append("String_Node_Str").append(printParameter(attributeModel.getEdgeTable().getColumn(i).getTitle()).replace(' ','_'));
      }
    }
  }
  stringBuilder.append("String_Node_Str");
  for (  Edge edge : graph.getEdges()) {
    progressTicket.progress();
    stringBuilder.append(printParameter(edge.getSource().getNodeData().getId()));
    stringBuilder.append("String_Node_Str").append(printParameter(edge.getTarget().getNodeData().getId()));
    if (exportEdgeWeight) {
      stringBuilder.append("String_Node_Str").append(edge.getWeight());
    }
    if (exportAttributes) {
      for (int i=0; i < attributeModel.getEdgeTable().getColumns().length; i++) {
        if (!attributeModel.getEdgeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str") && !attributeModel.getEdgeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str") && !attributeModel.getEdgeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str")&& !attributeModel.getEdgeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str")) {
          if (edge.getEdgeData().getAttributes().getValue(i) != null) {
            stringBuilder.append("String_Node_Str").append(printParameter(edge.getEdgeData().getAttributes().getValue(i)));
          }
 else {
            stringBuilder.append("String_Node_Str" + valueForEmptyAttributes);
          }
        }
      }
    }
    stringBuilder.append("String_Node_Str");
  }
}

Fixed version (ground truth):
private void exportEdgeData(Graph graph) throws IOException {
  stringBuilder.append("String_Node_Str");
  stringBuilder.append("String_Node_Str");
  if (exportEdgeWeight) {
    stringBuilder.append("String_Node_Str");
  }
  if (exportAttributes) {
    for (int i=0; i < attributeModel.getEdgeTable().getColumns().length; i++) {
      if (Arrays.binarySearch(standartEdgeAttributes,attributeModel.getEdgeTable().getColumn(i).getTitle()) < 0) {
        stringBuilder.append("String_Node_Str").append(printParameter(attributeModel.getEdgeTable().getColumn(i).getTitle()).replace(' ','_'));
      }
    }
  }
  stringBuilder.append("String_Node_Str");
  for (  Edge edge : graph.getEdges()) {
    if (cancel) {
      break;
    }
    progressTicket.progress();
    printEdgeData(edge,edge.getSource(),edge.getTarget());
    if (!edge.isDirected() && !edge.isSelfLoop())     printEdgeData(edge,edge.getTarget(),edge.getSource());
  }
}
Program: 189817
Project: 189817
Buggy source:
private void exportData(Graph graph) throws IOException {
  if (normalize) {
    calculateMinMaxForNormalization(graph);
  }
  if (exportAttributes) {
    exportNodeData(graph);
  }
  exportNodeProperties(graph);
  exportEdgeData(graph);
  writer.write(stringBuilder.toString());
  writer.flush();
  progressTicket.finish();
}

Fixed version (ground truth):
private void exportData(Graph graph) throws IOException {
  if (normalize) {
    calculateMinMaxForNormalization(graph);
  }
  if (exportAttributes && atLeastOneNonStandartAttribute()) {
    exportNodeData(graph);
  }
  exportNodeProperties(graph);
  exportEdgeData(graph);
  writer.write(stringBuilder.toString());
  writer.flush();
  progressTicket.finish();
}
Program: 189818
Project: 189818
Buggy source:
private void calculateMinMaxForNormalization(Graph graph){
  minX=Double.POSITIVE_INFINITY;
  maxX=Double.NEGATIVE_INFINITY;
  minY=Double.POSITIVE_INFINITY;
  maxY=Double.NEGATIVE_INFINITY;
  minSize=Double.POSITIVE_INFINITY;
  maxSize=Double.NEGATIVE_INFINITY;
  for (  Node node : graph.getNodes()) {
    minX=Math.min(minX,node.getNodeData().x());
    maxX=Math.max(maxX,node.getNodeData().x());
    minY=Math.min(minY,node.getNodeData().y());
    maxY=Math.max(maxY,node.getNodeData().y());
    minSize=Math.min(minSize,node.getNodeData().r());
    maxSize=Math.max(maxSize,node.getNodeData().r());
  }
}

Fixed version (ground truth):
private void calculateMinMaxForNormalization(Graph graph){
  minX=Double.POSITIVE_INFINITY;
  maxX=Double.NEGATIVE_INFINITY;
  minY=Double.POSITIVE_INFINITY;
  maxY=Double.NEGATIVE_INFINITY;
  minSize=Double.POSITIVE_INFINITY;
  maxSize=Double.NEGATIVE_INFINITY;
  for (  Node node : graph.getNodes()) {
    if (cancel) {
      break;
    }
    minX=Math.min(minX,node.getNodeData().x());
    maxX=Math.max(maxX,node.getNodeData().x());
    minY=Math.min(minY,node.getNodeData().y());
    maxY=Math.max(maxY,node.getNodeData().y());
    minSize=Math.min(minSize,node.getNodeData().r());
    maxSize=Math.max(maxSize,node.getNodeData().r());
  }
}
Program: 189820
Project: 189820
Buggy source:
private void exportNodeData(Graph graph) throws IOException {
  stringBuilder.append("String_Node_Str");
  stringBuilder.append("String_Node_Str");
  for (int i=0; i < attributeModel.getNodeTable().getColumns().length; i++) {
    if (!attributeModel.getNodeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str") && !attributeModel.getNodeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str") && !attributeModel.getNodeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str")) {
      stringBuilder.append("String_Node_Str").append(attributeModel.getNodeTable().getColumn(i).getTitle().replace(' ','_').toString());
    }
  }
  stringBuilder.append("String_Node_Str");
  for (  Node node : graph.getNodes()) {
    progressTicket.progress();
    stringBuilder.append(printParameter(node.getNodeData().getId()));
    for (int i=0; i < attributeModel.getNodeTable().getColumns().length; i++) {
      if (!attributeModel.getNodeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str") && !attributeModel.getNodeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str") && !attributeModel.getNodeTable().getColumns()[i].getTitle().equalsIgnoreCase("String_Node_Str")) {
        if (node.getNodeData().getAttributes().getValue(i) != null) {
          stringBuilder.append("String_Node_Str").append(printParameter(node.getNodeData().getAttributes().getValue(i)));
        }
 else {
          stringBuilder.append("String_Node_Str").append(valueForEmptyAttributes);
        }
      }
    }
    stringBuilder.append("String_Node_Str");
  }
}

Fixed version (ground truth):
private void exportNodeData(Graph graph) throws IOException {
  stringBuilder.append("String_Node_Str");
  stringBuilder.append("String_Node_Str");
  for (int i=0; i < attributeModel.getNodeTable().getColumns().length; i++) {
    if (Arrays.binarySearch(standartNodeAttributes,attributeModel.getNodeTable().getColumn(i).getTitle()) < 0) {
      stringBuilder.append("String_Node_Str").append(attributeModel.getNodeTable().getColumn(i).getTitle().replace(' ','_').toString());
    }
  }
  stringBuilder.append("String_Node_Str");
  for (  Node node : graph.getNodes()) {
    progressTicket.progress();
    if (cancel) {
      break;
    }
    stringBuilder.append(printParameter(node.getNodeData().getId()));
    for (int i=0; i < attributeModel.getNodeTable().getColumns().length; i++) {
      if (Arrays.binarySearch(standartNodeAttributes,attributeModel.getNodeTable().getColumn(i).getTitle()) < 0) {
        if (node.getNodeData().getAttributes().getValue(i) != null) {
          stringBuilder.append("String_Node_Str").append(printParameter(node.getNodeData().getAttributes().getValue(i)));
        }
 else {
          stringBuilder.append("String_Node_Str").append(valueForEmptyAttributes);
        }
      }
    }
    stringBuilder.append("String_Node_Str");
  }
}
Program: 189821
Project: 189821
Buggy source:
public boolean execute(){
  attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  GraphModel graphModel=workspace.getLookup().lookup(GraphModel.class);
  Graph graph=null;
  if (exportVisible) {
    graph=graphModel.getGraphVisible();
  }
 else {
    graph=graphModel.getGraph();
  }
  dynamicModel=workspace.getLookup().lookup(DynamicModel.class);
  visibleInterval=dynamicModel != null && exportVisible ? dynamicModel.getVisibleInterval() : new TimeInterval();
  graph.readLock();
  progressTicket.start(graph.getNodeCount() * 2 + graph.getEdgeCount());
  stringBuilder=new StringBuilder();
  try {
    exportData(graph);
  }
 catch (  Exception e) {
    graph.readUnlockAll();
    throw new RuntimeException(e);
  }
  graph.readUnlockAll();
  return !cancel;
}

Fixed version (ground truth):
public boolean execute(){
  attributeModel=workspace.getLookup().lookup(AttributeModel.class);
  GraphModel graphModel=workspace.getLookup().lookup(GraphModel.class);
  Graph graph;
  if (exportVisible) {
    graph=graphModel.getGraphVisible();
  }
 else {
    graph=graphModel.getGraph();
  }
  dynamicModel=workspace.getLookup().lookup(DynamicModel.class);
  visibleInterval=dynamicModel != null && exportVisible ? dynamicModel.getVisibleInterval() : new TimeInterval();
  graph.readLock();
  progressTicket.start(graph.getNodeCount() * 2 + graph.getEdgeCount());
  stringBuilder=new StringBuilder();
  try {
    exportData(graph);
  }
 catch (  Exception e) {
    graph.readUnlockAll();
    throw new RuntimeException(e);
  }
  graph.readUnlockAll();
  return !cancel;
}
Program: 189822
Project: 189822
Buggy source:
private void computeNormalizeValues(DirectedGraph graph){
  minX=Double.MAX_VALUE;
  minY=Double.MAX_VALUE;
  minZ=Double.MAX_VALUE;
  maxX=Double.MIN_VALUE;
  maxY=Double.MIN_VALUE;
  maxZ=Double.MIN_VALUE;
  minSize=Double.MAX_VALUE;
  maxSize=Double.MIN_VALUE;
  for (  Node node : graph.getNodes()) {
    if (cancel) {
      break;
    }
    minX=Math.min(minX,node.getNodeData().x());
    minY=Math.min(minY,node.getNodeData().y());
    minZ=Math.min(minZ,node.getNodeData().z());
    maxX=Math.max(maxX,node.getNodeData().x());
    maxY=Math.max(maxY,node.getNodeData().y());
    maxZ=Math.max(maxZ,node.getNodeData().z());
    minSize=Math.min(minSize,node.getNodeData().getSize());
    maxSize=Math.max(maxSize,node.getNodeData().getSize());
  }
}

Fixed version (ground truth):
private void computeNormalizeValues(Graph graph){
  minX=Double.MAX_VALUE;
  minY=Double.MAX_VALUE;
  minZ=Double.MAX_VALUE;
  maxX=Double.MIN_VALUE;
  maxY=Double.MIN_VALUE;
  maxZ=Double.MIN_VALUE;
  minSize=Double.MAX_VALUE;
  maxSize=Double.MIN_VALUE;
  for (  Node node : graph.getNodes()) {
    if (cancel) {
      break;
    }
    minX=Math.min(minX,node.getNodeData().x());
    minY=Math.min(minY,node.getNodeData().y());
    minZ=Math.min(minZ,node.getNodeData().z());
    maxX=Math.max(maxX,node.getNodeData().x());
    maxY=Math.max(maxY,node.getNodeData().y());
    maxZ=Math.max(maxZ,node.getNodeData().z());
    minSize=Math.min(minSize,node.getNodeData().getSize());
    maxSize=Math.max(maxSize,node.getNodeData().getSize());
  }
}
Program: 189823
Project: 189823
Buggy source:
void exportData(DirectedGraph graph) throws IOException {
  printOpen("String_Node_Str");
  printTag("String_Node_Str");
  for (  Node node : graph.getNodes()) {
    if (cancel) {
      break;
    }
    printNode(node);
  }
  for (  Edge edge : graph.getEdges()) {
    if (cancel) {
      break;
    }
    printEdge(edge);
  }
  printClose();
}

Fixed version (ground truth):
void exportData(Graph graph) throws IOException {
  printOpen("String_Node_Str");
  printTag("String_Node_Str");
  if (graph.getGraphModel().isDirected()) {
    printTag("String_Node_Str");
  }
 else   if (graph.getGraphModel().isUndirected()) {
    printTag("String_Node_Str");
  }
  for (  Node node : graph.getNodes()) {
    if (cancel) {
      break;
    }
    printNode(node);
  }
  for (  Edge edge : graph.getEdges()) {
    if (cancel) {
      break;
    }
    printEdge(edge,graph.getGraphModel().isMixed());
  }
  printClose();
}
Program: 189824
Project: 189824
Buggy source:
private void printEdge(Edge edge) throws IOException {
  printOpen("String_Node_Str");
  printTag("String_Node_Str" + edge.getId());
  printTag("String_Node_Str" + edge.getSource().getId());
  printTag("String_Node_Str" + edge.getTarget().getId());
  if (exportLabel && edge.getEdgeData().getLabel() != null) {
    printTag("String_Node_Str" + edge.getEdgeData().getLabel() + "String_Node_Str");
  }
  if (exportEdgeSize) {
    printTag("String_Node_Str" + edge.getWeight());
  }
  if (exportNotRecognizedElements) {
    for (int i=0; i < edge.getAttributes().countValues(); i++) {
      String s=attributeModel.getEdgeTable().getColumn(i).getTitle();
      if (edge.getAttributes().getValue(i) != null && !s.equals("String_Node_Str") && !s.equals("String_Node_Str")) {
        printTag(formatString(s) + "String_Node_Str" + edge.getAttributes().getValue(i)+ "String_Node_Str");
      }
    }
  }
  printClose();
  progressTicket.progress();
}

Fixed version (ground truth):
private void printEdge(Edge edge,boolean graphMixed) throws IOException {
  printOpen("String_Node_Str");
  printTag("String_Node_Str" + edge.getEdgeData().getId() + "String_Node_Str");
  printTag("String_Node_Str" + edge.getSource().getNodeData().getId() + "String_Node_Str");
  printTag("String_Node_Str" + edge.getTarget().getNodeData().getId() + "String_Node_Str");
  if (exportLabel && edge.getEdgeData().getLabel() != null) {
    printTag("String_Node_Str" + edge.getEdgeData().getLabel() + "String_Node_Str");
  }
  if (exportEdgeSize) {
    printTag("String_Node_Str" + edge.getWeight());
  }
  if (graphMixed) {
    if (edge.isDirected()) {
      printTag("String_Node_Str");
    }
 else     if (!edge.isDirected()) {
      printTag("String_Node_Str");
    }
  }
  if (exportNotRecognizedElements) {
    for (int i=0; i < edge.getAttributes().countValues(); i++) {
      String s=attributeModel.getEdgeTable().getColumn(i).getTitle();
      if (edge.getAttributes().getValue(i) != null && !s.equals("String_Node_Str") && !s.equals("String_Node_Str") && !s.equals("String_Node_Str") && DynamicUtilities.getDynamicValue(edge.getAttributes().getValue(i),visibleInterval.getLow(),visibleInterval.getHigh()) != null) {
        printTag(formatTitle(s) + "String_Node_Str" + formatValue(edge.getAttributes().getValue(i))+ "String_Node_Str");
      }
    }
  }
  printClose();
  progressTicket.progress();
}