Program: 152300
Project: 152300
Buggy source:
public final static String getPhysicalName(String rootDir,String currDir,String fileName,boolean caseInsensitive){
  rootDir=rootDir.trim();
  fileName=fileName.trim();
  rootDir=normalizeSeparateChar(rootDir);
  if (rootDir.charAt(rootDir.length() - 1) != '/') {
    rootDir+='/';
  }
  fileName=normalizeSeparateChar(fileName);
  String resArg;
  if (fileName.charAt(0) != '/') {
    if (currDir == null) {
      currDir="String_Node_Str";
    }
    currDir=currDir.trim();
    if (currDir.length() == 0) {
      currDir="String_Node_Str";
    }
    currDir=normalizeSeparateChar(currDir);
    if (currDir.charAt(0) != '/') {
      currDir='/' + currDir;
    }
    if (currDir.charAt(currDir.length() - 1) != '/') {
      currDir+='/';
    }
    resArg=rootDir + currDir.substring(1);
  }
 else {
    resArg=rootDir;
  }
  if (resArg.charAt(resArg.length() - 1) == '/') {
    resArg=resArg.substring(0,resArg.length() - 1);
  }
  StringTokenizer st=new StringTokenizer(fileName,"String_Node_Str");
  while (st.hasMoreTokens()) {
    String tok=st.nextToken().trim();
    if (tok.equals("String_Node_Str")) {
      continue;
    }
    if (tok.equals("String_Node_Str")) {
      if (resArg.startsWith(rootDir)) {
        int slashIndex=resArg.lastIndexOf('/');
        if (slashIndex != -1) {
          resArg=resArg.substring(0,slashIndex);
        }
      }
      continue;
    }
    if (tok.equals("String_Node_Str")) {
      resArg=rootDir.substring(0,rootDir.length() - 1);
      continue;
    }
    if (caseInsensitive) {
      File[] matches=new File(resArg).listFiles(new NameEqualsFileFilter(tok,true));
      if (matches.length > 0) {
        tok=matches[0].getName();
      }
    }
    resArg=resArg + '/' + tok;
  }
  if ((resArg.length()) + 1 == rootDir.length()) {
    resArg+='/';
  }
  if (!resArg.regionMatches(0,rootDir,0,rootDir.length())) {
    resArg=rootDir;
  }
  return resArg;
}

Fixed version (ground truth):
public final static String getPhysicalName(String rootDir,String currDir,String fileName,boolean caseInsensitive){
  rootDir=normalizeSeparateChar(rootDir);
  if (rootDir.charAt(rootDir.length() - 1) != '/') {
    rootDir+='/';
  }
  fileName=normalizeSeparateChar(fileName);
  String resArg;
  if (fileName.charAt(0) != '/') {
    if (currDir == null) {
      currDir="String_Node_Str";
    }
    if (currDir.length() == 0) {
      currDir="String_Node_Str";
    }
    currDir=normalizeSeparateChar(currDir);
    if (currDir.charAt(0) != '/') {
      currDir='/' + currDir;
    }
    if (currDir.charAt(currDir.length() - 1) != '/') {
      currDir+='/';
    }
    resArg=rootDir + currDir.substring(1);
  }
 else {
    resArg=rootDir;
  }
  if (resArg.charAt(resArg.length() - 1) == '/') {
    resArg=resArg.substring(0,resArg.length() - 1);
  }
  StringTokenizer st=new StringTokenizer(fileName,"String_Node_Str");
  while (st.hasMoreTokens()) {
    String tok=st.nextToken();
    if (tok.equals("String_Node_Str")) {
      continue;
    }
    if (tok.equals("String_Node_Str")) {
      if (resArg.startsWith(rootDir)) {
        int slashIndex=resArg.lastIndexOf('/');
        if (slashIndex != -1) {
          resArg=resArg.substring(0,slashIndex);
        }
      }
      continue;
    }
    if (tok.equals("String_Node_Str")) {
      resArg=rootDir.substring(0,rootDir.length() - 1);
      continue;
    }
    if (caseInsensitive) {
      File[] matches=new File(resArg).listFiles(new NameEqualsFileFilter(tok,true));
      if (matches.length > 0) {
        tok=matches[0].getName();
      }
    }
    resArg=resArg + '/' + tok;
  }
  if ((resArg.length()) + 1 == rootDir.length()) {
    resArg+='/';
  }
  if (!resArg.regionMatches(0,rootDir,0,rootDir.length())) {
    resArg=rootDir;
  }
  return resArg;
}