if (facesContext == null) {
throw new NullPointerException();
}
// RF-1073
try {
ValueExpression ve = getValueExpression("currentDate");
if (ve != null) {
ELContext elContext = facesContext.getELContext();
if (ve.getType(elContext).equals(String.class)) {
DateTimeConverter convert = new DateTimeConverter();
convert.setLocale(CalendarHelper.getAsLocale(facesContext, this, getLocale()));
convert.setPattern(CalendarHelper.getDatePatternOrDefault(this));
ve.setValue(facesContext.getELContext(), convert.getAsString(facesContext, this, currentDate));
return;
} else if (ve.getType(elContext).equals(Calendar.class)) {
Calendar c = CalendarHelper.getCalendar(facesContext, this);
c.setTime((Date) currentDate);
ve.setValue(elContext, c);
return;
} else {
ve.setValue(elContext, currentDate);
return;
}
} else {
setCurrentDate(currentDate);
}