Program: 98325
Project: 98325
Buggy source:
private Boolean checkAll(AbstractParseNode n,String v,IStrategoTerm constraint,AbstractParseNode[] kids,Map<String,Object> env){
  if (atParseTime)   return noValue();
  Stack<AbstractParseNode> all=new Stack<AbstractParseNode>();
  all.push(n);
  String sort=null;
  while (!all.isEmpty()) {
    AbstractParseNode next=all.pop();
    if (sort == null && !next.isAmbNode() && !next.isParseProductionNode())     sort=sortOfNode(next);
    if (next.isAmbNode()) {
      boolean left=checkAll(next.getChildren()[0],v,constraint,kids,env);
      boolean right=checkAll(next.getChildren()[1],v,constraint,kids,env);
      if (!left && !right)       return false;
      if (left && !right) {
        ((ParseNode)next).disambiguate(next.getChildren()[0]);
        disambiguationCount++;
      }
      if (!left && right) {
        ((ParseNode)next).disambiguate(next.getChildren()[1]);
        disambiguationCount++;
      }
    }
 else     if (next.isParseProductionNode() || sort != null && !sort.equals(sortOfNode(next)) || !isListNode(next)) {
      Object old=env.get(v);
      env.put(v,next);
      try {
        Boolean b=evalConstraint(constraint.getSubterm(2),kids,env,Boolean.class);
        if (b != NO_VALUE && !b)         return false;
      }
  finally {
        if (old == null)         env.remove(v);
 else         env.put(v,old);
      }
    }
 else     for (int j=next.getChildren().length - 1; j >= 0; j--) {
      AbstractParseNode kid=next.getChildren()[j];
      if (kid.isAmbNode() || sort.equals(sortOfNode(kid)))       all.push(kid);
    }
  }
  return true;
}

Fixed version (ground truth):
private Boolean checkAll(AbstractParseNode n,String v,IStrategoTerm constraint,AbstractParseNode[] kids,Map<String,Object> env){
  if (atParseTime)   return noValue();
  Stack<AbstractParseNode> all=new Stack<AbstractParseNode>();
  all.push(n);
  String sort=null;
  while (!all.isEmpty()) {
    AbstractParseNode next=all.pop();
    if (sort == null && !next.isAmbNode() && !next.isParseProductionNode())     sort=sortOfNode(next);
    if (next.isAmbNode()) {
      boolean left=checkAll(next.getChildren()[0],v,constraint,kids,env);
      boolean right=checkAll(next.getChildren()[1],v,constraint,kids,env);
      if (!left && !right)       return false;
      if (left && !right) {
        ((ParseNode)next).disambiguate(next.getChildren()[0]);
        disambiguationCount++;
      }
      if (!left && right) {
        ((ParseNode)next).disambiguate(next.getChildren()[1]);
        disambiguationCount++;
      }
    }
 else     if (next.isParseProductionNode() || sort != null && !sort.equals(sortOfNode(next)) || !isListNode(next)) {
      Object old=env.get(v);
      env.put(v,next);
      try {
        Boolean b=evalConstraint(constraint,kids,env,Boolean.class);
        if (b != NO_VALUE && !b)         return false;
      }
  finally {
        if (old == null)         env.remove(v);
 else         env.put(v,old);
      }
    }
 else     for (int j=next.getChildren().length - 1; j >= 0; j--) {
      AbstractParseNode kid=next.getChildren()[j];
      if (kid.isAmbNode() || sort.equals(sortOfNode(kid)))       all.push(kid);
    }
  }
  return true;
}