nus-yam/ex-repair huggingface dataset:
Program: 50093
Project: 50093
Buggy source:
/** 
 * This method creates a list of fields present in the class. This is used to generate ctor, dtor, assign and copy statements. Note: Includes static fields.
 */
List<FieldInfo> collectFieldsForClass(IASTDeclSpecifier declSpec) throws DOMException {
  if (!(declSpec instanceof IASTCompositeTypeSpecifier))   return Collections.emptyList();
  IASTCompositeTypeSpecifier composite=(IASTCompositeTypeSpecifier)declSpec;
  List<FieldInfo> fields=new ArrayList<FieldInfo>();
  for (  IASTDeclaration decl : composite.getMembers()) {
    if (decl instanceof IASTSimpleDeclaration) {
      IASTSimpleDeclaration simple=(IASTSimpleDeclaration)decl;
      List<MExpression> exprs=evaluateDeclarationReturnInitializers(simple);
      int i=0;
      for (      IASTDeclarator declarator : simple.getDeclarators()) {
        IBinding binding=declarator.getName().resolveBinding();
        if (binding instanceof IField) {
          FieldInfo field=new FieldInfo(declarator,exprs.get(i),(IField)binding);
          if (declarator instanceof IASTFieldDeclarator && ((IASTFieldDeclarator)declarator).getBitFieldSize() != null) {
            ctx.bitfieldMngr.addBitfield(declarator.getName());
            field.isBitfield=true;
          }
          if (((IField)binding).isStatic())           field.isStatic=true;
          fields.add(field);
        }
        i++;
      }
    }
  }
  return fields;
}

Fixed version (ground truth):
/** 
 * This method creates a list of fields present in the class. This is used to generate ctor, dtor, assign and copy statements. Note: Includes static fields.
 */
List<FieldInfo> collectFieldsForClass(IASTDeclSpecifier declSpec) throws DOMException {
  if (!(declSpec instanceof IASTCompositeTypeSpecifier))   return Collections.emptyList();
  IASTCompositeTypeSpecifier composite=(IASTCompositeTypeSpecifier)declSpec;
  List<FieldInfo> fields=new ArrayList<FieldInfo>();
  for (  IASTDeclaration decl : composite.getMembers()) {
    if (decl instanceof IASTSimpleDeclaration) {
      IASTSimpleDeclaration simple=(IASTSimpleDeclaration)decl;
      List<MExpression> exprs=evaluateDeclarationReturnInitializers(simple,InitType.WRAPPED);
      int i=0;
      for (      IASTDeclarator declarator : simple.getDeclarators()) {
        IBinding binding=declarator.getName().resolveBinding();
        if (binding instanceof IField) {
          FieldInfo field=new FieldInfo(declarator,exprs.get(i),(IField)binding);
          if (declarator instanceof IASTFieldDeclarator && ((IASTFieldDeclarator)declarator).getBitFieldSize() != null) {
            ctx.bitfieldMngr.addBitfield(declarator.getName());
            field.isBitfield=true;
          }
          if (((IField)binding).isStatic())           field.isStatic=true;
          fields.add(field);
        }
        i++;
      }
    }
  }
  return fields;
}
Program: 50095
Project: 50095
Buggy source:
static TypeEnum expressionGetType(IASTExpression expr) throws DOMException {
  return TypeHelpers.getTypeEnum(expr.getExpressionType());
}

Fixed version (ground truth):
static TypeEnum expressionGetType(IASTExpression expr) throws DOMException {
  if (expr == null) {
    MyLogger.logImportant("String_Node_Str");
    MyLogger.exitOnError();
  }
 else   if (expr.getExpressionType() == null) {
    MyLogger.logImportant("String_Node_Str" + expr.getRawSignature());
    MyLogger.exitOnError();
  }
  return TypeHelpers.getTypeEnum(expr.getExpressionType());
}
Program: 50096
Project: 50096
Buggy source:
static void log(String msg){
  System.out.println(msg);
}

Fixed version (ground truth):
static void log(String msg){
}
Program: 50097
Project: 50097
Buggy source:
static void exitOnError(){
  System.exit(-1);
}

Fixed version (ground truth):
static void exitOnError(){
  try {
    throw new RuntimeException();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    System.exit(-1);
  }
}
Program: 50099
Project: 50099
Buggy source:
void func5(){
  Object[] __stack=new Object[2];
  int i=0;
  if (true)   i+=5;
  while (false)   i-=10;
  for (i=0; i < 20; i++)   i--;
switch (i) {
case 1:
    return;
case 2:
  i++;
}
if (true) for (; ; ) while (true) ;
for (int k=0; (k < 10) != 0; k++) k*=10;
foo ptr1=new foo();
foo ptr2=new foo(100);
foo ptr3=CreateHelper.allocateArray(foo.class,100);
(ptr1).destruct();
(ptr2).destruct();
DestructHelper.destructArray(ptr3);
int[] basic=new int[100];
short[][] basic2=new short[5][10];
if (false) return;
foo[] foos_array=StackHelper.addItem(CreateHelper.allocateArray(foo.class,45 + 2),0,__stack);
foo[][] foos_array2=StackHelper.addItem(CreateHelper.allocateArray(foo.class,50,20),1,__stack);
PtrInteger p=new int[2];
int r;
StackHelper.cleanup(null,__stack,0);
}

Fixed version (ground truth):
void func5(){
  Object[] __stack=new Object[2];
  int i=0;
  if (true)   i+=5;
  while (false)   i-=10;
  for (i=0; i < 20; i++)   i--;
switch (i) {
case 1:
    return;
case 2:
  i++;
}
if (true) for (; ; ) while (true) ;
for (int k=0; k < 10; k++) k*=10;
foo ptr1=new foo();
foo ptr2=new foo(100);
foo ptr3=CreateHelper.allocateArray(foo.class,100);
(ptr1).destruct();
(ptr2).destruct();
DestructHelper.destructArray(ptr3);
int[] basic=new int[100];
short[][] basic2=new short[5][10];
if (false) return;
foo[] foos_array=StackHelper.addItem(CreateHelper.allocateArray(foo.class,45 + 2),0,__stack);
foo[][] foos_array2=StackHelper.addItem(CreateHelper.allocateArray(foo.class,50,20),1,__stack);
PtrInteger p=new int[2];
int r;
StackHelper.cleanup(null,__stack,0);
}
Program: 50100
Project: 50100
Buggy source:
void func6(foo a){
  Object[] __stack=new Object[3];
  func6(new foo(1));
{
    foo foo_bar=StackHelper.addItem(new foo(),0,__stack);
    StackHelper.cleanup(null,__stack,0);
  }
  if (true) {
    foo foo_bar=StackHelper.addItem(new foo(),0,__stack);
    StackHelper.cleanup(null,__stack,0);
  }
  while (true) {
    foo foo_bar=StackHelper.addItem(new foo(),0,__stack);
    StackHelper.cleanup(null,__stack,0);
  }
switch (1) {
case 1:
{
      foo foo_bar=StackHelper.addItem(new foo(),0,__stack);
      StackHelper.cleanup(null,__stack,0);
    }
}
do {
  foo foo_bar=StackHelper.addItem(new foo(),0,__stack);
  StackHelper.cleanup(null,__stack,0);
}
 while (false);
if (true) {
  foo foo_bar=StackHelper.addItem(new foo(),0,__stack);
  while (true) {
    foo foo_baz=StackHelper.addItem(new foo(),1,__stack);
    for (; ; ) {
      foo foo_bug=StackHelper.addItem(new foo(),2,__stack);
      StackHelper.cleanup(null,__stack,2);
    }
    StackHelper.cleanup(null,__stack,1);
  }
  StackHelper.cleanup(null,__stack,0);
}
}

