Program: 34682
Project: 34682
Buggy source:
private Object getDateString(Object ldapValue,boolean getCalendar) throws WIMSystemException {
  if (ldapValue instanceof Date) {
    return LdapHelper.getDateString((Date)ldapValue);
  }
  String timestampFormat=null;
  DateFormat dateFormat=null;
  StringBuffer originValue=new StringBuffer(ldapValue.toString());
  int pos=originValue.indexOf("String_Node_Str");
  if (pos == -1) {
    pos=originValue.indexOf("String_Node_Str");
  }
  if (pos != -1) {
    originValue.replace(pos,pos,"String_Node_Str");
  }
  timestampFormat=iLdapConfigMgr.getTimestampFormat();
  if (timestampFormat != null) {
    dateFormat=new SimpleDateFormat(timestampFormat);
  }
 else {
    if ("String_Node_Str".equalsIgnoreCase(iLdapConfigMgr.getLdapType())) {
      int position=originValue.indexOf("String_Node_Str");
      if (originValue.indexOf("String_Node_Str") == -1) {
        while (originValue.substring(0,position).length() < 21) {
          if (originValue.indexOf("String_Node_Str") == -1) {
            originValue.replace(position,position,"String_Node_Str");
            position+=1;
          }
          originValue.replace(position,position,"String_Node_Str");
          position=originValue.indexOf("String_Node_Str");
        }
      }
      dateFormat=new SimpleDateFormat("String_Node_Str");
      originValue=new StringBuffer(originValue.substring(0,18) + originValue.substring(21));
    }
 else     if ("String_Node_Str".equalsIgnoreCase(iLdapConfigMgr.getLdapType()) || "String_Node_Str".equalsIgnoreCase(iLdapConfigMgr.getLdapType()) || "String_Node_Str".equalsIgnoreCase(iLdapConfigMgr.getLdapType())) {
      dateFormat=new SimpleDateFormat("String_Node_Str");
    }
 else {
      if (originValue.toString().contains("String_Node_Str")) {
        dateFormat=new SimpleDateFormat("String_Node_Str");
      }
 else {
        dateFormat=new SimpleDateFormat("String_Node_Str");
      }
    }
  }
  Date date=null;
  try {
    date=dateFormat.parse(originValue.toString());
  }
 catch (  java.text.ParseException e) {
    throw new WIMSystemException(WIMMessageKey.SYSTEM_EXCEPTION,Tr.formatMessage(tc,WIMMessageKey.SYSTEM_EXCEPTION,WIMMessageHelper.generateMsgParms(e.toString())));
  }
  if (getCalendar)   return date;
 else   return LdapHelper.getDateString(date);
}

Fixed version (ground truth):
private Object getDateString(Object ldapValue,boolean getCalendar) throws WIMSystemException {
  if (ldapValue instanceof Date) {
    return LdapHelper.getDateString((Date)ldapValue);
  }
  String timestampFormat=null;
  DateFormat dateFormat=null;
  StringBuffer originValue=new StringBuffer(ldapValue.toString());
  int pos=originValue.indexOf("String_Node_Str");
  if (pos == -1) {
    pos=originValue.indexOf("String_Node_Str");
  }
  if (pos != -1) {
    originValue.replace(pos,pos,"String_Node_Str");
  }
  timestampFormat=iLdapConfigMgr.getTimestampFormat();
  if (timestampFormat != null) {
    dateFormat=new SimpleDateFormat(timestampFormat);
  }
 else {
    if (LdapConstants.IDS_LDAP_SERVER.equalsIgnoreCase(iLdapConfigMgr.getLdapType())) {
      int position=originValue.indexOf("String_Node_Str");
      if (originValue.indexOf("String_Node_Str") == -1) {
        while (originValue.substring(0,position).length() < 21) {
          if (originValue.indexOf("String_Node_Str") == -1) {
            originValue.replace(position,position,"String_Node_Str");
            position+=1;
          }
          originValue.replace(position,position,"String_Node_Str");
          position=originValue.indexOf("String_Node_Str");
        }
      }
      dateFormat=new SimpleDateFormat("String_Node_Str");
      originValue=new StringBuffer(originValue.substring(0,18) + originValue.substring(21));
    }
 else     if (LdapConstants.SUN_LDAP_SERVER.equalsIgnoreCase(iLdapConfigMgr.getLdapType()) || LdapConstants.DOMINO_LDAP_SERVER.equalsIgnoreCase(iLdapConfigMgr.getLdapType()) || LdapConstants.NOVELL_LDAP_SERVER.equalsIgnoreCase(iLdapConfigMgr.getLdapType())) {
      dateFormat=new SimpleDateFormat("String_Node_Str");
    }
 else {
      if (originValue.toString().contains("String_Node_Str")) {
        dateFormat=new SimpleDateFormat("String_Node_Str");
      }
 else {
        dateFormat=new SimpleDateFormat("String_Node_Str");
      }
    }
  }
  Date date=null;
  try {
    date=dateFormat.parse(originValue.toString());
  }
 catch (  java.text.ParseException e) {
    throw new WIMSystemException(WIMMessageKey.SYSTEM_EXCEPTION,Tr.formatMessage(tc,WIMMessageKey.SYSTEM_EXCEPTION,WIMMessageHelper.generateMsgParms(e.toString())));
  }
  if (getCalendar)   return date;
 else   return LdapHelper.getDateString(date);
}