Program: 128746
Project: 128746
Buggy source:
/** 
 * Parses text from the beginning of the given string to produce a date using the given pattern and the default date format symbols for the given locale. The method may not use the entire text of the given string. <p>
 * @param pattern the pattern to parse.
 * @param stringDate A <code>String</code> whose beginning should be parsed.
 * @return A <code>Date</code> parsed from the string.
 * @throws ParseException
 * @exception ParseException if the beginning of the specified string cannot be parsed.{talendTypes} Date {Category} TalendDate {param} string("yyyy-MM-dd HH:mm:ss") pattern : the pattern to parse {param} string("") stringDate : A <code>String</code> whose beginning should be parsed {example} parseDate("yyyy-MMM-dd HH:mm:ss", "23-Mar-1979 23:59:59") #
 */
public synchronized static Date parseDate(String pattern,String stringDate){
  try {
    DateFormat df=FastDateParser.getInstance(pattern);
    Date d=df.parse(stringDate);
    int offset=df.getCalendar().get(Calendar.ZONE_OFFSET);
    char sign=offset >= 0 ? '+' : '-';
    int hour=Math.abs(offset) / 1000 / 60/ 60;
    int min=Math.abs(offset) / 1000 / 60 % 60;
    String minStr=min < 10 ? "String_Node_Str" + min : min + "String_Node_Str";
    TalendTimestampWithTZ tstz=new TalendTimestampWithTZ(new java.sql.Timestamp(d.getTime()),TimeZone.getTimeZone("String_Node_Str" + sign + hour+ "String_Node_Str"+ minStr));
    return tstz;
  }
 catch (  ParseException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Parses text from the beginning of the given string to produce a date using the given pattern and the default date format symbols for the given locale. The method may not use the entire text of the given string. <p>
 * @param pattern the pattern to parse.
 * @param stringDate A <code>String</code> whose beginning should be parsed.
 * @return A <code>Date</code> parsed from the string.
 * @throws ParseException
 * @exception ParseException if the beginning of the specified string cannot be parsed.{talendTypes} Date {Category} TalendDate {param} string("yyyy-MM-dd HH:mm:ss") pattern : the pattern to parse {param} string("") stringDate : A <code>String</code> whose beginning should be parsed {example} parseDate("yyyy-MMM-dd HH:mm:ss", "23-Mar-1979 23:59:59") #
 */
public synchronized static Date parseDate(String pattern,String stringDate){
  try {
    boolean hasZone=false;
    boolean inQuote=false;
    char[] ps=pattern.toCharArray();
    for (    char p : ps) {
      if (p == '\'') {
        inQuote=!inQuote;
      }
 else       if (!inQuote && (p == 'Z' || p == 'z')) {
        hasZone=true;
        break;
      }
    }
    DateFormat df=FastDateParser.getInstance(pattern);
    Date d=df.parse(stringDate);
    if (hasZone) {
      int offset=df.getCalendar().get(Calendar.ZONE_OFFSET);
      char sign=offset >= 0 ? '+' : '-';
      int hour=Math.abs(offset) / 1000 / 60/ 60;
      int min=Math.abs(offset) / 1000 / 60 % 60;
      String minStr=min < 10 ? "String_Node_Str" + min : min + "String_Node_Str";
      TalendTimestampWithTZ tstz=new TalendTimestampWithTZ(new java.sql.Timestamp(d.getTime()),TimeZone.getTimeZone("String_Node_Str" + sign + hour+ "String_Node_Str"+ minStr));
      return tstz;
    }
 else {
      return d;
    }
  }
 catch (  ParseException e) {
    throw new RuntimeException(e);
  }
}