Program: 17951
Project: 17951
Buggy source:
private void doExpansion(NameInfo origNameInfo,QueryNode node,List<QueryNode> parentChildren,int[] level) throws QueryNodeException {
  if (node instanceof TextableQueryNode) {
    level[0]=level[0] + 1;
    if (node instanceof FuzzyQueryNode || node instanceof RegexpQueryNode || node instanceof WildcardQueryNode) {
      return;
    }
    FieldQueryNode fqn=((FieldQueryNode)node);
    if (fields.containsKey(fqn.getFieldAsString())) {
      if (level[0] == 1 && !isLongForm(origNameInfo.origName)) {
        try {
          String[] synonyms=getSynonyms(origNameInfo.origName);
          if (synonyms != null) {
            for (            String syn : synonyms) {
              parentChildren.add(new FieldQueryNode(fqn.getField(),syn,fqn.getBegin(),fqn.getEnd()));
            }
          }
        }
 catch (        IOException e) {
          throw new QueryNodeException(new MessageImpl("String_Node_Str" + e.getMessage()));
        }
      }
      String v=fqn.getTextAsString();
      String[] nameParts=fqn.getTextAsString().split("String_Node_Str");
      if (nameParts.length == 1) {
        if (nameParts.length < origNameInfo.noOfParts)         return;
        if (origNameInfo.containsOnlySurname) {
          parentChildren.add(new PrefixWildcardQueryNode(fqn.getField(),v + "String_Node_Str",fqn.getBegin(),fqn.getEnd()));
        }
 else {
        }
      }
 else {
        if (nameParts.length < origNameInfo.noOfParts)         return;
        if (origNameInfo.containsOnlySurname) {
          parentChildren.add(new PrefixWildcardQueryNode(fqn.getField(),v + "String_Node_Str",fqn.getBegin(),fqn.getEnd()));
        }
 else {
          if (origNameInfo.lastPartWasAcronym) {
            if (nameParts[nameParts.length - 1].length() == 1) {
              parentChildren.add(new PrefixWildcardQueryNode(fqn.getField(),v + "String_Node_Str",fqn.getBegin(),fqn.getEnd()));
            }
 else {
              parentChildren.add(new PrefixWildcardQueryNode(fqn.getField(),v + "String_Node_Str",fqn.getBegin(),fqn.getEnd()));
            }
          }
 else {
            parentChildren.add(new PrefixWildcardQueryNode(fqn.getField(),v + "String_Node_Str",fqn.getBegin(),fqn.getEnd()));
          }
        }
        if (regexIsPossible(nameParts,origNameInfo.parts)) {
          StringBuffer nn=new StringBuffer();
          nn.append(nameParts[0]);
          for (int i=1; i < nameParts.length - 1; i++) {
            if (nameParts[i].length() == 1 && origNameInfo.parts[i].length() == 1) {
              nn.append("String_Node_Str" + nameParts[i] + "String_Node_Str");
            }
 else {
              nn.append("String_Node_Str" + nameParts[i]);
            }
          }
          nn.append("String_Node_Str" + nameParts[nameParts.length - 1]);
          parentChildren.add(new AqpAdsabsRegexQueryNode(fqn.getField(),nn.toString(),fqn.getBegin(),fqn.getEnd()));
          parentChildren.add(new AqpAdsabsRegexQueryNode(fqn.getField(),nn.toString() + "String_Node_Str",fqn.getBegin(),fqn.getEnd()));
        }
      }
      return;
    }
  }
  if (!node.isLeaf())   expandNodes(node,origNameInfo,level);
}

Fixed version (ground truth):
private void doExpansion(NameInfo origNameInfo,QueryNode node,List<QueryNode> parentChildren,int[] level) throws QueryNodeException {
  if (node instanceof TextableQueryNode) {
    level[0]=level[0] + 1;
    if (node instanceof FuzzyQueryNode || node instanceof RegexpQueryNode || node instanceof WildcardQueryNode) {
      return;
    }
    FieldQueryNode fqn=((FieldQueryNode)node);
    if (fields.containsKey(fqn.getFieldAsString())) {
      if (level[0] == 1 && !isLongForm(origNameInfo.origName)) {
        try {
          String[] synonyms=getSynonyms(origNameInfo.origName);
          if (synonyms != null) {
            for (            String syn : synonyms) {
              parentChildren.add(new FieldQueryNode(fqn.getField(),syn,fqn.getBegin(),fqn.getEnd()));
            }
          }
        }
 catch (        IOException e) {
          throw new QueryNodeException(new MessageImpl("String_Node_Str" + e.getMessage()));
        }
      }
      String v=fqn.getTextAsString();
      String[] nameParts=AuthorUtils.splitName(fqn.getTextAsString());
      if (nameParts.length == 1) {
        if (nameParts.length < origNameInfo.noOfParts)         return;
        if (origNameInfo.containsOnlySurname) {
          parentChildren.add(new PrefixWildcardQueryNode(fqn.getField(),v + "String_Node_Str",fqn.getBegin(),fqn.getEnd()));
        }
 else {
        }
      }
 else {
        if (nameParts.length < origNameInfo.noOfParts)         return;
        if (origNameInfo.containsOnlySurname) {
          parentChildren.add(new PrefixWildcardQueryNode(fqn.getField(),v + "String_Node_Str",fqn.getBegin(),fqn.getEnd()));
        }
 else {
          if (origNameInfo.lastPartWasAcronym) {
            if (nameParts[nameParts.length - 1].length() == 1) {
              parentChildren.add(new PrefixWildcardQueryNode(fqn.getField(),v + "String_Node_Str",fqn.getBegin(),fqn.getEnd()));
            }
 else {
              parentChildren.add(new PrefixWildcardQueryNode(fqn.getField(),v + "String_Node_Str",fqn.getBegin(),fqn.getEnd()));
            }
          }
 else {
            parentChildren.add(new PrefixWildcardQueryNode(fqn.getField(),v + "String_Node_Str",fqn.getBegin(),fqn.getEnd()));
          }
        }
        if (regexIsPossible(nameParts,origNameInfo.parts)) {
          StringBuffer nn=new StringBuffer();
          nn.append(nameParts[0]);
          for (int i=1; i < nameParts.length - 1; i++) {
            if (nameParts[i].length() == 1 && origNameInfo.parts[i].length() == 1) {
              nn.append("String_Node_Str" + nameParts[i] + "String_Node_Str");
            }
 else {
              nn.append("String_Node_Str" + nameParts[i]);
            }
          }
          nn.append("String_Node_Str" + nameParts[nameParts.length - 1]);
          parentChildren.add(new AqpAdsabsRegexQueryNode(fqn.getField(),nn.toString(),fqn.getBegin(),fqn.getEnd()));
          parentChildren.add(new AqpAdsabsRegexQueryNode(fqn.getField(),nn.toString() + "String_Node_Str",fqn.getBegin(),fqn.getEnd()));
        }
      }
      return;
    }
  }
  if (!node.isLeaf())   expandNodes(node,origNameInfo,level);
}