code: private static int getYear(CSLDate date, CSLDateParser dateParser) {
  		if (date == null) {
  			return -1;
  		}
  		if (date.getDateParts() == null ||
  				date.getDateParts().length == 0 ||
  				date.getDateParts()[0] == null ||
  				date.getDateParts()[0].length == 0) {
  			if (date.getRaw() != null && !date.getRaw().isEmpty()) {
  				CSLDate d = dateParser.parse(date.getRaw());
  				return getYear(d, dateParser);
  			}
  			return -1;
  		}
  		return date.getDateParts()[0][0];
  	}
docs: Retrieves the year from a {@link CSLDate} object. Parses the raw
  string if necessary.
  @param date the date object
  @param dateParser a date parser
  @return the year or -1 if the year could not be retrieved