Program: 168796
Project: 168796
Buggy source:
private void renderJoinNode(StringBuilder sb,JoinAliasInfo joinBase,JoinNode node,String aliasPrefix,boolean renderFetches,Set<JoinNode> nodesToFetch){
  if (!renderedJoins.contains(node)) {
    final boolean fetch=nodesToFetch.contains(node) && renderFetches;
    if (node.isQualifiedJoin() && !fetch) {
      renderedJoins.add(node);
      return;
    }
    if (node.isTreatedJoinNode()) {
      renderedJoins.add(node);
      return;
    }
switch (node.getJoinType()) {
case INNER:
      sb.append("String_Node_Str");
    break;
case LEFT:
  sb.append("String_Node_Str");
break;
case RIGHT:
sb.append("String_Node_Str");
break;
default :
throw new IllegalArgumentException("String_Node_Str" + node.getJoinType());
}
if (fetch) {
sb.append("String_Node_Str");
}
if (aliasPrefix != null) {
sb.append(aliasPrefix);
}
renderJoinPath(sb,joinBase,node);
sb.append(' ');
if (aliasPrefix != null) {
sb.append(aliasPrefix);
}
sb.append(node.getAliasInfo().getAlias());
renderedJoins.add(node);
if (node.getOnPredicate() != null && !node.getOnPredicate().getChildren().isEmpty()) {
sb.append(joinRestrictionKeyword);
sb.append('(');
queryGenerator.setClauseType(ClauseType.JOIN);
queryGenerator.setQueryBuffer(sb);
SimpleQueryGenerator.BooleanLiteralRenderingContext oldBooleanLiteralRenderingContext=queryGenerator.setBooleanLiteralRenderingContext(SimpleQueryGenerator.BooleanLiteralRenderingContext.PREDICATE);
queryGenerator.setRenderedJoinNodes(renderedJoins);
node.getOnPredicate().accept(queryGenerator);
queryGenerator.setRenderedJoinNodes(null);
queryGenerator.setBooleanLiteralRenderingContext(oldBooleanLiteralRenderingContext);
queryGenerator.setClauseType(null);
sb.append(')');
}
}
}

Fixed version (ground truth):
private void renderJoinNode(StringBuilder sb,JoinAliasInfo joinBase,JoinNode node,String aliasPrefix,boolean renderFetches,Set<JoinNode> nodesToFetch,List<String> whereConjuncts){
  if (!renderedJoins.contains(node)) {
    final boolean fetch=nodesToFetch.contains(node) && renderFetches;
    if (node.isQualifiedJoin() && !fetch) {
      renderedJoins.add(node);
      return;
    }
    if (node.isTreatedJoinNode()) {
      renderedJoins.add(node);
      return;
    }
switch (node.getJoinType()) {
case INNER:
      sb.append("String_Node_Str");
    break;
case LEFT:
  sb.append("String_Node_Str");
break;
case RIGHT:
sb.append("String_Node_Str");
break;
default :
throw new IllegalArgumentException("String_Node_Str" + node.getJoinType());
}
if (fetch) {
sb.append("String_Node_Str");
}
if (aliasPrefix != null) {
sb.append(aliasPrefix);
}
String onCondition=renderJoinPath(sb,joinBase,node,whereConjuncts);
sb.append(' ');
if (aliasPrefix != null) {
sb.append(aliasPrefix);
}
sb.append(node.getAliasInfo().getAlias());
renderedJoins.add(node);
if (node.getOnPredicate() != null && !node.getOnPredicate().getChildren().isEmpty()) {
sb.append(joinRestrictionKeyword);
sb.append('(');
if (onCondition != null) {
sb.append(onCondition).append("String_Node_Str");
}
queryGenerator.setClauseType(ClauseType.JOIN);
queryGenerator.setQueryBuffer(sb);
SimpleQueryGenerator.BooleanLiteralRenderingContext oldBooleanLiteralRenderingContext=queryGenerator.setBooleanLiteralRenderingContext(SimpleQueryGenerator.BooleanLiteralRenderingContext.PREDICATE);
queryGenerator.setRenderedJoinNodes(renderedJoins);
node.getOnPredicate().accept(queryGenerator);
queryGenerator.setRenderedJoinNodes(null);
queryGenerator.setBooleanLiteralRenderingContext(oldBooleanLiteralRenderingContext);
queryGenerator.setClauseType(null);
sb.append(')');
}
 else if (onCondition != null) {
sb.append(joinRestrictionKeyword);
sb.append('(');
sb.append(onCondition);
sb.append(')');
}
}
}