Program: 64866
Project: 64866
Buggy source:
/** 
 * @param obj1
 * @param obj2
 * @return true x matches SQL pattern y
 * @throws BirtException
 * @throws DataException
 */
private static boolean like(Object source,Object pattern,boolean ignorecase) throws BirtException {
  String sourceStr=null;
  sourceStr=(source == null) ? "String_Node_Str" : DataTypeUtil.toLocaleNeutralString(source);
  String patternStr;
  patternStr=(pattern == null) ? "String_Node_Str" : DataTypeUtil.toLocaleNeutralString(pattern);
  final String reservedChars="String_Node_Str";
  int patternLen=patternStr.length();
  StringBuffer buffer=new StringBuffer(patternLen * 2);
  for (int i=0; i < patternLen; i++) {
    char c=patternStr.charAt(i);
    if (c == '\\') {
      ++i;
      if (i < patternLen) {
        c=patternStr.charAt(i);
        if (c == '%' || c == '_')         buffer.append(c);
 else         if (c == '\\')         buffer.append("String_Node_Str");
      }
 else {
        buffer.append("String_Node_Str");
      }
    }
 else     if (c == '%') {
      buffer.append("String_Node_Str");
    }
 else     if (c == '_') {
      buffer.append("String_Node_Str");
    }
 else {
      if (reservedChars.indexOf(c) >= 0) {
        buffer.append('\\');
      }
      buffer.append(c);
    }
  }
  try {
    String newPatternStr=buffer.toString();
    Pattern p=null;
    if (!ignorecase) {
      p=Pattern.compile(newPatternStr);
    }
 else {
      p=Pattern.compile(newPatternStr,Pattern.CASE_INSENSITIVE);
    }
    Matcher m=p.matcher(sourceStr.toString());
    return m.matches();
  }
 catch (  PatternSyntaxException e) {
    throw new BirtException(e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * @param obj1
 * @param obj2
 * @return true x matches SQL pattern y
 * @throws BirtException
 * @throws DataException
 */
private static boolean like(Object source,Object pattern,boolean ignorecase) throws BirtException {
  String sourceStr=null;
  sourceStr=(source == null) ? "String_Node_Str" : DataTypeUtil.toLocaleNeutralString(source);
  String patternStr;
  patternStr=(pattern == null) ? "String_Node_Str" : DataTypeUtil.toLocaleNeutralString(pattern);
  final String reservedChars="String_Node_Str";
  int patternLen=patternStr.length();
  StringBuffer buffer=new StringBuffer(patternLen * 2);
  for (int i=0; i < patternLen; i++) {
    char c=patternStr.charAt(i);
    if (c == '\\') {
      ++i;
      if (i < patternLen) {
        c=patternStr.charAt(i);
        if (c == '%' || c == '_')         buffer.append(c);
 else         if (c == '\\')         buffer.append("String_Node_Str");
      }
 else {
        buffer.append("String_Node_Str");
      }
    }
 else     if (c == '%') {
      buffer.append("String_Node_Str");
    }
 else     if (c == '_') {
      buffer.append("String_Node_Str");
    }
 else {
      if (reservedChars.indexOf(c) >= 0) {
        buffer.append('\\');
      }
      buffer.append(c);
    }
  }
  try {
    String newPatternStr=buffer.toString();
    Pattern p=null;
    if (!ignorecase) {
      p=Pattern.compile(newPatternStr,Pattern.DOTALL);
    }
 else {
      p=Pattern.compile(newPatternStr,Pattern.DOTALL | Pattern.CASE_INSENSITIVE);
    }
    Matcher m=p.matcher(sourceStr.toString());
    return m.matches();
  }
 catch (  PatternSyntaxException e) {
    throw new BirtException(e.getMessage());
  }
}