Program: 25358
Project: 25358
Buggy source:
public void getJoinCond(ASTNode node){
  if (node == null) {
    return;
  }
  try {
    int rootType=node.getToken().getType();
    if (rootType == TOK_JOIN || rootType == TOK_LEFTOUTERJOIN || rootType == TOK_RIGHTOUTERJOIN || rootType == TOK_FULLOUTERJOIN || rootType == TOK_LEFTSEMIJOIN || rootType == TOK_UNIQUEJOIN) {
      ASTNode left=(ASTNode)node.getChild(0);
      ASTNode right=(ASTNode)node.getChild(1);
      String joinType="String_Node_Str";
      String JoinToken=node.getToken().getText();
      if (JoinToken.equals("String_Node_Str")) {
        joinType="String_Node_Str";
      }
 else       if (JoinToken.equals("String_Node_Str")) {
        joinType="String_Node_Str";
      }
 else       if (JoinToken.equals("String_Node_Str")) {
        joinType="String_Node_Str";
      }
 else       if (JoinToken.equals("String_Node_Str")) {
        joinType="String_Node_Str";
      }
 else       if (JoinToken.equals("String_Node_Str")) {
        joinType="String_Node_Str";
      }
 else       if (JoinToken.equals("String_Node_Str")) {
        joinType="String_Node_Str";
      }
 else {
        LOG.info("String_Node_Str" + JoinToken);
      }
      String joinCond="String_Node_Str";
      if (node.getChildCount() > 2) {
        joinCond=HQLParser.getString((ASTNode)node.getChild(2));
      }
      String joinClause=joinType.concat(HQLParser.getString(right)).concat("String_Node_Str").concat(joinCond);
      joinCondition.append("String_Node_Str").append(joinClause);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  for (int i=0; i < node.getChildCount(); i++) {
    ASTNode child=(ASTNode)node.getChild(i);
    getJoinCond(child);
  }
}

Fixed version (ground truth):
public void getJoinCond(ASTNode node){
  if (node == null) {
    return;
  }
  try {
    int rootType=node.getToken().getType();
    String rightTable="String_Node_Str";
    if (rootType == TOK_JOIN || rootType == TOK_LEFTOUTERJOIN || rootType == TOK_RIGHTOUTERJOIN || rootType == TOK_FULLOUTERJOIN || rootType == TOK_LEFTSEMIJOIN || rootType == TOK_UNIQUEJOIN) {
      ASTNode left=(ASTNode)node.getChild(0);
      ASTNode right=(ASTNode)node.getChild(1);
      rightTable=getTable(right);
      String joinType="String_Node_Str";
      String joinFilter="String_Node_Str";
      String JoinToken=node.getToken().getText();
      if (JoinToken.equals("String_Node_Str")) {
        joinType="String_Node_Str";
      }
 else       if (JoinToken.equals("String_Node_Str")) {
        joinType="String_Node_Str";
      }
 else       if (JoinToken.equals("String_Node_Str")) {
        joinType="String_Node_Str";
      }
 else       if (JoinToken.equals("String_Node_Str")) {
        joinType="String_Node_Str";
      }
 else       if (JoinToken.equals("String_Node_Str")) {
        joinType="String_Node_Str";
      }
 else       if (JoinToken.equals("String_Node_Str")) {
        joinType="String_Node_Str";
      }
 else {
        LOG.info("String_Node_Str" + JoinToken);
      }
      if (node.getChildCount() > 2) {
        joinFilter=HQLParser.getString((ASTNode)node.getChild(2));
      }
      joinCondition.append("String_Node_Str").append(joinType).append("String_Node_Str").append(rightTable).append("String_Node_Str").append(joinFilter).append("String_Node_Str");
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  for (int i=0; i < node.getChildCount(); i++) {
    ASTNode child=(ASTNode)node.getChild(i);
    getJoinCond(child);
  }
}