code: public static Date parseDate(
              String dateValue,
              String[] dateFormats,
              Date startDate
      ) throws DateParseException {
  
          if (dateValue == null) {
              throw new IllegalArgumentException("dateValue is null");
          }
          if (dateFormats == null) {
              dateFormats = DEFAULT_PATTERNS;
          }
          if (startDate == null) {
              startDate = DEFAULT_TWO_DIGIT_YEAR_START;
          }
          // trim single quotes around date if present
          // see issue #5279
          if (dateValue.length() > 1
                  && dateValue.startsWith("'")
                  && dateValue.endsWith("'")
                  ) {
              dateValue = dateValue.substring (1, dateValue.length() - 1);
          }
  
          for (String dateFormat : dateFormats) {
              SimpleDateFormat dateParser = DateFormatHolder.formatFor(dateFormat);
              dateParser.set2DigitYearStart(startDate);
  
              try {
                  return dateParser.parse(dateValue);
              } catch (ParseException pe) {
                  // ignore this exception, we will try the next format
              }
          }
  
          // we were unable to parse the date
          throw new DateParseException("Unable to parse the date " + dateValue);
      }
docs: Parses the date value using the given date formats.
  
  @param dateValue the date value to parse
  @param dateFormats the date formats to use
  @param startDate During parsing, two digit years will be placed in the range
  <code>startDate</code> to <code>startDate + 100 years</code>. This value may
  be <code>null</code>. When <code>null</code> is given as a parameter, year
  <code>2000</code> will be used.
  
  @return the parsed date
  
  @throws DateParseException if none of the dataFormats could parse the dateValue