提交 eed25435 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Special handling of null is not needed

上级 2e25f755
...@@ -13,7 +13,6 @@ import java.util.Calendar; ...@@ -13,7 +13,6 @@ import java.util.Calendar;
import java.util.GregorianCalendar; import java.util.GregorianCalendar;
import java.util.TimeZone; import java.util.TimeZone;
import org.h2.engine.Mode; import org.h2.engine.Mode;
import org.h2.message.DbException;
import org.h2.value.Value; import org.h2.value.Value;
import org.h2.value.ValueDate; import org.h2.value.ValueDate;
import org.h2.value.ValueNull; import org.h2.value.ValueNull;
...@@ -278,9 +277,6 @@ public class DateTimeUtils { ...@@ -278,9 +277,6 @@ public class DateTimeUtils {
* @return the date * @return the date
*/ */
public static ValueDate convertDate(Date x, Calendar calendar) { public static ValueDate convertDate(Date x, Calendar calendar) {
if (calendar == null) {
throw DbException.getInvalidValueException("calendar", null);
}
Calendar cal = (Calendar) calendar.clone(); Calendar cal = (Calendar) calendar.clone();
cal.setTimeInMillis(x.getTime()); cal.setTimeInMillis(x.getTime());
long dateValue = dateValueFromCalendar(cal); long dateValue = dateValueFromCalendar(cal);
...@@ -295,9 +291,6 @@ public class DateTimeUtils { ...@@ -295,9 +291,6 @@ public class DateTimeUtils {
* @return the time * @return the time
*/ */
public static ValueTime convertTime(Time x, Calendar calendar) { public static ValueTime convertTime(Time x, Calendar calendar) {
if (calendar == null) {
throw DbException.getInvalidValueException("calendar", null);
}
Calendar cal = (Calendar) calendar.clone(); Calendar cal = (Calendar) calendar.clone();
cal.setTimeInMillis(x.getTime()); cal.setTimeInMillis(x.getTime());
long nanos = nanosFromCalendar(cal); long nanos = nanosFromCalendar(cal);
...@@ -313,9 +306,6 @@ public class DateTimeUtils { ...@@ -313,9 +306,6 @@ public class DateTimeUtils {
*/ */
public static ValueTimestamp convertTimestamp(Timestamp x, public static ValueTimestamp convertTimestamp(Timestamp x,
Calendar calendar) { Calendar calendar) {
if (calendar == null) {
throw DbException.getInvalidValueException("calendar", null);
}
Calendar cal = (Calendar) calendar.clone(); Calendar cal = (Calendar) calendar.clone();
cal.setTimeInMillis(x.getTime()); cal.setTimeInMillis(x.getTime());
long dateValue = dateValueFromCalendar(cal); long dateValue = dateValueFromCalendar(cal);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论