Program: 172337
Project: 172337
Buggy source:
/** 
 * Add pseudo files to a folder so that they appear in a folder search
 * @param sess SrvSession
 * @param tree TreeConnection
 * @param path String
 * @return int
 */
public int addPseudoFilesToFolder(SrvSession sess,TreeConnection tree,String path){
  int pseudoCnt=0;
  ContentContext ctx=(ContentContext)tree.getContext();
  FileState fstate=getStateForPath(ctx,path);
  if (fstate.hasPseudoFiles())   return 0;
  boolean isCIFS=sess instanceof SMBSrvSession;
  if (isCIFS && ctx.hasDragAndDropApp()) {
    if (fstate == null)     ctx.getStateTable().findFileState(path,true,true);
    String[] allPaths=FileName.splitAllPaths(path);
    String lastPath=allPaths[allPaths.length - 1].toUpperCase();
    if (lastPath.startsWith("String_Node_Str") && fstate.hasPseudoFiles() == false) {
      fstate.addPseudoFile(ctx.getDragAndDropApp());
      pseudoCnt++;
      if (logger.isInfoEnabled())       logger.info("String_Node_Str" + path);
    }
  }
  if (isCIFS && ctx.hasURLFile() && fstate.getNodeRef() != null) {
    StringBuilder urlStr=new StringBuilder();
    urlStr.append("String_Node_Str");
    urlStr.append("String_Node_Str");
    urlStr.append(ctx.getURLPrefix());
    urlStr.append("String_Node_Str");
    urlStr.append(fstate.getNodeRef().getId());
    urlStr.append("String_Node_Str");
    byte[] urlData=urlStr.toString().getBytes();
    MemoryPseudoFile urlFile=new MemoryPseudoFile(ctx.getURLFileName(),urlData);
    fstate.addPseudoFile(urlFile);
    pseudoCnt++;
    if (logger.isInfoEnabled())     logger.info("String_Node_Str" + path);
  }
  return pseudoCnt;
}

Fixed version (ground truth):
/** 
 * Add pseudo files to a folder so that they appear in a folder search
 * @param sess SrvSession
 * @param tree TreeConnection
 * @param path String
 * @return int
 */
public int addPseudoFilesToFolder(SrvSession sess,TreeConnection tree,String path){
  int pseudoCnt=0;
  ContentContext ctx=(ContentContext)tree.getContext();
  FileState fstate=getStateForPath(ctx,path);
  if (fstate.hasPseudoFiles())   return 0;
  boolean isCIFS=sess instanceof SMBSrvSession;
  if (isCIFS && ctx.hasDragAndDropApp()) {
    if (fstate == null)     ctx.getStateTable().findFileState(path,true,true);
    String[] allPaths=FileName.splitAllPaths(path);
    String lastPath=allPaths[allPaths.length - 1].toUpperCase();
    if (lastPath.startsWith("String_Node_Str") && fstate.hasPseudoFiles() == false) {
      fstate.addPseudoFile(ctx.getDragAndDropApp());
      pseudoCnt++;
      if (logger.isInfoEnabled())       logger.info("String_Node_Str" + path);
    }
  }
  if (isCIFS && ctx.hasURLFile()) {
    if (fstate.getNodeRef() != null) {
      StringBuilder urlStr=new StringBuilder();
      urlStr.append("String_Node_Str");
      urlStr.append("String_Node_Str");
      urlStr.append(ctx.getURLPrefix());
      urlStr.append("String_Node_Str");
      urlStr.append(fstate.getNodeRef().getId());
      urlStr.append("String_Node_Str");
      byte[] urlData=urlStr.toString().getBytes();
      MemoryPseudoFile urlFile=new MemoryPseudoFile(ctx.getURLFileName(),urlData);
      fstate.addPseudoFile(urlFile);
      pseudoCnt++;
      if (logger.isInfoEnabled())       logger.info("String_Node_Str" + path);
    }
  }
  return pseudoCnt;
}