code: public static Date createDate(final String dateStr) {
          if (dateStr == null) {
              return createCalendar(null).getTime();
          }
          final Calendar cal = getCal(dateStr);
          return cal != null ? cal.getTime() : null;
      }
docs: Creates a Date object given a string representation of it
  
  @param dateStr
  string (return today if string is null)
  @return today if string is null, a Date object representing the string
  otherwise
  @throws IllegalArgumentException
  if the string cannot be parsed.