Program: 126097
Project: 126097
Buggy source:
/** 
 * DOC nrousseau Comment method "getFolder".
 * @param repositoryObjectType
 * @param path
 * @return
 */
private RepositoryNode getFolder(ERepositoryObjectType currentType,String path,List<IRepositoryNode> rootNodes){
  if (path == null || path.isEmpty()) {
    return null;
  }
  RepositoryNode folderNode=null;
  String folderName;
  String remainingPath=path;
  if (path.contains("String_Node_Str")) {
    folderName=path.substring(0,path.indexOf("String_Node_Str"));
    remainingPath=path.substring(path.indexOf("String_Node_Str") + 1);
  }
 else {
    folderName=path;
    remainingPath=null;
  }
  for (  IRepositoryNode node : rootNodes) {
    if (node.getType() == ENodeType.SIMPLE_FOLDER && node.getProperties(EProperties.CONTENT_TYPE).equals(currentType)) {
      if (node.getProperties(EProperties.LABEL).equals(folderName)) {
        folderNode=(RepositoryNode)node;
        break;
      }
      if (remainingPath != null && node.getObject().getPath() != null && !node.getObject().getPath().isEmpty()) {
        String fullPath=node.getObject().getPath() + "String_Node_Str" + node.getProperties(EProperties.LABEL);
        if (fullPath.equals(path)) {
          folderNode=(RepositoryNode)node;
          remainingPath=null;
        }
 else         if (path.startsWith(fullPath)) {
          folderNode=(RepositoryNode)node;
          remainingPath=path.substring(fullPath.length() + 1);
        }
        break;
      }
    }
  }
  if (folderNode != null) {
    if (remainingPath == null) {
      return folderNode;
    }
    return getFolder(currentType,remainingPath,folderNode.getChildren());
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC nrousseau Comment method "getFolder".
 * @param repositoryObjectType
 * @param path
 * @return
 */
private RepositoryNode getFolder(ERepositoryObjectType currentType,String path,List<IRepositoryNode> rootNodes){
  if (path == null || path.isEmpty()) {
    return null;
  }
  RepositoryNode folderNode=null;
  String folderName;
  String remainingPath=path;
  if (path.contains("String_Node_Str")) {
    folderName=path.substring(0,path.indexOf("String_Node_Str"));
    remainingPath=path.substring(path.indexOf("String_Node_Str") + 1);
  }
 else {
    folderName=path;
    remainingPath=null;
  }
  for (  IRepositoryNode node : rootNodes) {
    if (node.getType() == ENodeType.SIMPLE_FOLDER && node.getProperties(EProperties.CONTENT_TYPE).equals(currentType)) {
      if (node.getProperties(EProperties.LABEL).equals(folderName)) {
        folderNode=(RepositoryNode)node;
        break;
      }
      if (remainingPath != null && node.getObject().getPath() != null && !node.getObject().getPath().isEmpty()) {
        String fullPath=node.getObject().getPath() + "String_Node_Str" + node.getProperties(EProperties.LABEL);
        if (fullPath.equals(path)) {
          folderNode=(RepositoryNode)node;
          remainingPath=null;
          break;
        }
 else         if (path.startsWith(fullPath)) {
          folderNode=(RepositoryNode)node;
          remainingPath=path.substring(fullPath.length() + 1);
          break;
        }
      }
    }
  }
  if (folderNode != null) {
    if (remainingPath == null) {
      return folderNode;
    }
    return getFolder(currentType,remainingPath,folderNode.getChildren());
  }
  return null;
}