Program: 168567
Project: 168567
Buggy source:
/** 
 * Looks up the FSEntry denoted by the supplied POSIX path. Since POSIX paths may be relative, a root folder is needed to resolve the relative path structure. If the POSIX pathname is absolute, the root folder parameter will not be used.
 * @param posixPath the POSIX pathname.
 * @param rootFolder the root folder from which we should start resolvingthe path.
 * @return the FSEntry corresponding to the supplied POSIX path, or <code>null</code> if no such pathname could be found.
 * @throws java.lang.IllegalArgumentException if <code>posixPath</code> isan invalid pathname.
 */
public FSEntry getEntryByPosixPath(final String posixPath,final FSFolder rootFolder) throws IllegalArgumentException {
  String[] components=posixPath.split("String_Node_Str");
  int i=0;
  FSEntry curEntry;
  LinkedList<String[]> visitedLinks=null;
  if (components[0].length() == 0) {
    i=1;
    curEntry=getRoot();
  }
 else   curEntry=rootFolder;
  for (; i < components.length; ++i) {
    FSFolder curFolder;
    if (curEntry instanceof FSFolder)     curFolder=(FSFolder)curEntry;
 else     if (curEntry instanceof FSLink) {
      FSLink curLink=(FSLink)curEntry;
      if (visitedLinks == null)       visitedLinks=new LinkedList<String[]>();
 else       visitedLinks.clear();
      visitedLinks.add(curEntry.getAbsolutePath());
      FSEntry linkTarget=curLink.getLinkTarget();
      while (linkTarget != null && linkTarget instanceof FSLink) {
        curLink=(FSLink)linkTarget;
        String[] curPath=curLink.getAbsolutePath();
        for (        String[] visitedPath : visitedLinks) {
          if (curPath.length == visitedPath.length) {
            int j=0;
            for (; j < curPath.length; ++j) {
              if (!curPath[j].equals(visitedPath[j]))               break;
            }
            if (j == curPath.length)             return null;
          }
        }
        visitedLinks.add(curPath);
        linkTarget=curLink.getLinkTarget();
      }
      if (linkTarget == null)       return null;
      if (linkTarget instanceof FSFolder)       curFolder=(FSFolder)linkTarget;
 else       return null;
      visitedLinks.clear();
    }
 else     return null;
    String curPathComponent=components[i];
    if (curPathComponent.length() == 0 || curPathComponent.equals("String_Node_Str")) {
    }
 else     if (curPathComponent.equals("String_Node_Str")) {
      curFolder=curFolder.getParent();
    }
 else {
      String fsPathnameComponent=parsePosixPathnameComponent(curPathComponent);
      FSEntry nextEntry=null;
      for (      FSEntry entry : curFolder.list()) {
        if (entry.getName().equals(fsPathnameComponent)) {
          nextEntry=entry;
          break;
        }
      }
      if (nextEntry != null)       curEntry=nextEntry;
 else       return null;
    }
  }
  return curEntry;
}

Fixed version (ground truth):
/** 
 * Looks up the FSEntry denoted by the supplied POSIX path. Since POSIX paths may be relative, a root folder is needed to resolve the relative path structure. If the POSIX pathname is absolute, the root folder parameter will not be used.
 * @param posixPath the POSIX pathname.
 * @param rootFolder the root folder from which we should start resolvingthe path.
 * @return the FSEntry corresponding to the supplied POSIX path, or <code>null</code> if no such pathname could be found.
 * @throws java.lang.IllegalArgumentException if <code>posixPath</code> isan invalid pathname.
 */
public FSEntry getEntryByPosixPath(final String posixPath,final FSFolder rootFolder) throws IllegalArgumentException {
  String[] components=posixPath.split("String_Node_Str");
  int i=0;
  FSEntry curEntry;
  LinkedList<String[]> visitedLinks=null;
  if (posixPath.startsWith("String_Node_Str")) {
    i=1;
    curEntry=getRoot();
  }
 else   curEntry=rootFolder;
  for (; i < components.length; ++i) {
    FSFolder curFolder;
    if (curEntry instanceof FSFolder)     curFolder=(FSFolder)curEntry;
 else     if (curEntry instanceof FSLink) {
      FSLink curLink=(FSLink)curEntry;
      if (visitedLinks == null)       visitedLinks=new LinkedList<String[]>();
 else       visitedLinks.clear();
      visitedLinks.add(curEntry.getAbsolutePath());
      FSEntry linkTarget=curLink.getLinkTarget();
      while (linkTarget != null && linkTarget instanceof FSLink) {
        curLink=(FSLink)linkTarget;
        String[] curPath=curLink.getAbsolutePath();
        for (        String[] visitedPath : visitedLinks) {
          if (curPath.length == visitedPath.length) {
            int j=0;
            for (; j < curPath.length; ++j) {
              if (!curPath[j].equals(visitedPath[j]))               break;
            }
            if (j == curPath.length)             return null;
          }
        }
        visitedLinks.add(curPath);
        linkTarget=curLink.getLinkTarget();
      }
      if (linkTarget == null)       return null;
      if (linkTarget instanceof FSFolder)       curFolder=(FSFolder)linkTarget;
 else       return null;
      visitedLinks.clear();
    }
 else     return null;
    String curPathComponent=components[i];
    if (curPathComponent.length() == 0 || curPathComponent.equals("String_Node_Str")) {
    }
 else     if (curPathComponent.equals("String_Node_Str")) {
      curFolder=curFolder.getParent();
    }
 else {
      String fsPathnameComponent=parsePosixPathnameComponent(curPathComponent);
      FSEntry nextEntry=null;
      for (      FSEntry entry : curFolder.list()) {
        if (entry.getName().equals(fsPathnameComponent)) {
          nextEntry=entry;
          break;
        }
      }
      if (nextEntry != null)       curEntry=nextEntry;
 else       return null;
    }
  }
  return curEntry;
}