Fixed version (ground truth):
void func6(foo a){
  Object[] __stack=new Object[4];
  func6(StackHelper.addItem(new foo(1),0,__stack));
{
    foo foo_bar=StackHelper.addItem(new foo(),1,__stack);
    StackHelper.cleanup(null,__stack,1);
  }
  if (true) {
    foo foo_bar=StackHelper.addItem(new foo(),1,__stack);
    StackHelper.cleanup(null,__stack,1);
  }
  while (true) {
    foo foo_bar=StackHelper.addItem(new foo(),1,__stack);
    StackHelper.cleanup(null,__stack,1);
  }
switch (1) {
case 1:
{
      foo foo_bar=StackHelper.addItem(new foo(),1,__stack);
      StackHelper.cleanup(null,__stack,1);
    }
}
do {
  foo foo_bar=StackHelper.addItem(new foo(),1,__stack);
  StackHelper.cleanup(null,__stack,1);
}
 while (false);
if (true) {
  foo foo_bar=StackHelper.addItem(new foo(),1,__stack);
  while (true) {
    foo foo_baz=StackHelper.addItem(new foo(),2,__stack);
    for (; ; ) {
      foo foo_bug=StackHelper.addItem(new foo(),3,__stack);
      StackHelper.cleanup(null,__stack,3);
    }
    StackHelper.cleanup(null,__stack,2);
  }
  StackHelper.cleanup(null,__stack,1);
}
StackHelper.cleanup(null,__stack,0);
}
Program: 50101
Project: 50101
Buggy source:
void func7(){
  Object[] __stack=new Object[5];
  for (int i=0; i < 10; i++) {
    foo bar=StackHelper.addItem(new foo(),0,__stack);
    if (false) {
      StackHelper.cleanup(null,__stack,0);
      break;
    }
    if (true) {
{
        StackHelper.cleanup(null,__stack,0);
        continue;
      }
      StackHelper.cleanup(null,__stack,1);
    }
    StackHelper.cleanup(null,__stack,0);
  }
  for (int i=0; i < 20; i++) {
    if (true)     break;
 else     continue;
  }
  foo baz=StackHelper.addItem(new foo(),0,__stack);
  foo bug=StackHelper.addItem(new foo(),1,__stack);
  foo dog=StackHelper.addItem(new foo(),2,__stack);
  for (int i=0; i < 5; i++) {
    foo house=StackHelper.addItem(new foo(),3,__stack);
    if (false) {
      foo car=StackHelper.addItem(new foo(),4,__stack);
{
        StackHelper.cleanup(null,__stack,3);
        break;
      }
      StackHelper.cleanup(null,__stack,4);
    }
 else {
      StackHelper.cleanup(null,__stack,3);
      continue;
    }
    StackHelper.cleanup(null,__stack,3);
  }
  while (true) {
    foo honda=StackHelper.addItem(new foo(),3,__stack);
    do {
      foo ferrari=StackHelper.addItem(new foo(),4,__stack);
      if (true) {
        StackHelper.cleanup(null,__stack,4);
        break;
      }
 else {
        StackHelper.cleanup(null,__stack,4);
        continue;
      }
      StackHelper.cleanup(null,__stack,4);
    }
 while (false);
    StackHelper.cleanup(null,__stack,3);
  }
  StackHelper.cleanup(null,__stack,0);
}

Fixed version (ground truth):
void func7(){
  Object[] __stack=new Object[6];
  for (int i=0; i < 10; i++) {
    foo bar=StackHelper.addItem(new foo(),0,__stack);
    if (false)     break;
    if (true) {
      continue;
    }
    StackHelper.cleanup(null,__stack,0);
  }
  for (int i=0; i < 20; i++) {
    if (true)     break;
 else     continue;
  }
  foo baz=StackHelper.addItem(new foo(),0,__stack);
  foo bug=StackHelper.addItem(new foo(),1,__stack);
  foo dog=StackHelper.addItem(new foo(),2,__stack);
  for (int i=0; i < 5; i++) {
    foo house=StackHelper.addItem(new foo(),3,__stack);
    if (false) {
      foo car=StackHelper.addItem(new foo(),4,__stack);
{
        StackHelper.cleanup(null,__stack,3);
        break;
      }
      StackHelper.cleanup(null,__stack,4);
    }
 else {
      StackHelper.cleanup(null,__stack,3);
      continue;
    }
    StackHelper.cleanup(null,__stack,3);
  }
  while (true) {
    foo honda=StackHelper.addItem(new foo(),3,__stack);
    do {
      foo ferrari=StackHelper.addItem(new foo(),4,__stack);
      if (true) {
        StackHelper.cleanup(null,__stack,4);
        break;
      }
 else {
        StackHelper.cleanup(null,__stack,4);
        continue;
      }
      StackHelper.cleanup(null,__stack,4);
    }
 while (false);
    StackHelper.cleanup(null,__stack,3);
  }
  StackHelper.addItem(new foo(1),3,__stack);
  func6(StackHelper.addItem(new foo(),4,__stack));
  StackHelper.addItem(func8(),5,__stack);
  StackHelper.cleanup(null,__stack,0);
}
Program: 50102
Project: 50102
Buggy source:
private Expression eval1Expr(IASTExpression expr) throws DOMException {
  List<Expression> exprs=evalExpr(expr);
  assert(exprs.size() == 1);
  return exprs.get(0);
}

Fixed version (ground truth):
private Expression eval1Expr(IASTExpression expr,TypeEnum wanted) throws DOMException {
  List<Expression> exprs=evalExpr(expr,wanted);
  assert(exprs.size() == 1);
  return exprs.get(0);
}
Program: 50104
Project: 50104
Buggy source:
MethodInvocation createCleanupCall(int until){
  MethodInvocation meth=jast.newMethod().on("String_Node_Str").call("String_Node_Str").with(ast.newNullLiteral()).with("String_Node_Str").with(until).toAST();
  return meth;
}

