Program: 177179
Project: 177179
Buggy source:
/** 
 * Actually match the given <code>path</code> against the given <code>pattern</code>.
 * @param pattern the pattern to match against
 * @param path the path String to test
 * @param fullMatch whether a full pattern match is required(else a pattern match as far as the given base path goes is sufficient)
 * @return <code>true</code> if the supplied <code>path</code> matched,<code>false</code> if it didn't
 */
protected boolean doMatch(String pattern,String path,boolean fullMatch){
  if (path.startsWith(this.pathSeparator) != pattern.startsWith(this.pathSeparator)) {
    return false;
  }
  String[] pattDirs=pattern.split(this.pathSeparator);
  String[] pathDirs=path.split(this.pathSeparator);
  int pattIdxStart=0;
  int pattIdxEnd=pattDirs.length - 1;
  int pathIdxStart=0;
  int pathIdxEnd=pathDirs.length - 1;
  while (pattIdxStart <= pattIdxEnd && pathIdxStart <= pathIdxEnd) {
    String patDir=pattDirs[pattIdxStart];
    if ("String_Node_Str".equals(patDir)) {
      break;
    }
    if (!matchStrings(patDir,pathDirs[pathIdxStart])) {
      return false;
    }
    pattIdxStart++;
    pathIdxStart++;
  }
  if (pathIdxStart > pathIdxEnd) {
    if (pattIdxStart > pattIdxEnd) {
      return (pattern.endsWith(this.pathSeparator) ? path.endsWith(this.pathSeparator) : !path.endsWith(this.pathSeparator));
    }
    if (!fullMatch) {
      return true;
    }
    if (pattIdxStart == pattIdxEnd && pattDirs[pattIdxStart].equals("String_Node_Str") && path.endsWith(this.pathSeparator)) {
      return true;
    }
    for (int i=pattIdxStart; i <= pattIdxEnd; i++) {
      if (!pattDirs[i].equals("String_Node_Str")) {
        return false;
      }
    }
    return true;
  }
 else   if (pattIdxStart > pattIdxEnd) {
    return false;
  }
 else   if (!fullMatch && "String_Node_Str".equals(pattDirs[pattIdxStart])) {
    return true;
  }
  while (pattIdxStart <= pattIdxEnd && pathIdxStart <= pathIdxEnd) {
    String patDir=pattDirs[pattIdxEnd];
    if (patDir.equals("String_Node_Str")) {
      break;
    }
    if (!matchStrings(patDir,pathDirs[pathIdxEnd])) {
      return false;
    }
    pattIdxEnd--;
    pathIdxEnd--;
  }
  if (pathIdxStart > pathIdxEnd) {
    for (int i=pattIdxStart; i <= pattIdxEnd; i++) {
      if (!pattDirs[i].equals("String_Node_Str")) {
        return false;
      }
    }
    return true;
  }
  while (pattIdxStart != pattIdxEnd && pathIdxStart <= pathIdxEnd) {
    int patIdxTmp=-1;
    for (int i=pattIdxStart + 1; i <= pattIdxEnd; i++) {
      if (pattDirs[i].equals("String_Node_Str")) {
        patIdxTmp=i;
        break;
      }
    }
    if (patIdxTmp == pattIdxStart + 1) {
      pattIdxStart++;
      continue;
    }
    int patLength=(patIdxTmp - pattIdxStart - 1);
    int strLength=(pathIdxEnd - pathIdxStart + 1);
    int foundIdx=-1;
    strLoop:     for (int i=0; i <= strLength - patLength; i++) {
      for (int j=0; j < patLength; j++) {
        String subPat=(String)pattDirs[pattIdxStart + j + 1];
        String subStr=(String)pathDirs[pathIdxStart + i + j];
        if (!matchStrings(subPat,subStr)) {
          continue strLoop;
        }
      }
      foundIdx=pathIdxStart + i;
      break;
    }
    if (foundIdx == -1) {
      return false;
    }
    pattIdxStart=patIdxTmp;
    pathIdxStart=foundIdx + patLength;
  }
  for (int i=pattIdxStart; i <= pattIdxEnd; i++) {
    if (!pattDirs[i].equals("String_Node_Str")) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Actually match the given <code>path</code> against the given <code>pattern</code>.
 * @param pattern the pattern to match against
 * @param path the path String to test
 * @param fullMatch whether a full pattern match is required(else a pattern match as far as the given base path goes is sufficient)
 * @return <code>true</code> if the supplied <code>path</code> matched,<code>false</code> if it didn't
 */
protected boolean doMatch(String pattern,String path,boolean fullMatch){
  if (path.startsWith(this.pathSeparator) != pattern.startsWith(this.pathSeparator)) {
    return false;
  }
  String pathSeparatorSplitPattern="String_Node_Str".equals(this.pathSeparator) ? "String_Node_Str" : this.pathSeparator;
  String[] pattDirs=pattern.split(pathSeparatorSplitPattern);
  String[] pathDirs=path.split(pathSeparatorSplitPattern);
  int pattIdxStart=0;
  int pattIdxEnd=pattDirs.length - 1;
  int pathIdxStart=0;
  int pathIdxEnd=pathDirs.length - 1;
  while (pattIdxStart <= pattIdxEnd && pathIdxStart <= pathIdxEnd) {
    String patDir=pattDirs[pattIdxStart];
    if ("String_Node_Str".equals(patDir)) {
      break;
    }
    if (!matchStrings(patDir,pathDirs[pathIdxStart])) {
      return false;
    }
    pattIdxStart++;
    pathIdxStart++;
  }
  if (pathIdxStart > pathIdxEnd) {
    if (pattIdxStart > pattIdxEnd) {
      return (pattern.endsWith(this.pathSeparator) ? path.endsWith(this.pathSeparator) : !path.endsWith(this.pathSeparator));
    }
    if (!fullMatch) {
      return true;
    }
    if (pattIdxStart == pattIdxEnd && pattDirs[pattIdxStart].equals("String_Node_Str") && path.endsWith(this.pathSeparator)) {
      return true;
    }
    for (int i=pattIdxStart; i <= pattIdxEnd; i++) {
      if (!pattDirs[i].equals("String_Node_Str")) {
        return false;
      }
    }
    return true;
  }
 else   if (pattIdxStart > pattIdxEnd) {
    return false;
  }
 else   if (!fullMatch && "String_Node_Str".equals(pattDirs[pattIdxStart])) {
    return true;
  }
  while (pattIdxStart <= pattIdxEnd && pathIdxStart <= pathIdxEnd) {
    String patDir=pattDirs[pattIdxEnd];
    if (patDir.equals("String_Node_Str")) {
      break;
    }
    if (!matchStrings(patDir,pathDirs[pathIdxEnd])) {
      return false;
    }
    pattIdxEnd--;
    pathIdxEnd--;
  }
  if (pathIdxStart > pathIdxEnd) {
    for (int i=pattIdxStart; i <= pattIdxEnd; i++) {
      if (!pattDirs[i].equals("String_Node_Str")) {
        return false;
      }
    }
    return true;
  }
  while (pattIdxStart != pattIdxEnd && pathIdxStart <= pathIdxEnd) {
    int patIdxTmp=-1;
    for (int i=pattIdxStart + 1; i <= pattIdxEnd; i++) {
      if (pattDirs[i].equals("String_Node_Str")) {
        patIdxTmp=i;
        break;
      }
    }
    if (patIdxTmp == pattIdxStart + 1) {
      pattIdxStart++;
      continue;
    }
    int patLength=(patIdxTmp - pattIdxStart - 1);
    int strLength=(pathIdxEnd - pathIdxStart + 1);
    int foundIdx=-1;
    strLoop:     for (int i=0; i <= strLength - patLength; i++) {
      for (int j=0; j < patLength; j++) {
        String subPat=(String)pattDirs[pattIdxStart + j + 1];
        String subStr=(String)pathDirs[pathIdxStart + i + j];
        if (!matchStrings(subPat,subStr)) {
          continue strLoop;
        }
      }
      foundIdx=pathIdxStart + i;
      break;
    }
    if (foundIdx == -1) {
      return false;
    }
    pattIdxStart=patIdxTmp;
    pathIdxStart=foundIdx + patLength;
  }
  for (int i=pattIdxStart; i <= pattIdxEnd; i++) {
    if (!pattDirs[i].equals("String_Node_Str")) {
      return false;
    }
  }
  return true;
}