Program: 151628
Project: 151628
Buggy source:
public List<Resource<?>> resolve(){
  Resource<?> r=res;
  String tk;
  if (path.startsWith("String_Node_Str")) {
    File homeDir=new File(System.getProperty("String_Node_Str")).getAbsoluteFile();
    if (path.length() == 1) {
      return singleResult(new DirectoryResource(factory,homeDir));
    }
 else {
      cursor++;
      r=new DirectoryResource(factory,homeDir);
    }
  }
 else   if (isWindows && path.matches("String_Node_Str")) {
    int idx=path.indexOf('/') + 1;
    r=new DirectoryResource(factory,new File(path.substring(0,idx)));
    cursor=idx;
  }
  while (cursor < length) {
    SW: switch (path.charAt(cursor++)) {
case '/':
      if (cursor - 1 == 0) {
        r=factory.getResourceFrom(new File("String_Node_Str"));
      }
    continue;
case '.':
switch (read()) {
case '.':
    cursor++;
  Resource<?> parent=r.getParent();
if (parent != null) {
  r=parent;
}
break SW;
default :
if (cursor < length && path.charAt(cursor) == '/') {
cursor++;
break SW;
}
}
default :
boolean first=--cursor == 0;
tk=capture();
if (tk.matches("String_Node_Str")) {
boolean startDot=tk.startsWith("String_Node_Str");
String regex=pathspecToRegEx(tk.startsWith("String_Node_Str") ? tk.substring(1) : tk);
Pattern p=Pattern.compile(regex);
List<Resource<?>> res=new LinkedList<Resource<?>>();
for (Resource<?> child : r.listResources()) {
if (p.matcher(child.getName()).matches()) {
child.setFlag(ResourceFlag.AmbiguouslyQualified);
if (child.getName().startsWith("String_Node_Str")) {
if (startDot) {
res.add(child);
}
}
 else {
res.add(child);
}
}
}
if (cursor != length) {
for (Resource<?> child : res) {
results.addAll(new PathspecParser(factory,child,path,cursor).resolve());
}
}
 else {
results.addAll(res);
}
return results;
}
if (tk.startsWith("String_Node_Str")) {
if (first) {
r=factory.getResourceFrom(new File(tk));
cursor++;
continue;
}
 else {
tk=tk.substring(1);
}
}
Resource<?> child=r.getChild(tk);
if (child == null) {
throw new RuntimeException("String_Node_Str" + child);
}
r=child;
break;
}
}
return singleResult(r);
}

Fixed version (ground truth):
public List<Resource<?>> resolve(){
  Resource<?> r=res;
  String tk;
  if ("String_Node_Str".equals(path)) {
    return singleResult(r);
  }
 else   if (path.startsWith("String_Node_Str")) {
    File homeDir=new File(System.getProperty("String_Node_Str")).getAbsoluteFile();
    if (path.length() == 1) {
      return singleResult(new DirectoryResource(factory,homeDir));
    }
 else {
      cursor++;
      r=new DirectoryResource(factory,homeDir);
    }
  }
 else   if (isWindows && path.matches("String_Node_Str")) {
    int idx=path.indexOf('/') + 1;
    r=new DirectoryResource(factory,new File(path.substring(0,idx)));
    cursor=idx;
  }
  while (cursor < length) {
    SW: switch (path.charAt(cursor++)) {
case '/':
      if (cursor - 1 == 0) {
        r=factory.getResourceFrom(new File("String_Node_Str"));
      }
    continue;
case '.':
switch (read()) {
case '.':
    cursor++;
  Resource<?> parent=r.getParent();
if (parent != null) {
  r=parent;
}
break SW;
default :
if (cursor < length && path.charAt(cursor) == '/') {
cursor++;
break SW;
}
}
default :
boolean first=--cursor == 0;
tk=capture();
if (tk.matches("String_Node_Str")) {
boolean startDot=tk.startsWith("String_Node_Str");
String regex=pathspecToRegEx(tk.startsWith("String_Node_Str") ? tk.substring(1) : tk);
Pattern p=Pattern.compile(regex);
List<Resource<?>> res=new LinkedList<Resource<?>>();
for (Resource<?> child : r.listResources()) {
if (p.matcher(child.getName()).matches()) {
child.setFlag(ResourceFlag.AmbiguouslyQualified);
if (child.getName().startsWith("String_Node_Str")) {
if (startDot) {
res.add(child);
}
}
 else {
res.add(child);
}
}
}
if (cursor != length) {
for (Resource<?> child : res) {
results.addAll(new PathspecParser(factory,child,path,cursor).resolve());
}
}
 else {
results.addAll(res);
}
return results;
}
if (tk.startsWith("String_Node_Str")) {
if (first) {
r=factory.getResourceFrom(new File(tk));
cursor++;
continue;
}
 else {
tk=tk.substring(1);
}
}
Resource<?> child=r.getChild(tk);
if (child == null) {
throw new RuntimeException("String_Node_Str" + child);
}
r=child;
break;
}
}
return singleResult(r);
}