Fixed version (ground truth):
private MethodInvocation createCleanupCall(int until){
  MethodInvocation meth=jast.newMethod().on("String_Node_Str").call("String_Node_Str").with(ast.newNullLiteral()).with("String_Node_Str").with(until).toAST();
  return meth;
}
Program: 50113
Project: 50113
Buggy source:
/** 
 * Whether or not this synthesis subtree contains any edges/nodes representing the same tree edges that are represented by nodes/edges in <tt>that</tt>.
 * @param that
 * @param workingRank
 * @return
 */
public boolean containsAnyStreeElementsOf(SynthesisSubtreeInfoUsingEdgeIds that,int workingRank){
  boolean containsAny=false;
  for (  int rank : ranksForIncludedEdges()) {
    if (rank < workingRank || !that.edgeIdsByRank.containsKey(rank)) {
      continue;
    }
    for (    long edgeId : that.edgeIdsForRank(rank)) {
      if (this.edgeIdsForRank(rank).contains(edgeId)) {
        containsAny=true;
        break;
      }
    }
  }
  if (!containsAny) {
    outer:     for (    int rank : ranksForIncludedTips()) {
      if (rank < workingRank || !that.tipIdSetsByRank.containsKey(rank)) {
        continue;
      }
      for (      LongSet thoseTips : that.tipIdSetsForRank(rank)) {
        for (        LongSet theseTips : this.tipIdSetsForRank(rank)) {
          if (theseTips.containsAny(thoseTips)) {
            containsAny=true;
            break outer;
          }
        }
      }
    }
  }
  return containsAny;
}

Fixed version (ground truth):
/** 
 * Whether or not this synthesis subtree contains any edges/nodes representing the same tree edges that are represented by nodes/edges in <tt>that</tt>.
 * @param that
 * @param workingRank
 * @return
 */
public boolean containsAnyStreeElementsOf(SynthesisSubtreeInfoUsingEdgeIds that,int workingRank){
  boolean containsAny=false;
  for (  int rank : ranksForIncludedEdges()) {
    if (rank < workingRank || !that.edgeIdsByRank.containsKey(rank)) {
      continue;
    }
    for (    Object edgeId : that.edgeIdsForRank(rank)) {
      if (this.edgeIdsForRank(rank).contains(edgeId)) {
        print("String_Node_Str","String_Node_Str",rank,"String_Node_Str",edgeId);
        containsAny=true;
        break;
      }
    }
  }
  if (!containsAny) {
    outer:     for (    int rank : ranksForIncludedTips()) {
      if (rank < workingRank || !that.tipIdSetsByRank.containsKey(rank)) {
        continue;
      }
      for (      LongSet thoseTips : that.tipIdSetsForRank(rank)) {
        for (        LongSet theseTips : this.tipIdSetsForRank(rank)) {
          if (theseTips.containsAny(thoseTips)) {
            containsAny=true;
            break outer;
          }
        }
      }
    }
  }
  return containsAny;
}
Program: 50114
Project: 50114
Buggy source:
private void processIncomingRel(Relationship r){
  children.add(r.getStartNode());
  int rank=rank(r);
  observedRanks.add(rank);
  if (!edgeSetsByRankAndEdgeId.containsKey(rank)) {
    edgeSetsByRankAndEdgeId.put(rank,new HashMap<Long,EdgeSet>());
  }
  long edgeId=edgeId(r);
  if (!edgeSetsByRankAndEdgeId.get(rank).containsKey(edgeId)) {
    edgeSetsByRankAndEdgeId.get(rank).put(edgeId,new EdgeSet(r.getEndNode(),rank,edgeId));
  }
  if (VERBOSE) {
    print("String_Node_Str",r,"String_Node_Str",rank,"String_Node_Str",edgeId);
  }
  edgeSetsByRankAndEdgeId.get(rank).get(edgeId(r)).add(r);
}

