nus-yam/ex-repair huggingface dataset:
Program: 95804
Project: 95804
Buggy source:
public void testTruncateInTheMiddle(Log log) throws Exception {
  this.log=log;
  log.init(filename,null);
  byte[] buf=new byte[10];
  log.append(1,false,new LogEntry(1,buf));
  log.append(2,false,new LogEntry(1,buf));
  log.append(3,false,new LogEntry(1,buf));
  log.append(4,false,new LogEntry(2,buf));
  log.append(5,false,new LogEntry(2,buf));
  log.append(6,false,new LogEntry(2,buf));
  log.append(7,false,new LogEntry(3,buf));
  log.append(8,false,new LogEntry(3,buf));
  log.append(9,false,new LogEntry(3,buf));
  log.append(10,false,new LogEntry(3,buf));
  log.append(11,false,new LogEntry(3,buf));
  log.commitIndex(11);
  log.truncate(6);
  assertEquals(log.lastApplied(),11);
  assertEquals(log.currentTerm(),3);
  assertEquals(log.firstApplied(),6);
}

Fixed version (ground truth):
public void testTruncateInTheMiddle(Log log) throws Exception {
  this.log=log;
  log.init(filename,null);
  byte[] buf=new byte[10];
  log.append(1,false,new LogEntry(1,buf));
  log.append(2,false,new LogEntry(1,buf));
  log.append(3,false,new LogEntry(1,buf));
  log.append(4,false,new LogEntry(2,buf));
  log.append(5,false,new LogEntry(2,buf));
  log.append(6,false,new LogEntry(2,buf));
  log.append(7,false,new LogEntry(3,buf));
  log.append(8,false,new LogEntry(3,buf));
  log.append(9,false,new LogEntry(3,buf));
  log.append(10,false,new LogEntry(3,buf));
  log.append(11,false,new LogEntry(3,buf));
  log.commitIndex(11);
  log.truncate(6);
  assertEquals(log.lastApplied(),11);
  assertEquals(log.currentTerm(),3);
  assertEquals(log.firstApplied(),6);
  for (int i=1; i <= 5; i++)   assertNull(log.get(i));
}
Program: 95805
Project: 95805
Buggy source:
@Override public void init(String log_name,Map<String,String> args) throws Exception {
  Logger debugLogger=new Logger(){
    public void log(    String message){
      System.out.println(message);
    }
  }
;
  Options options=new Options();
  options.createIfMissing(true);
  options.logger(debugLogger);
  this.dbFileName=new File(log_name);
  try {
    db=factory.open(dbFileName,options);
    try (DBIterator iterator=db.iterator()){
      iterator.seekToFirst();
      if (!iterator.hasNext()) {
        WriteBatch batch=db.createWriteBatch();
        try {
          batch.put(LASTAPPLIED,fromIntToByteArray(0));
          batch.put(CURRENTTERM,fromIntToByteArray(0));
          batch.put(COMMITINDEX,fromIntToByteArray(0));
          db.write(batch);
        }
 catch (        Exception ex) {
          ex.printStackTrace();
        }
 finally {
          try {
            batch.close();
          }
 catch (          IOException e) {
            e.printStackTrace();
          }
        }
      }
    }
   }
 catch (  IOException e) {
    e.printStackTrace();
  }
  initCommitAndTermFromLog();
}