Fixed version (ground truth):
private void processIncomingRel(Relationship r){
  children.add(r.getStartNode());
  int rank=rank(r);
  observedRanks.add(rank);
  if (!edgeSetsByRankAndEdgeId.containsKey(rank)) {
    edgeSetsByRankAndEdgeId.put(rank,new HashMap<Object,EdgeSet>());
  }
  Object edgeId=edgeId(r);
  if (!edgeSetsByRankAndEdgeId.get(rank).containsKey(edgeId)) {
    edgeSetsByRankAndEdgeId.get(rank).put(edgeId,new EdgeSet(r.getEndNode(),rank,edgeId));
  }
  if (VERBOSE) {
    print("String_Node_Str",r,"String_Node_Str",rank,"String_Node_Str",edgeId);
  }
  edgeSetsByRankAndEdgeId.get(rank).get(edgeId(r)).add(r);
}
Program: 50115
Project: 50115
Buggy source:
public SourceRankTopoOrderSynthesisExpanderUsingEdgeIdsAndTipIds(){
  VERBOSE=false;
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public SourceRankTopoOrderSynthesisExpanderUsingEdgeIdsAndTipIds(){
  VERBOSE=true;
  System.out.println("String_Node_Str");
}
Program: 50116
Project: 50116
Buggy source:
/** 
 * Get the unique edge id for this relationship within its source tree. For taxonomy rels, we just use the database id of the rel (which are unique) since each taxonomy rel is only represented once in the db.
 */
private static long edgeId(Relationship r){
  return isTaxonomyRel(r) ? r.getId() : (int)r.getProperty(RelProperty.SOURCE_EDGE_ID.propertyName);
}

Fixed version (ground truth):
/** 
 * Get the unique edge id for this relationship within its source tree. For taxonomy rels, we just use the database id of the rel (which are unique) since each taxonomy rel is only represented once in the db.
 */
private static Object edgeId(Relationship r){
  return isTaxonomyRel(r) ? r.getId() : r.getProperty(RelProperty.SOURCE_EDGE_ID.propertyName);
}
Program: 50117
Project: 50117
Buggy source:
public EdgeSet(Node parent,int rank,long edgeId){
  this.rank=rank;
  this.edgeId=edgeId;
  this.parent=parent;
  info=new SynthesisSubtreeInfoUsingEdgeIds(parent);
  rels=new HashSet<Relationship>();
}

Fixed version (ground truth):
public EdgeSet(Node parent,int rank,Object edgeId){
  if (edgeId == null) {
    throw new IllegalArgumentException();
  }
  this.rank=rank;
  this.edgeId=edgeId;
  this.parent=parent;
  info=new SynthesisSubtreeInfoUsingEdgeIds(parent);
  rels=new HashSet<Relationship>();
}
Program: 50118
Project: 50118
Buggy source:
/** 
 * Whether or not this synthesis subtree contains any nodes or represents any tree edges that are also contained/represented by <tt>that</tt>. (If so, then the subtrees cannot both be included in synthesis).
 * @param that
 * @param workingRank
 * @return
 */
public boolean overlapsWith(SynthesisSubtreeInfoUsingEdgeIds that,int workingRank){
  print("String_Node_Str",this);
  print("String_Node_Str",that,"String_Node_Str");
  return this.includedNodeIds.containsAny(that.includedNodeIds) ? true : containsAnyStreeElementsOf(that,workingRank);
}

Fixed version (ground truth):
/** 
 * Whether or not this synthesis subtree contains any nodes or represents any tree edges that are also contained/represented by <tt>that</tt>. (If so, then the subtrees cannot both be included in synthesis).
 * @param that
 * @param workingRank
 * @return
 */
public boolean overlapsWith(SynthesisSubtreeInfoUsingEdgeIds that,int workingRank){
  return this.includedNodeIds.containsAny(that.includedNodeIds) ? true : containsAnyStreeElementsOf(that,workingRank);
}
Program: 50120
Project: 50120
Buggy source:
public Set<Long> edgeIdsForRank(int rank){
  return edgeIdsByRank.get(rank);
}

Fixed version (ground truth):
public Set<Object> edgeIdsForRank(int rank){
  return edgeIdsByRank.get(rank);
}
Program: 50121
Project: 50121
Buggy source:
/** 
 * trivial convenience function for code simplification.
 * @param v
 * @param m
 */
private void updateSetMap(int v,Map<Integer,Set<Long>> m){
  if (!m.containsKey(v)) {
    m.put(v,new HashSet<Long>());
  }
}

Fixed version (ground truth):
/** 
 * trivial convenience function for code simplification.
 * @param v
 * @param m
 */
private void updateSetMap(int v,Map<Integer,Set<Object>> m){
  if (!m.containsKey(v)) {
    m.put(v,new HashSet<Object>());
  }
}
Program: 50122
Project: 50122
Buggy source:
/** 
 * Whether or not this synthesis subtree contains edges/nodes representing <strong>all</strong> the same tree edges that are represented by nodes/edges in <tt>that</tt>.
 * @param that
 * @param workingRank
 * @return
 */
public boolean containsAllStreeElementsOf(SynthesisSubtreeInfoUsingEdgeIds that,int workingRank){
  boolean containsAll=true;
  for (  int rank : that.ranksForIncludedEdges()) {
    if (rank < workingRank) {
      continue;
    }
    if (!this.ranksForIncludedEdges().contains(rank)) {
      containsAll=false;
      print("String_Node_Str" + rank + "String_Node_Str");
      break;
    }
    for (    long edgeId : that.edgeIdsForRank(rank)) {
      if (!this.edgeIdsForRank(rank).contains(edgeId)) {
        containsAll=false;
        print("String_Node_Str" + edgeId + "String_Node_Str"+ rank);
        break;
      }
    }
  }
  if (containsAll) {
    for (    int rank : that.ranksForIncludedTips()) {
      if (rank < workingRank) {
        continue;
      }
      for (      LongSet thoseTips : that.tipIdSetsForRank(rank)) {
        if (!this.includedNodeIds.containsAny(thoseTips)) {
          containsAll=false;
          print("String_Node_Str" + thoseTips + "String_Node_Str"+ rank);
          break;
        }
      }
    }
  }
  return containsAll;
}

Fixed version (ground truth):
/** 
 * Whether or not this synthesis subtree contains edges/nodes representing <strong>all</strong> the same tree edges that are represented by nodes/edges in <tt>that</tt>.
 * @param that
 * @param workingRank
 * @return
 */
public boolean containsAllStreeElementsOf(SynthesisSubtreeInfoUsingEdgeIds that,int workingRank){
  boolean containsAll=true;
  for (  int rank : that.ranksForIncludedEdges()) {
    if (rank < workingRank) {
      continue;
    }
    if (!this.ranksForIncludedEdges().contains(rank)) {
      containsAll=false;
      print("String_Node_Str" + rank + "String_Node_Str");
      break;
    }
    for (    Object edgeId : that.edgeIdsForRank(rank)) {
      if (!this.edgeIdsForRank(rank).contains(edgeId)) {
        containsAll=false;
        print("String_Node_Str" + edgeId + "String_Node_Str"+ rank);
        break;
      }
    }
  }
  if (containsAll) {
    for (    int rank : that.ranksForIncludedTips()) {
      if (rank < workingRank) {
        continue;
      }
      for (      LongSet thoseTips : that.tipIdSetsForRank(rank)) {
        if (!this.includedNodeIds.containsAny(thoseTips)) {
          containsAll=false;
          print("String_Node_Str" + thoseTips + "String_Node_Str"+ rank);
          break;
        }
      }
    }
  }
  return containsAll;
}
Program: 50123
Project: 50123
Buggy source:
private void initialize(Node n){
  immediateSubtrees=new HashMap<Node,SynthesisSubtreeInfoUsingEdgeIds>();
  edgeSetsByRankAndEdgeId=new HashMap<Integer,Map<Long,EdgeSet>>();
  children=new HashSet<Node>();
  observedRanks=new HashSet<Integer>();
}

Fixed version (ground truth):
private void initialize(Node n){
  immediateSubtrees=new HashMap<Node,SynthesisSubtreeInfoUsingEdgeIds>();
  edgeSetsByRankAndEdgeId=new HashMap<Integer,Map<Object,EdgeSet>>();
  children=new HashSet<Node>();
  observedRanks=new HashSet<Integer>();
}
Program: 50124
Project: 50124
Buggy source:
public SourceRankTopoOrderSynthesisExpanderUsingEdgeIdsAndTipIds(){
  VERBOSE=true;
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public SourceRankTopoOrderSynthesisExpanderUsingEdgeIdsAndTipIds(){
  VERBOSE=false;
  System.out.println("String_Node_Str");
}
Program: 50127
Project: 50127
Buggy source:
private boolean isSubproblemRoot(Node n){
  boolean passes=n.equals(root);
  if (!passes) {
    Object ottId=n.getProperty(NodeProperty.TAX_UID.propertyName,null);
    passes=ottId == null ? false : subproblemIndex.get("String_Node_Str",ottId).hasNext();
  }
  return passes;
}

Fixed version (ground truth):
private boolean isSubproblemRoot(Node n){
  boolean passes=n.equals(root);
  if (!passes) {
    return subproblemIds.contains(Long.valueOf(((String)n.getProperty(NodeProperty.TAX_UID.propertyName,null))));
  }
  return passes;
}
Program: 50128
Project: 50128
Buggy source:
public SubproblemSynthesisExpander(SourceRankTopoOrderSynthesisExpanderUsingEdgeIdsAndTipIds subExpander,Node root) throws InstantiationException, IllegalAccessException, IOException {
  this.subExpander=subExpander;
  this.root=root;
  this.G=new GraphDatabaseAgent(root.getGraphDatabase());
  subproblemIndex=new GraphDatabaseAgent(root.getGraphDatabase()).getNodeIndex("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  TopologicalOrder subproblemRoots=new TopologicalOrder(root,RelType.TAXCHILDOF).validateWith(new Predicate<Node>(){
    @Override public boolean test(    Node n){
      return isSubproblemRoot(n);
    }
    @Override public String toString(){
      return "String_Node_Str";
    }
  }
);
  Map<Long,SynthesisSubtreeInfo> preservedSubtrees=new TreeMap<Long,SynthesisSubtreeInfo>();
  for (  Node s : subproblemRoots) {
    if (VERBOSE) {
      print("String_Node_Str",s.getProperty(NodeProperty.NAME.propertyName) + "String_Node_Str" + s.getProperty(NodeProperty.TAX_UID.propertyName,"String_Node_Str"));
    }
    Transaction tx=G.beginTx();
    try {
      subExpander.synthesizeFrom(s);
      tx.success();
    }
  finally {
      tx.finish();
    }
    childRels.putAll(subExpander.childRels);
    preservedSubtrees.put(s.getId(),subExpander.completedRootInfo());
    subExpander.reset(preservedSubtrees);
  }
}

Fixed version (ground truth):
public SubproblemSynthesisExpander(SourceRankTopoOrderSynthesisExpanderUsingEdgeIdsAndTipIds subExpander,Node root) throws InstantiationException, IllegalAccessException, IOException {
  this.subExpander=subExpander;
  this.root=root;
  this.G=new GraphDatabaseAgent(root.getGraphDatabase());
  Index<Node> subproblemIndex=new GraphDatabaseAgent(root.getGraphDatabase()).getNodeIndex("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  subproblemIds=new TreeSet<Long>();
  for (  Node n : subproblemIndex.query(new MatchAllDocsQuery())) {
    subproblemIds.add(Long.valueOf((String)n.getProperty(NodeProperty.TAX_UID.propertyName)));
  }
  if (VERBOSE) {
    print("String_Node_Str",subproblemIds.size(),"String_Node_Str",subproblemIds);
  }
  TopologicalOrder orderedSubproblems=new TopologicalOrder(root,RelType.TAXCHILDOF).validateWith(new Predicate<Node>(){
    @Override public boolean test(    Node n){
      return isSubproblemRoot(n);
    }
    @Override public String toString(){
      return "String_Node_Str";
    }
  }
);
  Map<Long,SynthesisSubtreeInfo> preservedSubtrees=new TreeMap<Long,SynthesisSubtreeInfo>();
  print("String_Node_Str");
  for (  Node s : orderedSubproblems) {
    if (VERBOSE) {
      print("String_Node_Str",s.getProperty(NodeProperty.NAME.propertyName) + "String_Node_Str" + s.getProperty(NodeProperty.TAX_UID.propertyName,"String_Node_Str"));
    }
    Transaction tx=G.beginTx();
    try {
      subExpander.synthesizeFrom(s);
      tx.success();
    }
  finally {
      tx.finish();
    }
    childRels.putAll(subExpander.childRels);
    preservedSubtrees.put(s.getId(),subExpander.completedRootInfo());
    subExpander.reset(preservedSubtrees);
  }
}
Program: 50129
Project: 50129
Buggy source:
@Override public Node next(){
  Node p=toVisit.pop();
  for (  Relationship r : p.getRelationships(Direction.INCOMING,relTypes)) {
    Node c=r.getStartNode();
    if (!observed.contains(c) && validate(c)) {
      queue(c);
    }
  }
  return p;
}

Fixed version (ground truth):
@Override public Node next(){
  Node n=next;
  loadNext();
  return n;
}
Program: 50130
Project: 50130
Buggy source:
@Override public Iterator<Node> iterator(){
  sort();
  return nodes.iterator();
}

Fixed version (ground truth):
@Override public Iterator<Node> iterator(){
  sort();
  print("String_Node_Str",nodes.size(),"String_Node_Str");
  return nodes.iterator();
}
Program: 50131
Project: 50131
Buggy source:
@Override public boolean hasNext(){
  return !toVisit.isEmpty();
}

Fixed version (ground truth):
@Override public boolean hasNext(){
  return next != null;
}
Program: 50132
Project: 50132
Buggy source:
private void sort(){
}

Fixed version (ground truth):
private void sort(){
  for (  Node n : getNodes()) {
    if (n.hasRelationship(relTypes)) {
      unmarked.add(n);
    }
  }
  while (!unmarked.isEmpty()) {
    visit(unmarked.iterator().next());
  }
}
Program: 50133
Project: 50133
Buggy source:
private void visit(Node n){
  if (temporaryMarked.contains(n)) {
    throw new IllegalArgumentException("String_Node_Str" + n);
  }
  if (unmarked.contains(n)) {
    temporaryMarked.add(n);
    for (    Relationship m : n.getRelationships(Direction.INCOMING,relTypes)) {
      visit(m.getStartNode());
    }
    unmarked.remove(n);
    temporaryMarked.remove(n);
    nodes.add(n);
    System.out.println(nodes.size() + "String_Node_Str");
  }
}

Fixed version (ground truth):
private void visit(Node n){
  if (temporaryMarked.contains(n)) {
    throw new IllegalArgumentException("String_Node_Str" + n);
  }
  if (unmarked.contains(n)) {
    temporaryMarked.add(n);
    for (    Relationship m : n.getRelationships(Direction.INCOMING,relTypes)) {
      visit(m.getStartNode());
    }
    unmarked.remove(n);
    temporaryMarked.remove(n);
    if (validate(n)) {
      nodes.add(n);
    }
  }
}
Program: 50134
Project: 50134
Buggy source:
@Override public Node next(){
  Node p=toVisit.pollFirst();
  visited.add(p.getId());
  for (  Relationship r : p.getRelationships(Direction.INCOMING,relTypes)) {
    Node c=r.getStartNode();
    if (!visited.contains(c.getId()) && validate(c)) {
      if (c.hasRelationship(Direction.INCOMING,relTypes)) {
        toVisit.addLast(c);
      }
    }
  }
  return p;
}

Fixed version (ground truth):
@Override public Node next(){
  Node p=toVisit.pollFirst();
  visited.add(p.getId());
  for (  Relationship r : p.getRelationships(Direction.INCOMING,relTypes)) {
    Node c=r.getStartNode();
    if (!visited.contains(c.getId()) && validate(c)) {
      toVisit.addLast(c);
    }
  }
  return p;
}
Program: 50135
Project: 50135
Buggy source:
public TopologicalOrder(GraphDatabaseAgent G,RelationshipType... relTypes){
  this.G=G;
  this.relTypes=relTypes;
}

Fixed version (ground truth):
public TopologicalOrder(GraphDatabaseAgent G,RelationshipType... relTypes){
  this.root=null;
  this.G=G;
  this.usingAllNodes=true;
  this.relTypes=relTypes;
}
Program: 50136
Project: 50136
Buggy source:
private void sort(){
  if (G == null && root == null) {
    throw new NullPointerException();
  }
  Iterable<Node> nodes=G == null ? validDescendants(root) : G.getAllNodes();
  for (  Node n : nodes) {
    if (n.hasRelationship(relTypes)) {
      unmarked.add(n);
    }
  }
  while (!unmarked.isEmpty()) {
    visit(unmarked.iterator().next());
  }
}

Fixed version (ground truth):
private void sort(){
}
Program: 50137
Project: 50137
Buggy source:
private void visit(Node n){
  if (temporaryMarked.contains(n)) {
    throw new IllegalArgumentException("String_Node_Str" + n);
  }
  if (unmarked.contains(n)) {
    temporaryMarked.add(n);
    for (    Relationship m : n.getRelationships(Direction.INCOMING,relTypes)) {
      visit(m.getStartNode());
    }
    unmarked.remove(n);
    temporaryMarked.remove(n);
    nodes.add(n);
    System.out.println(nodes.size() + "String_Node_Str");
  }
}

Fixed version (ground truth):
private void visit(Node n){
  long nid=n.getId();
  if (temporaryMarked.contains(nid)) {
    throw new IllegalArgumentException("String_Node_Str" + n);
  }
  if (unmarked.contains(nid)) {
    temporaryMarked.add(nid);
    for (    Relationship m : n.getRelationships(Direction.INCOMING,relTypes)) {
      visit(m.getStartNode());
    }
    unmarked.remove(nid);
    temporaryMarked.remove(nid);
    nodes.add(n);
    System.out.println(nodes.size() + "String_Node_Str");
  }
}
Program: 50139
Project: 50139
Buggy source:
/** 
 * return a graph containing a tree with N tips and nBackEdges backward edges.
 * @throws IOException 
 */
public static GraphDatabaseAgent randomTreeWithBackEdges(int nTips,int maxChildren,int nBackEdges,String dbname) throws IOException {
  if (nTips < 3) {
    throw new IllegalArgumentException();
  }
  GraphDatabaseAgent G=emptyGraph(dbname);
  createRandomNTree(G,nTips,maxChildren);
  List<Node> all=new ArrayList<Node>();
  for (  Node n : new TopologicalOrder(G,new HashSet<Relationship>(),RelType.STREECHILDOF)) {
    if (n.getId() != 0)     all.add(n);
  }
  int N=all.size() - 1;
  System.out.println(N);
  System.out.println(N - nTips);
  Transaction tx=G.beginTx();
  Random r=new Random();
  for (int i=0; i < nBackEdges; i++) {
    long p=r.nextInt(N - nTips) + 2;
    long q=all.size();
    while (p <= q) {
      q=r.nextInt(N - nTips - 1) + 1;
      System.out.println(p + "String_Node_Str" + q);
    }
    G.getNodeById(p).createRelationshipTo(G.getNodeById(q),RelType.STREECHILDOF);
  }
  tx.success();
  tx.finish();
  return G;
}

Fixed version (ground truth):
/** 
 * return a graph containing a tree with N tips and nBackEdges backward edges.
 * @throws IOException 
 */
public static GraphDatabaseAgent randomTreeWithBackEdges(int nTips,int maxChildren,int nBackEdges,String dbname) throws IOException {
  if (nTips < 3) {
    throw new IllegalArgumentException();
  }
  GraphDatabaseAgent G=emptyGraph(dbname);
  createRandomNTree(G,nTips,maxChildren);
  List<Node> all=new ArrayList<Node>();
  for (  Node n : new TopologicalOrder(G,new HashSet<Relationship>(),RelType.STREECHILDOF)) {
    if (n.getId() != 0)     all.add(n);
  }
  int N=all.size() - 1;
  System.out.println(N);
  System.out.println(N - nTips);
  Transaction tx=G.beginTx();
  Random r=new Random();
  for (int i=0; i < nBackEdges; i++) {
    Node p=G.getNodeById((long)r.nextInt(N - nTips) + nTips);
    LinkedList<Node> toVisit=new LinkedList<Node>();
    toVisit.add(p);
    List<Node> descendants=new ArrayList<Node>();
    while (toVisit.size() > 0) {
      addChildren(toVisit.pop(),descendants);
    }
    p.createRelationshipTo(descendants.get(r.nextInt(descendants.size())),RelType.STREECHILDOF);
  }
  tx.success();
  tx.finish();
  return G;
}
Program: 50140
Project: 50140
Buggy source:
public static void main(String[] args) throws IOException {
  String dbname="String_Node_Str";
  simpleTest(GraphGenerator.simpleCycle(10,dbname),1);
  simpleTest(GraphGenerator.chordedCycle(10,4,dbname),1);
  simpleTest(GraphGenerator.chainOfSimpleCycles(5,5,dbname),5);
  simpleTest(GraphGenerator.cycleOfSimpleCycles(5,5,dbname),1);
  simpleTest(GraphGenerator.randomTree(20,2,dbname),20 + 20 - 1);
  maximumCountTest(GraphGenerator.randomTreeWithBackEdges(10,2,1,dbname),18);
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  String dbname="String_Node_Str";
  simpleTest(GraphGenerator.simpleCycle(10,dbname),1);
  simpleTest(GraphGenerator.chordedCycle(10,4,dbname),1);
  simpleTest(GraphGenerator.chainOfSimpleCycles(5,5,dbname),5);
  simpleTest(GraphGenerator.cycleOfSimpleCycles(5,5,dbname),1);
  simpleTest(GraphGenerator.randomTree(20,2,dbname),20 + 20 - 1);
  int maxTips=10;
  int nReps=1000;
  Random r=new Random();
  for (int i=0; i < nReps; i++) {
    int nTips=r.nextInt(maxTips - 3) + 3;
    int maxSCCs=(2 * maxTips) - 2;
    int nBackEdges=1;
    maximumCountTest(GraphGenerator.randomTreeWithBackEdges(nTips,2,nBackEdges,dbname),maxSCCs);
  }
}
Program: 50141
Project: 50141
Buggy source:
private void visit(Node n){
  if (temporaryMarked.contains(n)) {
    throw new IllegalArgumentException("String_Node_Str" + n);
  }
  if (unmarked.contains(n)) {
    temporaryMarked.add(n);
    for (    Relationship m : n.getRelationships(Direction.INCOMING,relTypes)) {
      if (excludedRels.contains(m)) {
        visit(m.getStartNode());
      }
    }
    unmarked.remove(n);
    temporaryMarked.remove(n);
    nodes.add(n);
  }
}

Fixed version (ground truth):
private void visit(Node n){
  if (temporaryMarked.contains(n)) {
    throw new IllegalArgumentException("String_Node_Str" + n);
  }
  if (unmarked.contains(n)) {
    temporaryMarked.add(n);
    for (    Relationship m : n.getRelationships(Direction.INCOMING,relTypes)) {
      if (!excludedRels.contains(m)) {
        visit(m.getStartNode());
      }
    }
    unmarked.remove(n);
    temporaryMarked.remove(n);
    nodes.add(n);
  }
}
Program: 50142
Project: 50142
Buggy source:
public Iterable<Long> findBestNonOverlappingGraph(Long[] relIds){
  boolean trivialTestCase=false;
  if (trivialTestCase) {
    return Arrays.asList(relIds);
  }
  WeightedUndirectedGraph G=new WeightedUndirectedGraph();
  for (  long relId : relIds) {
    G.addNode(relId,getWeight(relId));
  }
  for (int i=0; i < relIds.length; i++) {
    long a=getStartNodeId(relIds[i]);
    for (int j=i + 1; j < relIds.length; j++) {
      long b=getStartNodeId(relIds[j]);
      if (nodeMrca.get(a).containsAny(nodeMrca.get(b))) {
        G.getNode(a).attachTo(b);
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public Iterable<Long> findBestNonOverlappingGraph(Long[] relIds){
  boolean trivialTestCase=false;
  if (trivialTestCase) {
    return Arrays.asList(relIds);
  }
  WeightedUndirectedGraph G=new WeightedUndirectedGraph();
  for (  long relId : relIds) {
    G.addNode(relId,getWeight(relId));
  }
  for (int i=0; i < relIds.length; i++) {
    long a=getStartNodeId(relIds[i]);
    for (int j=i + 1; j < relIds.length; j++) {
      long b=getStartNodeId(relIds[j]);
      if (nodeMrcaTipsAndInternal.get(a).containsAny(nodeMrcaTipsAndInternal.get(b))) {
        G.getNode(a).attachTo(b);
      }
    }
  }
  return null;
}
Program: 50143
Project: 50143
Buggy source:
/** 
 * simple weight based only on the size of the mrca set of the node 
 */
private int getWeight(long id){
  TLongBitArraySet m=nodeMrca.get(id);
  if (m == null) {
    return 1;
  }
 else {
    return m.size();
  }
}

Fixed version (ground truth):
/** 
 * simple weight based only on the size of the mrca set of the node 
 */
private int getWeight(long id){
  TLongBitArraySet m=nodeMrcaTipsAndInternal.get(id);
  if (m == null) {
    return 1;
  }
 else {
    return m.size();
  }
}
Program: 50144
Project: 50144
Buggy source:
/** 
 * This is the simplest node scoring criterion we could come up with: just the number of descendants. Joseph has done some work coming up with a better one that included the structure of the tree.
 * @param node
 * @return
 */
private double getScoreNodeCount(Relationship rel){
  return nodeMrca.get(rel.getStartNode().getId()).cardinality();
}

Fixed version (ground truth):
/** 
 * This is the simplest node scoring criterion we could come up with: just the number of descendants. Joseph has done some work coming up with a better one that included the structure of the tree.
 * @param node
 * @return
 */
private double getScoreNodeCount(Relationship rel){
  return nodeMrcaTipsAndInternal.get(rel.getStartNode().getId()).cardinality();
}
Program: 50146
Project: 50146
Buggy source:
/** 
 * For each candidate rel r, we must check whether or not setToUpdate contains *any* rels which are completely contained by r. If this is true, and if r does not conflict with any other rels in setToUpdate, then we return a new set that contains r, all of the rels from setToUpdate that are not contained by r and do not overlap with r, and none of the rels from setToUpdate that are completely contained by r.
 */
private Set<Relationship> updateSet(Relationship candidate,Set<Relationship> setToUpdate){
  Set<Relationship> updated=new HashSet<Relationship>();
  Set<Relationship> containedByCandidate=new HashSet<Relationship>();
  boolean addCandidate=true;
  for (  Relationship s : setToUpdate) {
    if (ancestorOf(s,candidate)) {
      containedByCandidate.add(s);
      if (VERBOSE) {
        print("String_Node_Str",candidate,"String_Node_Str",s);
      }
    }
 else     if (overlapsWith(candidate,s)) {
      addCandidate=false;
      if (VERBOSE) {
        print("String_Node_Str",candidate,"String_Node_Str",s);
      }
      break;
    }
 else {
      updated.add(s);
    }
  }
  if (addCandidate) {
    if (VERBOSE) {
      print("String_Node_Str",candidate,"String_Node_Str");
    }
    updated.add(candidate);
  }
 else {
    if (VERBOSE) {
      print("String_Node_Str");
    }
    updated=setToUpdate;
  }
  if (VERBOSE) {
    print();
  }
  return updated;
}

Fixed version (ground truth):
/** 
 * For each candidate rel r, we must check whether or not setToUpdate contains *any* rels which are completely contained by r. If this is true, and if r does not conflict with any other rels in setToUpdate, then we return a new set that contains r, all of the rels from setToUpdate that are not contained by r and do not overlap with r, and none of the rels from setToUpdate that are completely contained by r.
 */
private Set<Relationship> updateSet(Relationship candidate,Set<Relationship> setToUpdate){
  if (VERBOSE) {
    print("String_Node_Str",candidate,"String_Node_Str",mrcaTips(candidate.getStartNode()));
  }
  Set<Relationship> updated=new HashSet<Relationship>();
  Set<Relationship> containedByCandidate=new HashSet<Relationship>();
  boolean addCandidate=true;
  for (  Relationship s : setToUpdate) {
    if (VERBOSE) {
      print("String_Node_Str",s,"String_Node_Str",mrcaTips(s.getStartNode()));
    }
    if (containsAllTips(s,candidate)) {
      containedByCandidate.add(s);
      if (VERBOSE) {
        print("String_Node_Str",candidate,"String_Node_Str",s);
      }
    }
 else     if (overlapsWith(candidate,s)) {
      addCandidate=false;
      if (VERBOSE) {
        print("String_Node_Str",candidate,"String_Node_Str",s);
      }
      break;
    }
 else {
      updated.add(s);
    }
  }
  if (addCandidate) {
    if (VERBOSE) {
      print("String_Node_Str",candidate,"String_Node_Str");
    }
    updated.add(candidate);
  }
 else {
    if (VERBOSE) {
      print("String_Node_Str");
    }
    updated=setToUpdate;
  }
  if (VERBOSE) {
    print();
  }
  return updated;
}
Program: 50147
Project: 50147
Buggy source:
private int nodeCount(Set<Relationship> rels){
  int n=0;
  for (  Relationship r : rels) {
    n+=mrcaTipsAndInternal(r.getId()).size();
  }
  return n;
}

Fixed version (ground truth):
private int nodeCount(Set<Relationship> rels){
  int n=0;
  for (  Relationship r : rels) {
    n+=mrcaTipsAndInternal(r.getStartNode()).size();
  }
  return n;
}
Program: 50148
Project: 50148
Buggy source:
/** 
 * Returns true if and only if r contains no descendant tips that are shared by any of the rels in others.<br><br>
 */
private boolean overlapsWith(Relationship r,Relationship s){
  return mrcaTipsAndInternal(s.getId()).containsAny(mrcaTipsAndInternal(r.getId()));
}

Fixed version (ground truth):
/** 
 * Returns true if and only if r contains no descendant tips that are shared by any of the rels in others.<br><br>
 */
private boolean overlapsWith(Relationship r,Relationship s){
  return mrcaTipsAndInternal(s.getStartNode()).containsAny(mrcaTipsAndInternal(r.getStartNode()));
}
Program: 50149
Project: 50149
Buggy source:
/** 
 * Record the specified rels as the selected set for the given node.
 * @param n
 * @param bestRelIds
 */
private void recordRels(Node n,Iterable<Relationship> bestRels){
  TLongBitArraySet descendants=new TLongBitArraySet();
  HashSet<Relationship> incomingRels=new HashSet<Relationship>();
  for (  Relationship r : bestRels) {
    long childId=r.getStartNode().getId();
    incomingRels.add(r);
    descendants.add(childId);
    descendants.addAll(nodeMrca.get(childId));
    if (VERBOSE) {
      print("String_Node_Str" + childId + "String_Node_Str"+ nodeMrca.get(childId)+ "String_Node_Str"+ n.getId()+ "String_Node_Str");
    }
  }
  long nodeId=n.getId();
  descendants.add(nodeId);
  nodeMrca.put(nodeId,descendants);
  childRels.put(nodeId,incomingRels);
  if (VERBOSE) {
    print("String_Node_Str");
    print("String_Node_Str" + n.getId() + "String_Node_Str"+ nodeMrca.get(n.getId()));
    print("String_Node_Str" + n.getId() + "String_Node_Str"+ childRels.get(n.getId()));
  }
  ;
}

Fixed version (ground truth):
/** 
 * Record the specified rels as the selected set for the given node.
 * @param n
 * @param bestRelIds
 */
private void recordRels(Node n,Iterable<Relationship> bestRels){
  TLongBitArraySet descendants=new TLongBitArraySet();
  TLongBitArraySet descendantTips=new TLongBitArraySet();
  HashSet<Relationship> incomingRels=new HashSet<Relationship>();
  for (  Relationship r : bestRels) {
    long childId=r.getStartNode().getId();
    incomingRels.add(r);
    descendants.add(childId);
    descendants.addAll(nodeMrcaTipsAndInternal.get(childId));
    descendantTips.addAll(nodeMrcaTips.get(childId));
    if (VERBOSE) {
      print("String_Node_Str" + childId + "String_Node_Str"+ nodeMrcaTipsAndInternal.get(childId)+ "String_Node_Str"+ n.getId()+ "String_Node_Str");
    }
  }
  if (!n.hasRelationship(Direction.INCOMING,RelType.STREECHILDOF,RelType.TAXCHILDOF)) {
    descendantTips.add(n.getId());
  }
  long nodeId=n.getId();
  descendants.add(nodeId);
  nodeMrcaTipsAndInternal.put(nodeId,descendants);
  nodeMrcaTips.put(nodeId,descendantTips);
  childRels.put(nodeId,incomingRels);
  if (VERBOSE) {
    print("String_Node_Str");
    print("String_Node_Str" + n.getId() + "String_Node_Str"+ nodeMrcaTipsAndInternal.get(n.getId()));
    print("String_Node_Str" + n.getId() + "String_Node_Str"+ childRels.get(n.getId()));
  }
  ;
}
Program: 50150
Project: 50150
Buggy source:
/** 
 * Get *all* the graph nodes--tips as well as internal--that are descended from the start node of the  passed relId in the synthetic topology. <strong>Clarification:</strong> The argument should be a  neo4j relationship id.
 * @param rel
 * @return
 */
TLongBitArraySet mrcaTipsAndInternal(Long relId){
  return nodeMrca.get(G.getRelationshipById(relId).getStartNode().getId());
}

Fixed version (ground truth):
/** 
 * Get *all* the graph nodes--tips as well as internal--that are descended from the start node of the  passed relId in the synthetic topology. <strong>Clarification:</strong> The argument should be a  neo4j relationship id.
 * @param rel
 * @return
 */
TLongBitArraySet mrcaTipsAndInternal(Node n){
  return nodeMrcaTipsAndInternal.get(n.getId());
}
Program: 50151
Project: 50151
Buggy source:
/** 
 * Return a list containing all the *graph tip nodes* (which will be terminal taxa if taxonomy is being used) that are descended from the child node of this relationship. This should be used for assessing taxonomic overlap among nodes.<br><br> WARNING: this may not provide the expected results when taxonomy nodes are ancestors/descendants of a given node: we don't update mrca properties to contain taxonomy so it is possible for a node x to have descendant tips that are not in x.mrca!
 * @param rel
 * @return
 */
long[] mrcaTips(Relationship rel){
  return (long[])rel.getStartNode().getProperty(NodeProperty.MRCA.propertyName);
}

Fixed version (ground truth):
/** 
 * Get *all* the graph nodes--tips as well as internal--that are descended from the start node of the  passed relId in the synthetic topology. <strong>Clarification:</strong> The argument should be a  neo4j relationship id.
 * @param rel
 * @return
 */
TLongBitArraySet mrcaTips(Node n){
  return nodeMrcaTips.get(n.getId());
}
Program: 50153
Project: 50153
Buggy source:
private Node createNode(TLongBipartition b){
  Node node=gdb.createNode();
  if (VERBOSE) {
    System.out.println(node);
  }
  if (USING_TAXONOMY) {
    TLongBipartition tlb=getExpandedTaxonomyBipart(b);
    node.setProperty(NodeProperty.MRCA.propertyName,tlb.ingroup().toArray());
    node.setProperty(NodeProperty.OUTMRCA.propertyName,tlb.outgroup().toArray());
  }
 else {
    node.setProperty(NodeProperty.MRCA.propertyName,b.ingroup().toArray());
    node.setProperty(NodeProperty.OUTMRCA.propertyName,b.outgroup().toArray());
  }
  graphNodeForBipart.put(b,node);
  bipartForGraphNode.put(node,b);
  return node;
}

Fixed version (ground truth):
private Node createNode(TLongBipartition b){
  Node node=gdb.createNode();
  if (VERBOSE) {
    System.out.println(node);
  }
  if (USING_TAXONOMY) {
    TLongBipartition tlb=getExpandedTaxonomyBipart(b);
    bipartForGraphNodeExploded.put(node,tlb);
    graphNodeForBipartExploded.put(tlb,node);
    node.setProperty(NodeProperty.MRCA.propertyName,tlb.ingroup().toArray());
    node.setProperty(NodeProperty.OUTMRCA.propertyName,tlb.outgroup().toArray());
  }
 else {
    node.setProperty(NodeProperty.MRCA.propertyName,b.ingroup().toArray());
    node.setProperty(NodeProperty.OUTMRCA.propertyName,b.outgroup().toArray());
  }
  graphNodeForBipart.put(b,node);
  bipartForGraphNode.put(node,b);
  return node;
}