Fixed version (ground truth):
@Override public void init(String log_name,Map<String,String> args) throws Exception {
  Logger debugLogger=new Logger(){
    public void log(    String message){
      System.out.println(message);
    }
  }
;
  Options options=new Options();
  options.createIfMissing(true);
  this.dbFileName=new File(log_name);
  db=factory.open(dbFileName,options);
  WriteBatch batch=db.createWriteBatch();
  try {
    batch.put(FIRSTAPPLIED,fromIntToByteArray(-1));
    batch.put(LASTAPPLIED,fromIntToByteArray(0));
    batch.put(CURRENTTERM,fromIntToByteArray(0));
    batch.put(COMMITINDEX,fromIntToByteArray(0));
    db.write(batch);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
 finally {
    try {
      batch.close();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
  initCommitAndTermFromLog();
}
Program: 95806
Project: 95806
Buggy source:
@Override public void forEach(Function function){
  this.forEach(function,1,Integer.MAX_VALUE);
}

Fixed version (ground truth):
@Override public void forEach(Function function){
  if (firstApplied == -1) {
    return;
  }
  this.forEach(function,firstApplied,lastApplied);
}
Program: 95807
Project: 95807
Buggy source:
private void initCommitAndTermFromLog() throws Exception {
  currentTerm=fromByteArrayToInt(db.get(CURRENTTERM));
  commitIndex=fromByteArrayToInt(db.get(COMMITINDEX));
  lastApplied=fromByteArrayToInt(db.get(LASTAPPLIED));
}

Fixed version (ground truth):
private void initCommitAndTermFromLog() throws Exception {
  firstApplied=fromByteArrayToInt(db.get(FIRSTAPPLIED));
  lastApplied=fromByteArrayToInt(db.get(LASTAPPLIED));
  currentTerm=fromByteArrayToInt(db.get(CURRENTTERM));
  commitIndex=fromByteArrayToInt(db.get(COMMITINDEX));
}
Program: 95808
Project: 95808
Buggy source:
@Override public int first(){
  DBIterator iterator=db.iterator();
  try {
    iterator.seek(VOTEDFOR);
    byte[] keyBytes=iterator.peekNext().getKey();
    return new Integer(asString(keyBytes));
  }
  finally {
    try {
      iterator.close();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
@Override public int first(){
  if (firstApplied == -1) {
    return firstApplied;
  }
  DBIterator iterator=db.iterator();
  try {
    iterator.seek(FIRSTAPPLIED);
    byte[] keyBytes=iterator.peekNext().getValue();
    return fromByteArrayToInt(keyBytes);
  }
  finally {
    try {
      iterator.close();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
}
Program: 95809
Project: 95809
Buggy source:
private void append(LogEntry[] entries){
  WriteBatch batch=db.createWriteBatch();
  for (  LogEntry entry : entries) {
    try {
      byte[] lastAppliedBytes=fromIntToByteArray(lastApplied);
      batch.put(lastAppliedBytes,Util.streamableToByteBuffer(entry));
      currentTerm=entry.term;
      batch.put(LASTAPPLIED,lastAppliedBytes);
      batch.put(CURRENTTERM,fromIntToByteArray(currentTerm));
      lastApplied++;
      db.write(batch);
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
 finally {
      try {
        batch.close();
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
private void append(LogEntry[] entries){
  WriteBatch batch=db.createWriteBatch();
  for (  LogEntry entry : entries) {
    try {
      lastApplied++;
      if (firstApplied == -1) {
        firstApplied=lastApplied;
        batch.put(FIRSTAPPLIED,fromIntToByteArray(firstApplied));
      }
      byte[] lastAppliedBytes=fromIntToByteArray(lastApplied);
      batch.put(lastAppliedBytes,Util.streamableToByteBuffer(entry));
      currentTerm=entry.term;
      batch.put(LASTAPPLIED,lastAppliedBytes);
      batch.put(CURRENTTERM,fromIntToByteArray(currentTerm));
      db.write(batch);
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
 finally {
      try {
        batch.close();
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
}
Program: 95810
Project: 95810
Buggy source:
public void testFields(Log log) throws Exception {
  Address addr=Util.createRandomAddress("String_Node_Str");
  this.log=log;
  log.init(filename,null);
  log.currentTerm(22);
  int current_term=log.currentTerm();
  assertEquals(current_term,22);
  log.votedFor(addr);
  Address voted_for=log.votedFor();
  assertEquals(addr,voted_for);
  log.close();
  log.init(filename,null);
  current_term=log.currentTerm();
  assertEquals(current_term,22);
  voted_for=log.votedFor();
  assertEquals(addr,voted_for);
  log.delete();
  log.close();
  log.init(filename,null);
  current_term=log.currentTerm();
  assertEquals(current_term,0);
  voted_for=log.votedFor();
  assertNull(voted_for);
}

Fixed version (ground truth):
public void testFields(Log log) throws Exception {
  Address addr=Util.createRandomAddress("String_Node_Str");
  this.log=log;
  log.init(filename,null);
  log.currentTerm(22);
  int current_term=log.currentTerm();
  assertEquals(current_term,22);
  log.votedFor(addr);
  Address voted_for=log.votedFor();
  assertEquals(addr,voted_for);
  log.close();
  log.init(filename,null);
  current_term=log.currentTerm();
  assertEquals(current_term,22);
  voted_for=log.votedFor();
  assertEquals(addr,voted_for);
  log.close();
  log.delete();
  log.init(filename,null);
  current_term=log.currentTerm();
  assertEquals(current_term,0);
  voted_for=log.votedFor();
  assertNull(voted_for);
}
Program: 95811
Project: 95811
Buggy source:
public void testAppendOnLeader(Log log) throws Exception {
  this.log=log;
  log.init(filename,null);
  byte[] buf=new byte[10];
  log.append(1,false,new LogEntry(5,buf));
  log.append(2,false,new LogEntry(5,buf));
  assertEquals(log.lastApplied(),2);
  assertEquals(log.commitIndex(),0);
}

Fixed version (ground truth):
public void testAppendOnLeader(Log log) throws Exception {
  this.log=log;
  log.init(filename,null);
  byte[] buf=new byte[10];
  log.append(1,false,new LogEntry(5,buf));
  log.append(2,false,new LogEntry(5,buf));
  assertEquals(log.lastApplied(),2);
  assertEquals(log.commitIndex(),0);
  assertEquals(log.first(),1);
}
Program: 95812
Project: 95812
Buggy source:
/** 
 * Creates a collection layout from the given datasets indexed by label.
 * @param graphHeads Mapping from label to graph head dataset
 * @param vertices Mapping from label to vertex dataset
 * @param edges Mapping from label to edge dataset
 * @return GVE layout
 */
GVELayout create(Map<String,DataSet<GraphHead>> graphHeads,Map<String,DataSet<Vertex>> vertices,Map<String,DataSet<Edge>> edges){
  Objects.requireNonNull(graphHeads);
  Objects.requireNonNull(vertices);
  Objects.requireNonNull(edges);
  return new GVELayout(graphHeads.values().stream().reduce(DataSet::union).orElseThrow(() -> new RuntimeException("String_Node_Str")),vertices.values().stream().reduce(DataSet::union).orElseThrow(() -> new RuntimeException("String_Node_Str")),edges.values().stream().reduce(DataSet::union).orElseThrow(() -> new RuntimeException("String_Node_Str")));
}

Fixed version (ground truth):
/** 
 * Creates a collection layout from the given datasets indexed by label.
 * @param graphHeads Mapping from label to graph head dataset
 * @param vertices Mapping from label to vertex dataset
 * @param edges Mapping from label to edge dataset
 * @return GVE layout
 */
GVELayout create(Map<String,DataSet<GraphHead>> graphHeads,Map<String,DataSet<Vertex>> vertices,Map<String,DataSet<Edge>> edges){
  Objects.requireNonNull(graphHeads);
  Objects.requireNonNull(vertices);
  Objects.requireNonNull(edges);
  return new GVELayout(graphHeads.values().stream().reduce(DataSet::union).orElseThrow(() -> new RuntimeException("String_Node_Str")),vertices.values().stream().reduce(DataSet::union).orElseThrow(() -> new RuntimeException("String_Node_Str")),edges.values().stream().reduce(createEdgeDataSet(Collections.EMPTY_LIST),DataSet::union));
}
Program: 95816
Project: 95816
Buggy source:
/** 
 * returns the maximum of two types
 * @param aType first type
 * @param bType second type
 * @return larger compatible type
 */
private static int maxType(int aType,int bType){
  int maxType=Math.max(aType,bType);
  if (maxType != BIG_DECIMAL && aType % 2 != bType % 2 && maxType % 2 == 0) {
    maxType++;
  }
  return maxType;
}

Fixed version (ground truth):
/** 
 * Returns the maximum of two types, at least Integer.
 * @param aType first type
 * @param bType second type
 * @return larger compatible type
 */
private static int maxType(int aType,int bType){
  return Math.max(Math.max(aType,bType),INT);
}
Program: 95817
Project: 95817
Buggy source:
@Test public void testReduceCollection() throws Exception {
  FlinkAsciiGraphLoader loader=getLoaderFromString("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  checkExpectationsEqualResults(loader,new ReduceOverlap());
}

Fixed version (ground truth):
@Test public void testReduceCollection() throws Exception {
  FlinkAsciiGraphLoader loader=getLoaderFromString("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  checkExpectationsEqualResults(loader,new ReduceOverlap());
}
Program: 95818
Project: 95818
Buggy source:
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (!(o instanceof GradoopIdList)) {
    return false;
  }
  GradoopIdList that=(GradoopIdList)o;
  return this.size() == that.size() && this.containsAll(that);
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  boolean equal=this == o;
  if (!equal && o instanceof GradoopIdList) {
    GradoopIdList that=(GradoopIdList)o;
    equal=this.size() == that.size();
    if (equal) {
      equal=Objects.deepEquals(this.bytes,that.bytes);
    }
  }
  return equal;
}
Program: 95819
Project: 95819
Buggy source:
/** 
 * Checks if two given EPGM graph elements are equal by considering the graphs they are contained in.
 * @param element1 first element
 * @param element2 second element
 */
public static void validateEPGMGraphElements(EPGMGraphElement element1,EPGMGraphElement element2){
  assertNotNull("String_Node_Str",element1);
  assertNotNull("String_Node_Str",element2);
  assertTrue(String.format("String_Node_Str",element1.getGraphIds(),element2.getGraphIds()),element1.getGraphIds().equals(element2.getGraphIds()));
}

Fixed version (ground truth):
/** 
 * Checks if two given EPGM graph elements are equal by considering the graphs they are contained in.
 * @param element1 first element
 * @param element2 second element
 */
public static void validateEPGMGraphElements(EPGMGraphElement element1,EPGMGraphElement element2){
  assertNotNull("String_Node_Str",element1);
  assertNotNull("String_Node_Str",element2);
  assertTrue(String.format("String_Node_Str",element1.getGraphIds(),element2.getGraphIds()),element1.getGraphIds().containsAll(element2.getGraphIds()) && element2.getGraphIds().containsAll(element1.getGraphIds()));
}
Program: 95820
Project: 95820
Buggy source:
@Test public void testEquals(){
  int idCount=100;
  List<GradoopId> ids=new ArrayList<>(idCount);
  for (int i=0; i < idCount; i++) {
    ids.add(GradoopId.get());
  }
  GradoopIdList set1=GradoopIdList.fromExisting(ids.toArray(new GradoopId[idCount]));
  GradoopIdList set2=GradoopIdList.fromExisting(ids.toArray(new GradoopId[idCount]));
  Collections.shuffle(ids);
  GradoopIdList set3=GradoopIdList.fromExisting(ids.toArray(new GradoopId[idCount]));
  assertTrue("String_Node_Str",set1.equals(set1));
  assertTrue("String_Node_Str",set1.equals(set2));
  assertTrue("String_Node_Str",set1.equals(set3));
  assertTrue("String_Node_Str",set1.hashCode() == set1.hashCode());
  assertTrue("String_Node_Str",set1.hashCode() == set2.hashCode());
  assertTrue("String_Node_Str",set1.hashCode() == set3.hashCode());
}

Fixed version (ground truth):
@Test public void testEquals(){
  GradoopId a=GradoopId.get();
  GradoopId b=GradoopId.get();
  GradoopId c=GradoopId.get();
  GradoopIdList abc=GradoopIdList.fromExisting(a,b,c);
  assertTrue("String_Node_Str",abc.equals(abc));
  assertTrue("String_Node_Str",abc.hashCode() == abc.hashCode());
  GradoopIdList abc2=GradoopIdList.fromExisting(a,b,c);
  assertTrue("String_Node_Str",abc.equals(abc2));
  assertTrue("String_Node_Str",abc.hashCode() == abc2.hashCode());
  GradoopIdList cba=GradoopIdList.fromExisting(c,b,a);
  assertTrue("String_Node_Str",!abc.equals(cba));
  assertTrue("String_Node_Str",abc.hashCode() == cba.hashCode());
  GradoopIdList aab=GradoopIdList.fromExisting(a,a,b);
  GradoopIdList abb=GradoopIdList.fromExisting(a,b,b);
  assertTrue("String_Node_Str",!aab.equals(abb));
  assertTrue("String_Node_Str",aab.hashCode() != abb.hashCode());
  GradoopIdList ab=GradoopIdList.fromExisting(a,b);
  assertTrue("String_Node_Str",!aab.equals(ab));
  assertTrue("String_Node_Str",aab.hashCode() != ab.hashCode());
  GradoopIdList empty=new GradoopIdList();
  assertTrue("String_Node_Str",!abc.equals(empty));
  assertTrue("String_Node_Str",abc.hashCode() != empty.hashCode());
  GradoopIdList empty2=new GradoopIdList();
  assertTrue("String_Node_Str",empty2.equals(empty));
  assertTrue("String_Node_Str",empty2.hashCode() == empty.hashCode());
}
Program: 95821
Project: 95821
Buggy source:
/** 
 * Checks if two given EPGM graph elements are equal by considering the graphs they are contained in.
 * @param element1 first element
 * @param element2 second element
 */
public static void validateEPGMGraphElements(EPGMGraphElement element1,EPGMGraphElement element2){
  assertNotNull("String_Node_Str",element1);
  assertNotNull("String_Node_Str",element2);
  assertTrue(String.format("String_Node_Str",element1.getGraphIds(),element2.getGraphIds()),element1.getGraphIds().equals(element2.getGraphIds()));
}

Fixed version (ground truth):
/** 
 * Checks if two given EPGM graph elements are equal by considering the graphs they are contained in.
 * @param element1 first element
 * @param element2 second element
 */
public static void validateEPGMGraphElements(EPGMGraphElement element1,EPGMGraphElement element2){
  assertNotNull("String_Node_Str",element1);
  assertNotNull("String_Node_Str",element2);
  assertTrue(String.format("String_Node_Str",element1.getGraphIds(),element2.getGraphIds()),element1.getGraphIds().containsAll(element2.getGraphIds()) && element2.getGraphIds().containsAll(element1.getGraphIds()));
}
Program: 95823
Project: 95823
Buggy source:
@Parameterized.Parameters(name="String_Node_Str") public static Iterable data(){
  return Arrays.asList(new String[]{"String_Node_Str",BasicPatternsData.FSM_SINGLE_EDGE,"String_Node_Str","String_Node_Str"},new String[]{"String_Node_Str",BasicPatternsData.FSM_SIMPLE_GRAPH,"String_Node_Str","String_Node_Str"},new String[]{"String_Node_Str",BasicPatternsData.FSM_PARALLEL_EDGES,"String_Node_Str","String_Node_Str"},new String[]{"String_Node_Str",BasicPatternsData.FSM_LOOP,"String_Node_Str","String_Node_Str"},new String[]{"String_Node_Str",BasicPatternsData.FSM_DIAMOND,"String_Node_Str","String_Node_Str"},new String[]{"String_Node_Str",BasicPatternsData.FSM_CIRCLE_WITH_BRANCH,"String_Node_Str","String_Node_Str"});
}

Fixed version (ground truth):
@Parameterized.Parameters(name="String_Node_Str") public static Iterable data(){
  return Arrays.asList(new String[]{"String_Node_Str",BasicPatternsData.FSM_SINGLE_EDGE,"String_Node_Str","String_Node_Str"},new String[]{"String_Node_Str",BasicPatternsData.FSM_SIMPLE_GRAPH,"String_Node_Str","String_Node_Str"},new String[]{"String_Node_Str",BasicPatternsData.FSM_PARALLEL_EDGES,"String_Node_Str","String_Node_Str"},new String[]{"String_Node_Str",BasicPatternsData.FSM_LOOP,"String_Node_Str","String_Node_Str"},new String[]{"String_Node_Str",BasicPatternsData.FSM_DIAMOND,"String_Node_Str","String_Node_Str"},new String[]{"String_Node_Str",BasicPatternsData.FSM_CIRCLE_WITH_BRANCH,"String_Node_Str","String_Node_Str"},new String[]{"String_Node_Str",BasicPatternsData.MULTI_LABELED_CIRCLE,"String_Node_Str","String_Node_Str"});
}
Program: 95824
Project: 95824
Buggy source:
/** 
 * Creates the gSpan mining representation of a graph transaction from a give list of adjacency lists and edges.
 * @param adjacencyLists adjacency lists
 * @param edges edges
 * @param fsmConfig FSM configuration
 * @return graph transaction
 */
private static GSpanGraph createGSpanGraph(List<AdjacencyList> adjacencyLists,List<GSpanEdge> edges,FSMConfig fsmConfig){
  Collections.sort(edges);
  Map<DFSCode,Collection<DFSEmbedding>> codeEmbeddings=Maps.newHashMap();
  Iterator<GSpanEdge> iterator=edges.iterator();
  GSpanEdge lastEdge=iterator.next();
  Collection<DFSEmbedding> embeddings=createSingleEdgeSubgraphEmbeddings(codeEmbeddings,lastEdge,fsmConfig);
  while (iterator.hasNext()) {
    GSpanEdge edge=iterator.next();
    if (edge.compareTo(lastEdge) == 0) {
      embeddings.add(createSingleEdgeEmbedding(edge));
    }
 else {
      embeddings=createSingleEdgeSubgraphEmbeddings(codeEmbeddings,edge,fsmConfig);
      lastEdge=edge;
    }
  }
  return new GSpanGraph(adjacencyLists,codeEmbeddings);
}

Fixed version (ground truth):
/** 
 * Creates the gSpan mining representation of a graph transaction from a give list of adjacency lists and edges.
 * @param adjacencyLists adjacency lists
 * @param edges edges
 * @param fsmConfig FSM configuration
 * @return graph transaction
 */
private static GSpanGraph createGSpanGraph(List<AdjacencyList> adjacencyLists,List<GSpanEdge> edges,FSMConfig fsmConfig){
  GSpanGraph gSpanGraph;
  if (!edges.isEmpty()) {
    Collections.sort(edges);
    Map<DFSCode,Collection<DFSEmbedding>> codeEmbeddings=Maps.newHashMap();
    Iterator<GSpanEdge> iterator=edges.iterator();
    GSpanEdge lastEdge=iterator.next();
    Collection<DFSEmbedding> embeddings=createSingleEdgeSubgraphEmbeddings(codeEmbeddings,lastEdge,fsmConfig);
    while (iterator.hasNext()) {
      GSpanEdge edge=iterator.next();
      if (edge.compareTo(lastEdge) == 0) {
        embeddings.add(createSingleEdgeEmbedding(edge));
      }
 else {
        embeddings=createSingleEdgeSubgraphEmbeddings(codeEmbeddings,edge,fsmConfig);
        lastEdge=edge;
      }
    }
    gSpanGraph=new GSpanGraph(adjacencyLists,codeEmbeddings);
  }
 else {
    gSpanGraph=new GSpanGraph();
  }
  return gSpanGraph;
}
Program: 95825
Project: 95825
Buggy source:
@Override public int compare(WithCount<String> label1,WithCount<String> label2){
  int comparison;
  if (label1.getCount() > label2.getCount()) {
    comparison=-1;
  }
 else {
    comparison=label1.getObject().compareTo(label2.getObject());
  }
  return comparison;
}

Fixed version (ground truth):
@Override public int compare(WithCount<String> label1,WithCount<String> label2){
  int comparison;
  if (label1.getCount() > label2.getCount()) {
    comparison=-1;
  }
 else   if (label1.getCount() < label2.getCount()) {
    comparison=1;
  }
 else {
    comparison=label1.getObject().compareTo(label2.getObject());
  }
  return comparison;
}
Program: 95826
Project: 95826
Buggy source:
@Override public void flatMap(TLFGraph tlfGraph,Collector<String> collector) throws Exception {
  for (  TLFVertex vertex : tlfGraph.getGraphVertices()) {
    collector.collect(vertex.getLabel());
  }
}

Fixed version (ground truth):
@Override public void flatMap(TLFGraph tlfGraph,Collector<String> collector) throws Exception {
  Set<String> labels=Sets.newHashSet();
  for (  TLFVertex vertex : tlfGraph.getGraphVertices()) {
    labels.add(vertex.getLabel());
  }
  for (  String label : labels) {
    collector.collect(label);
  }
}
Program: 95827
Project: 95827
Buggy source:
@Override public Collection<EdgeTripleWithStringEdgeLabel<GradoopId>> map(GraphTransaction<G,V,E> transaction) throws Exception {
  Map<GradoopId,Integer> vertexLabels=Maps.newHashMap();
  Collection<EdgeTripleWithStringEdgeLabel<GradoopId>> triples=Lists.newArrayList();
  for (  V vertex : transaction.getVertices()) {
    Integer label=dictionary.get(vertex.getLabel());
    if (label != null) {
      vertexLabels.put(vertex.getId(),label);
    }
  }
  for (  E edge : transaction.getEdges()) {
    Integer sourceLabel=vertexLabels.get(edge.getSourceId());
    if (sourceLabel != null) {
      Integer targetLabel=vertexLabels.get(edge.getTargetId());
      if (targetLabel != null) {
        triples.add(new EdgeTripleWithStringEdgeLabel<GradoopId>(edge.getSourceId(),edge.getTargetId(),edge.getLabel(),sourceLabel,targetLabel));
      }
    }
  }
  return triples;
}

Fixed version (ground truth):
@Override public Collection<EdgeTripleWithStringEdgeLabel<GradoopId>> map(GraphTransaction<G,V,E> transaction) throws Exception {
  Map<GradoopId,Integer> vertexLabels=Maps.newHashMap();
  Collection<EdgeTripleWithStringEdgeLabel<GradoopId>> triples=Lists.newArrayList();
  for (  V vertex : transaction.getVertices()) {
    Integer label=dictionary.get(vertex.getLabel());
    if (label != null) {
      vertexLabels.put(vertex.getId(),label);
    }
  }
  for (  E edge : transaction.getEdges()) {
    Integer sourceLabel=vertexLabels.get(edge.getSourceId());
    if (sourceLabel != null) {
      Integer targetLabel=vertexLabels.get(edge.getTargetId());
      if (targetLabel != null) {
        triples.add(new EdgeTripleWithStringEdgeLabel<>(edge.getSourceId(),edge.getTargetId(),edge.getLabel(),sourceLabel,targetLabel));
      }
    }
  }
  return triples;
}
Program: 95828
Project: 95828
Buggy source:
/** 
 * Constructor.
 * @param adjacencyLists adjacency lists
 * @param subgraphEmbeddings initial DFS codes and embeddings
 */
public GSpanGraph(List<AdjacencyList> adjacencyLists,Map<DFSCode,Collection<DFSEmbedding>> subgraphEmbeddings){
  this.adjacencyLists=adjacencyLists;
  this.subgraphEmbeddings=subgraphEmbeddings;
}

Fixed version (ground truth):
/** 
 * default constructor
 */
public GSpanGraph(){
  this.adjacencyLists=Lists.newArrayListWithCapacity(0);
  this.subgraphEmbeddings=Maps.newHashMapWithExpectedSize(0);
}
Program: 95830
Project: 95830
Buggy source:
@Override public GraphTransaction<G,V,E> map(Long graphNumber) throws Exception {
  Long maxVertexLabelIndex=graphNumber % 10;
  G graphHead=graphHeadFactory.createGraphHead(String.valueOf(maxVertexLabelIndex + 1));
  Set<V> vertices=Sets.newHashSet();
  Set<E> edges=Sets.newHashSet();
  GradoopIdSet graphIds=GradoopIdSet.fromExisting(graphHead.getId());
  V centerVertex=vertexFactory.createVertex("String_Node_Str",graphIds);
  vertices.add(centerVertex);
  for (int vertexLabelIndex=0; vertexLabelIndex <= maxVertexLabelIndex; vertexLabelIndex++) {
    String vertexLabel=VERTEX_LABELS.get(vertexLabelIndex);
    for (int patternCopy=1; patternCopy <= graphSize; patternCopy++) {
      addPattern(vertexLabel,centerVertex,vertices,edges);
    }
  }
  for (  V vertex : vertices) {
    vertex.setGraphIds(graphIds);
  }
  for (  E edge : edges) {
    edge.setGraphIds(graphIds);
  }
  return new GraphTransaction<>(graphHead,vertices,edges);
}

Fixed version (ground truth):
@Override public GraphTransaction<G,V,E> map(Long graphNumber) throws Exception {
  Long maxVertexLabelIndex=graphNumber % 10;
  G graphHead=graphHeadFactory.createGraphHead(String.valueOf(maxVertexLabelIndex));
  Set<V> vertices=Sets.newHashSet();
  Set<E> edges=Sets.newHashSet();
  GradoopIdSet graphIds=GradoopIdSet.fromExisting(graphHead.getId());
  V centerVertex=vertexFactory.createVertex("String_Node_Str",graphIds);
  vertices.add(centerVertex);
  for (int vertexLabelIndex=0; vertexLabelIndex <= maxVertexLabelIndex; vertexLabelIndex++) {
    String vertexLabel=VERTEX_LABELS.get(vertexLabelIndex);
    for (int patternCopy=1; patternCopy <= graphSize; patternCopy++) {
      addPattern(graphNumber,vertexLabel,centerVertex,vertices,edges);
    }
  }
  for (  V vertex : vertices) {
    vertex.setGraphIds(graphIds);
  }
  for (  E edge : edges) {
    edge.setGraphIds(graphIds);
  }
  return new GraphTransaction<>(graphHead,vertices,edges);
}
Program: 95831
Project: 95831
Buggy source:
@Test public void testMaxVertexLabel() throws Exception {
  for (long maxVertexLabel=1; maxVertexLabel <= 10; maxVertexLabel++) {
    GraphTransaction<GraphHeadPojo,VertexPojo,EdgePojo> graph=new PredictableTransaction<>(1,true,getConfig()).map(maxVertexLabel);
    assertEquals((maxVertexLabel % 10 + 1) * 9 + 1,graph.getVertices().size());
    assertEquals((maxVertexLabel % 10 + 1) * 14,graph.getEdges().size());
    graph=new PredictableTransaction<>(1,false,getConfig()).map(maxVertexLabel);
    assertEquals((maxVertexLabel % 10 + 1) * 8 + 1,graph.getVertices().size());
    assertEquals((maxVertexLabel % 10 + 1) * 10,graph.getEdges().size());
  }
}

Fixed version (ground truth):
@Test public void testMaxVertexLabel() throws Exception {
  for (long maxVertexLabel=0; maxVertexLabel < 10; maxVertexLabel++) {
    GraphTransaction<GraphHeadPojo,VertexPojo,EdgePojo> graph=new PredictableTransaction<>(1,true,getConfig()).map(maxVertexLabel);
    assertEquals((maxVertexLabel % 10 + 1) * 9 + 1,graph.getVertices().size());
    assertEquals((maxVertexLabel % 10 + 1) * 14,graph.getEdges().size());
    graph=new PredictableTransaction<>(1,false,getConfig()).map(maxVertexLabel);
    assertEquals((maxVertexLabel % 10 + 1) * 8 + 1,graph.getVertices().size());
    assertEquals((maxVertexLabel % 10 + 1) * 10,graph.getEdges().size());
  }
}
Program: 95832
Project: 95832
Buggy source:
@Override public GraphTransactions<G,V,E> getGraphTransactions() throws IOException {
  DataSet<TLFGraph> graphs;
  DataSet<GraphTransaction<G,V,E>> transactions;
  ExecutionEnvironment env=getConfig().getExecutionEnvironment();
  graphs=env.readHadoopFile(new TLFInputFormat(),LongWritable.class,Text.class,getTLFPath()).map(new TLFGraphFromText());
  GraphTransactionFromTLFGraph<G,V,E> graphTransactionFromTLFGraph=new GraphTransactionFromTLFGraph<G,V,E>(getConfig().getGraphHeadFactory(),getConfig().getVertexFactory(),getConfig().getEdgeFactory());
  TypeInformation<GraphTransaction<G,V,E>> typeInformation=graphTransactionFromTLFGraph.getProducedType();
  transactions=graphs.map(graphTransactionFromTLFGraph).returns(typeInformation);
  if (hasVertexDictionary()) {
    transactions=transactions.map(new VertexLabelDecoder<G,V,E>()).withBroadcastSet(getVertexDictionary(),VertexLabelDecoder.VERTEX_DICTIONARY);
  }
  if (hasEdgeDictionary()) {
    transactions=transactions.map(new EdgeLabelDecoder<G,V,E>()).withBroadcastSet(getEdgeDictionary(),EdgeLabelDecoder.EDGE_DICTIONARY);
  }
  return new GraphTransactions<G,V,E>(transactions,getConfig());
}

Fixed version (ground truth):
@Override public GraphTransactions<G,V,E> getGraphTransactions() throws IOException {
  DataSet<TLFGraph> graphs;
  DataSet<GraphTransaction<G,V,E>> transactions;
  ExecutionEnvironment env=getConfig().getExecutionEnvironment();
  graphs=env.readHadoopFile(new TLFInputFormat(),LongWritable.class,Text.class,getTLFPath()).map(new TLFGraphFromText());
  transactions=graphs.map(new GraphTransactionFromTLFGraph<>(getConfig().getGraphHeadFactory(),getConfig().getVertexFactory(),getConfig().getEdgeFactory())).returns(GraphTransaction.getTypeInformation(getConfig()));
  if (hasVertexDictionary()) {
    transactions=transactions.map(new VertexLabelDecoder<G,V,E>()).withBroadcastSet(getVertexDictionary(),VertexLabelDecoder.VERTEX_DICTIONARY);
  }
  if (hasEdgeDictionary()) {
    transactions=transactions.map(new EdgeLabelDecoder<G,V,E>()).withBroadcastSet(getEdgeDictionary(),EdgeLabelDecoder.EDGE_DICTIONARY);
  }
  return new GraphTransactions<>(transactions,getConfig());
}
Program: 95833
Project: 95833
Buggy source:
/** 
 * Constructs a dataset containing GraphTransaction(s).
 * @param graph a tlf graph
 * @return a GraphTransaction corresponding to the TLFGraph
 * @throws Exception
 */
@Override public GraphTransaction<G,V,E> map(TLFGraph graph) throws Exception {
  Set<V> vertices=Sets.newHashSet();
  Set<E> edges=Sets.newHashSet();
  GradoopId id;
  String label;
  GradoopId targetId;
  GradoopIdSet graphs=new GradoopIdSet();
  Map<Integer,GradoopId> integerGradoopIdMapVertices;
  integerGradoopIdMapVertices=Maps.newHashMap();
  id=GradoopId.get();
  graphs.add(id);
  for (  TLFVertex vertex : graph.getGraphVertices()) {
    id=GradoopId.get();
    integerGradoopIdMapVertices.put(vertex.getId(),id);
    label=vertex.getLabel();
    vertices.add(this.vertexFactory.initVertex(id,label,graphs));
  }
  for (  TLFEdge edge : graph.getGraphEdges()) {
    id=integerGradoopIdMapVertices.get(edge.getSourceId());
    targetId=integerGradoopIdMapVertices.get(edge.getTargetId());
    label=edge.getLabel();
    edges.add(this.edgeFactory.createEdge(label,id,targetId,graphs));
  }
  return new GraphTransaction<G,V,E>(this.graphHeadFactory.initGraphHead(id),vertices,edges);
}

Fixed version (ground truth):
/** 
 * Constructs a dataset containing GraphTransaction(s).
 * @param graph a tlf graph
 * @return a GraphTransaction corresponding to the TLFGraph
 * @throws Exception
 */
@Override public GraphTransaction<G,V,E> map(TLFGraph graph) throws Exception {
  G graphHead=this.graphHeadFactory.createGraphHead();
  Set<V> vertices=Sets.newHashSet();
  Set<E> edges=Sets.newHashSet();
  GradoopIdSet graphIds=GradoopIdSet.fromExisting(graphHead.getId());
  Map<Integer,GradoopId> vertexIdMap;
  vertexIdMap=Maps.newHashMap();
  for (  TLFVertex tlfVertex : graph.getGraphVertices()) {
    V vertex=vertexFactory.createVertex(tlfVertex.getLabel(),graphIds);
    vertices.add(vertex);
    vertexIdMap.put(tlfVertex.getId(),vertex.getId());
  }
  for (  TLFEdge tlfEdge : graph.getGraphEdges()) {
    GradoopId sourceId=vertexIdMap.get(tlfEdge.getSourceId());
    GradoopId targetId=vertexIdMap.get(tlfEdge.getTargetId());
    edges.add(edgeFactory.createEdge(tlfEdge.getLabel(),sourceId,targetId,graphIds));
  }
  return new GraphTransaction<>(graphHead,vertices,edges);
}
Program: 95834
Project: 95834
Buggy source:
/** 
 * Creates a TLF string representation of a given graph transaction.
 * @param graphTransaction graph transaction
 * @return TLF string representation
 */
@Override public String format(GraphTransaction<G,V,E> graphTransaction){
  Map<GradoopId,Integer> gradoopIdIntegerMapVertices=Maps.newHashMapWithExpectedSize(graphTransaction.getVertices().size());
  Integer id=0;
  StringBuilder graph=new StringBuilder();
  for (  V vertex : graphTransaction.getVertices()) {
    gradoopIdIntegerMapVertices.put(vertex.getId(),id);
    id++;
  }
  graph.append("String_Node_Str" + graphID + "String_Node_Str");
  graphID++;
  for (  V vertex : graphTransaction.getVertices()) {
    graph.append("String_Node_Str" + gradoopIdIntegerMapVertices.get(vertex.getId()) + "String_Node_Str"+ vertex.getLabel()+ "String_Node_Str");
  }
  int i=0;
  for (  E edge : graphTransaction.getEdges()) {
    graph.append("String_Node_Str" + gradoopIdIntegerMapVertices.get(edge.getSourceId()) + "String_Node_Str"+ gradoopIdIntegerMapVertices.get(edge.getTargetId())+ "String_Node_Str"+ "String_Node_Str"+ edge.getLabel());
    if (i < graphTransaction.getEdges().size() - 1) {
      graph.append("String_Node_Str");
    }
    i++;
  }
  return graph.toString();
}

Fixed version (ground truth):
/** 
 * Creates a TLF string representation of a given graph transaction.
 * @param graphTransaction graph transaction
 * @return TLF string representation
 */
@Override public String format(GraphTransaction<G,V,E> graphTransaction){
  graphId++;
  Map<GradoopId,Integer> vertexIdMap=Maps.newHashMapWithExpectedSize(graphTransaction.getVertices().size());
  Collection<String> lines=Lists.newArrayListWithExpectedSize(graphTransaction.getVertices().size() + graphTransaction.getEdges().size() + 1);
  lines.add(TLFGraph.SYMBOL + "String_Node_Str" + graphId);
  int vertexId=0;
  for (  V vertex : graphTransaction.getVertices()) {
    vertexIdMap.put(vertex.getId(),vertexId);
    lines.add(TLFVertex.SYMBOL + "String_Node_Str" + vertexId+ "String_Node_Str"+ vertex.getLabel());
    vertexId++;
  }
  for (  E edge : graphTransaction.getEdges()) {
    Integer sourceId=vertexIdMap.get(edge.getSourceId());
    Integer targetId=vertexIdMap.get(edge.getTargetId());
    lines.add(TLFEdge.SYMBOL + "String_Node_Str" + sourceId+ "String_Node_Str"+ targetId+ "String_Node_Str"+ "String_Node_Str"+ edge.getLabel());
  }
  return StringUtils.join(lines,"String_Node_Str") + "String_Node_Str";
}
Program: 95835
Project: 95835
Buggy source:
@Override public GSpanGraph map(Collection<EdgeTripleWithStringEdgeLabel<Integer>> stringTriples) throws Exception {
  Collection<EdgeTriple<Integer>> intTriples=Lists.newArrayList();
  for (  EdgeTripleWithStringEdgeLabel<Integer> triple : stringTriples) {
    Integer edgeLabel=dictionary.get(triple.getEdgeLabel());
    if (edgeLabel != null) {
      intTriples.add(new EdgeTripleWithoutGraphId<Integer>(triple.getSourceId(),triple.getTargetId(),edgeLabel,triple.getSourceLabel(),triple.getTargetLabel()));
    }
  }
  return GSpan.createGSpanGraphInteger(intTriples);
}

Fixed version (ground truth):
@Override public GSpanGraph map(Collection<EdgeTripleWithStringEdgeLabel<Integer>> stringTriples) throws Exception {
  Collection<EdgeTriple<Integer>> intTriples=Lists.newArrayList();
  for (  EdgeTripleWithStringEdgeLabel<Integer> triple : stringTriples) {
    Integer edgeLabel=dictionary.get(triple.getEdgeLabel());
    if (edgeLabel != null) {
      intTriples.add(new EdgeTripleWithoutGraphId<>(triple.getSourceId(),triple.getTargetId(),edgeLabel,triple.getSourceLabel(),triple.getTargetLabel()));
    }
  }
  return GSpan.createGSpanGraph(intTriples);
}
Program: 95836
Project: 95836
Buggy source:
@Test public void testMinersSeparately() throws Exception {
  GraphTransactions<GraphHeadPojo,VertexPojo,EdgePojo> transactions=new PredictableTransactionsGenerator<>(100,1,true,getConfig()).execute();
  FSMConfig fsmConfig=FSMConfig.forDirectedMultigraph(1.0f);
  GSpanGraphTransactionsEncoder<GraphHeadPojo,VertexPojo,EdgePojo> encoder=new GSpanGraphTransactionsEncoder<>();
  DataSet<GSpanGraph> edges=encoder.encode(transactions,fsmConfig);
  for (  GSpanMiner miner : getTransactionalFSMiners()) {
    miner.setExecutionEnvironment(transactions.getConfig().getExecutionEnvironment());
    DataSet<WithCount<CompressedDFSCode>> frequentSubgraphs=miner.mine(edges,encoder.getMinFrequency(),fsmConfig);
    Assert.assertEquals(702,frequentSubgraphs.count());
  }
}

Fixed version (ground truth):
@Test public void testMinersSeparately() throws Exception {
  GraphTransactions<GraphHeadPojo,VertexPojo,EdgePojo> transactions=new PredictableTransactionsGenerator<>(10,1,true,getConfig()).execute();
  float threshold=0.2f;
  FSMConfig fsmConfig=FSMConfig.forDirectedMultigraph(threshold);
  GSpanGraphTransactionsEncoder<GraphHeadPojo,VertexPojo,EdgePojo> encoder=new GSpanGraphTransactionsEncoder<>();
  DataSet<GSpanGraph> edges=encoder.encode(transactions,fsmConfig);
  for (  GSpanMiner miner : getTransactionalFSMiners()) {
    miner.setExecutionEnvironment(transactions.getConfig().getExecutionEnvironment());
    DataSet<WithCount<CompressedDFSCode>> frequentSubgraphs=miner.mine(edges,encoder.getMinFrequency(),fsmConfig);
    Assert.assertEquals(PredictableTransactionsGenerator.containedFrequentSubgraphs(threshold),frequentSubgraphs.count());
  }
}
Program: 95838
Project: 95838
Buggy source:
@Override public String toString(){
  return String.format("String_Node_Str",key,value);
}

Fixed version (ground truth):
@Override public String toString(){
  return String.format("String_Node_Str",key,value,value.getType().getSimpleName());
}
Program: 95839
Project: 95839
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public DataSet<Boolean> equalsByGraphIds(GraphCollection<G,V,E> other){
  return new EqualityByGraphIds<G,V,E>().execute(this,other);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public DataSet<Boolean> equalsByGraphIds(GraphCollection<G,V,E> other){
  return new CollectionEqualityByGraphIds<G,V,E>().execute(this,other);
}
Program: 95840
Project: 95840
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public DataSet<Boolean> equalsByGraphElementData(GraphCollection<G,V,E> other){
  return new EqualityByGraphElementData<G,V,E>().execute(this,other);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public DataSet<Boolean> equalsByGraphElementData(GraphCollection<G,V,E> other){
  return new CollectionEquality<>(new GraphHeadEmptyLabeler<G>(),new VertexDataLabeler<V>(),new EdgeDataLabeler<E>()).execute(this,other);
}
Program: 95841
Project: 95841
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public DataSet<Boolean> equalsByGraphData(GraphCollection<G,V,E> other){
  return new EqualityByGraphData<G,V,E>().execute(this,other);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public DataSet<Boolean> equalsByGraphData(GraphCollection<G,V,E> other){
  return new CollectionEquality<>(new GraphHeadDataLabeler<G>(),new VertexDataLabeler<V>(),new EdgeDataLabeler<E>()).execute(this,other);
}
Program: 95842
Project: 95842
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public DataSet<Boolean> equalsByGraphElementIds(GraphCollection<G,V,E> other){
  return new EqualityByGraphElementIds<G,V,E>().execute(this,other);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public DataSet<Boolean> equalsByGraphElementIds(GraphCollection<G,V,E> other){
  return new CollectionEquality<>(new GraphHeadEmptyLabeler<G>(),new VertexIdLabeler<V>(),new EdgeIdLabeler<E>()).execute(this,other);
}
Program: 95843
Project: 95843
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public DataSet<Boolean> equalsByElementData(LogicalGraph<G,V,E> other){
  return new EqualityByElementData<G,V,E>().execute(this,other);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public DataSet<Boolean> equalsByElementData(LogicalGraph<G,V,E> other){
  return new GraphEquality<>(new GraphHeadEmptyLabeler<G>(),new VertexDataLabeler<V>(),new EdgeDataLabeler<E>()).execute(this,other);
}
Program: 95844
Project: 95844
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public DataSet<Boolean> equalsByElementIds(LogicalGraph<G,V,E> other){
  return new EqualityByElementIds<G,V,E>().execute(this,other);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public DataSet<Boolean> equalsByElementIds(LogicalGraph<G,V,E> other){
  return new GraphEquality<>(new GraphHeadEmptyLabeler<G>(),new VertexIdLabeler<V>(),new EdgeIdLabeler<E>()).execute(this,other);
}
Program: 95845
Project: 95845
Buggy source:
@Override public Boolean reduce(Boolean a,Boolean b) throws Exception {
  return a && b;
}

Fixed version (ground truth):
public static DataSet<Boolean> reduce(DataSet<Boolean> d){
  return d.reduce(new And());
}
Program: 95846
Project: 95846
Buggy source:
@Override public Boolean reduce(Boolean first,Boolean second) throws Exception {
  return first || second;
}

Fixed version (ground truth):
public static DataSet<Boolean> reduce(DataSet<Boolean> d){
  return d.reduce(new Or());
}
Program: 95847
Project: 95847
Buggy source:
/** 
 * Initializes edges and their cache.
 */
private void initEdges(){
  for (  Edge e : gdlHandler.getEdges()) {
    if (!edgeIds.containsKey(e.getId())) {
      initEdge(e);
    }
  }
  for (  Map.Entry<String,Edge> e : gdlHandler.getEdgeCache().entrySet()) {
    updateEdgeCache(e.getKey(),e.getValue());
  }
}

Fixed version (ground truth):
/** 
 * Initializes edges and their cache.
 */
private void initEdges(){
  for (  Edge e : gdlHandler.getEdges()) {
    initEdge(e);
  }
  for (  Map.Entry<String,Edge> e : gdlHandler.getEdgeCache().entrySet()) {
    updateEdgeCache(e.getKey(),e.getValue());
  }
}
Program: 95848
Project: 95848
Buggy source:
/** 
 * Creates a new EPGMEdge from the GDL Loader.
 * @param e edge from GDL loader
 * @return EPGM edge
 */
private E initEdge(Edge e){
  E edge=config.getEdgeFactory().createEdge(e.getLabel(),vertexIds.get(e.getSourceVertexId()),vertexIds.get(e.getTargetVertexId()),PropertyList.createFromMap(e.getProperties()),createGradoopIdSet(e));
  edgeIds.put(e.getId(),edge.getId());
  edges.put(edge.getId(),edge);
  return edge;
}

Fixed version (ground truth):
/** 
 * Creates a new EPGMEdge from the GDL Loader.
 * @param e edge from GDL loader
 * @return EPGM edge
 */
private E initEdge(Edge e){
  E edge;
  if (!edgeIds.containsKey(e.getId())) {
    edge=config.getEdgeFactory().createEdge(e.getLabel(),vertexIds.get(e.getSourceVertexId()),vertexIds.get(e.getTargetVertexId()),PropertyList.createFromMap(e.getProperties()),createGradoopIdSet(e));
    edgeIds.put(e.getId(),edge.getId());
    edges.put(edge.getId(),edge);
  }
 else {
    edge=edges.get(edgeIds.get(e.getId()));
    edge.setGraphIds(createGradoopIdSet(e));
  }
  return edge;
}
Program: 95849
Project: 95849
Buggy source:
/** 
 * Creates a new EPGMVertex from the GDL Loader.
 * @param v vertex from GDL Loader
 * @return EPGM Vertex
 */
private V initVertex(Vertex v){
  V vertex=config.getVertexFactory().createVertex(v.getLabel(),PropertyList.createFromMap(v.getProperties()),createGradoopIdSet(v));
  vertexIds.put(v.getId(),vertex.getId());
  vertices.put(vertex.getId(),vertex);
  return vertex;
}

Fixed version (ground truth):
/** 
 * Creates a new EPGMVertex from the GDL Loader or updates an existing one.
 * @param v vertex from GDL Loader
 * @return EPGM Vertex
 */
private V initVertex(Vertex v){
  V vertex;
  if (!vertexIds.containsKey(v.getId())) {
    vertex=config.getVertexFactory().createVertex(v.getLabel(),PropertyList.createFromMap(v.getProperties()),createGradoopIdSet(v));
    vertexIds.put(v.getId(),vertex.getId());
    vertices.put(vertex.getId(),vertex);
  }
 else {
    vertex=vertices.get(vertexIds.get(v.getId()));
    vertex.setGraphIds(createGradoopIdSet(v));
  }
  return vertex;
}
Program: 95850
Project: 95850
Buggy source:
/** 
 * Initializes vertices and their cache.
 */
private void initVertices(){
  for (  Vertex v : gdlHandler.getVertices()) {
    if (!vertexIds.containsKey(v.getId())) {
      initVertex(v);
    }
  }
  for (  Map.Entry<String,Vertex> e : gdlHandler.getVertexCache().entrySet()) {
    updateVertexCache(e.getKey(),e.getValue());
  }
}

Fixed version (ground truth):
/** 
 * Initializes vertices and their cache.
 */
private void initVertices(){
  for (  Vertex v : gdlHandler.getVertices()) {
    initVertex(v);
  }
  for (  Map.Entry<String,Vertex> e : gdlHandler.getVertexCache().entrySet()) {
    updateVertexCache(e.getKey(),e.getValue());
  }
}
Program: 95851
Project: 95851
Buggy source:
/** 
 * Constructor
 * @param maxIterations Counter to define maximal iteration for the algorithm
 */
public LabelPropagation(int maxIterations,String propertyKey){
  this.maxIterations=maxIterations;
  this.propertyKey=propertyKey;
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param maxIterations Counter to define maximal iteration for the algorithm
 * @param propertyKey   Property key to access the label value
 */
public LabelPropagation(int maxIterations,String propertyKey){
  this.maxIterations=maxIterations;
  this.propertyKey=propertyKey;
}
Program: 95852
Project: 95852
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public LogicalGraph<G,V,E> execute(LogicalGraph<G,V,E> logicalGraph){
  ExecutionEnvironment env=ExecutionEnvironment.getExecutionEnvironment();
  DataSet<Vertex<GradoopId,PropertyValue>> vertices=logicalGraph.getVertices().map(new VertexToGellyVertexMapper<V>(propertyKey));
  DataSet<Edge<GradoopId,NullValue>> edges=logicalGraph.getEdges().map(new EdgeToGellyEdgeMapper<E>());
  Graph<GradoopId,PropertyValue,NullValue> gellyGraph=Graph.fromDataSet(vertices,edges,env);
  try {
    gellyGraph=gellyGraph.run(new LabelPropagationAlgorithm(this.maxIterations));
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  DataSet<V> labeledVertices=gellyGraph.getVertices().join(logicalGraph.getVertices()).where(0).equalTo(new Id<V>()).with(new LPVertexJoin<V>(propertyKey));
  return LogicalGraph.fromDataSets(labeledVertices,logicalGraph.getEdges(),logicalGraph.getConfig());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public LogicalGraph<G,V,E> execute(LogicalGraph<G,V,E> logicalGraph){
  ExecutionEnvironment env=ExecutionEnvironment.getExecutionEnvironment();
  DataSet<Vertex<GradoopId,PropertyValue>> vertices=logicalGraph.getVertices().map(new VertexToGellyVertexMapper<V>(propertyKey));
  DataSet<Edge<GradoopId,NullValue>> edges=logicalGraph.getEdges().map(new EdgeToGellyEdgeMapper<E>());
  Graph<GradoopId,PropertyValue,NullValue> gellyGraph=Graph.fromDataSet(vertices,edges,env);
  gellyGraph=gellyGraph.runVertexCentricIteration(new LPUpdateFunction(),new LPMessageFunction(),maxIterations);
  DataSet<V> labeledVertices=gellyGraph.getVertices().join(logicalGraph.getVertices()).where(0).equalTo(new Id<V>()).with(new LPVertexJoin<V>(propertyKey));
  return LogicalGraph.fromDataSets(labeledVertices,logicalGraph.getEdges(),logicalGraph.getConfig());
}
Program: 95853
Project: 95853
Buggy source:
public EdgeToGellyEdgeMapper(){
  reuseEdge=new Edge<>();
}

Fixed version (ground truth):
/** 
 * Constructor
 */
public EdgeToGellyEdgeMapper(){
  reuseEdge=new Edge<>();
}
Program: 95854
Project: 95854
Buggy source:
@Override public Boolean map(Boolean b) throws Exception {
  return !b;
}

Fixed version (ground truth):
public static DataSet<Boolean> map(DataSet<Boolean> b){
  return b.map(new Not());
}