[jdbc] Fix null annotation warnings (#15426)

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
Jacob Laursen 2023-08-15 13:24:29 +02:00 committed by GitHub
parent c47e833ed9
commit 7ab04b20a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 18 deletions

View File

@ -542,15 +542,15 @@ public class JdbcBaseDAO {
protected String resolveTimeFilter(FilterCriteria filter, ZoneId timeZone) {
String filterString = "";
if (filter.getBeginDate() != null) {
ZonedDateTime beginDate = filter.getBeginDate();
if (beginDate != null) {
filterString += filterString.isEmpty() ? " WHERE" : " AND";
filterString += " TIME>='" + JDBC_DATE_FORMAT.format(filter.getBeginDate().withZoneSameInstant(timeZone))
+ "'";
filterString += " TIME>='" + JDBC_DATE_FORMAT.format(beginDate.withZoneSameInstant(timeZone)) + "'";
}
if (filter.getEndDate() != null) {
ZonedDateTime endDate = filter.getEndDate();
if (endDate != null) {
filterString += filterString.isEmpty() ? " WHERE" : " AND";
filterString += " TIME<='" + JDBC_DATE_FORMAT.format(filter.getEndDate().withZoneSameInstant(timeZone))
+ "'";
filterString += " TIME<='" + JDBC_DATE_FORMAT.format(endDate.withZoneSameInstant(timeZone)) + "'";
}
return filterString;
}

View File

@ -242,15 +242,15 @@ public class JdbcDerbyDAO extends JdbcBaseDAO {
StringUtilsExt.filterToString(filter), numberDecimalcount, table, simpleName);
String filterString = "";
if (filter.getBeginDate() != null) {
ZonedDateTime beginDate = filter.getBeginDate();
if (beginDate != null) {
filterString += filterString.isEmpty() ? " WHERE" : " AND";
filterString += " TIME>='" + JDBC_DATE_FORMAT.format(filter.getBeginDate().withZoneSameInstant(timeZone))
+ "'";
filterString += " TIME>='" + JDBC_DATE_FORMAT.format(beginDate.withZoneSameInstant(timeZone)) + "'";
}
if (filter.getEndDate() != null) {
ZonedDateTime endDate = filter.getEndDate();
if (endDate != null) {
filterString += filterString.isEmpty() ? " WHERE" : " AND";
filterString += " TIME<='" + JDBC_DATE_FORMAT.format(filter.getEndDate().withZoneSameInstant(timeZone))
+ "'";
filterString += " TIME<='" + JDBC_DATE_FORMAT.format(endDate.withZoneSameInstant(timeZone)) + "'";
}
filterString += (filter.getOrdering() == Ordering.ASCENDING) ? " ORDER BY time ASC" : " ORDER BY time DESC";
if (filter.getPageSize() != 0x7fffffff) {

View File

@ -260,15 +260,15 @@ public class JdbcPostgresqlDAO extends JdbcBaseDAO {
filter.toString(), numberDecimalcount, table, simpleName);
String filterString = "";
if (filter.getBeginDate() != null) {
ZonedDateTime beginDate = filter.getBeginDate();
if (beginDate != null) {
filterString += filterString.isEmpty() ? " WHERE" : " AND";
filterString += " TIME>='" + JDBC_DATE_FORMAT.format(filter.getBeginDate().withZoneSameInstant(timeZone))
+ "'";
filterString += " TIME>='" + JDBC_DATE_FORMAT.format(beginDate.withZoneSameInstant(timeZone)) + "'";
}
if (filter.getEndDate() != null) {
ZonedDateTime endDate = filter.getEndDate();
if (endDate != null) {
filterString += filterString.isEmpty() ? " WHERE" : " AND";
filterString += " TIME<='" + JDBC_DATE_FORMAT.format(filter.getEndDate().withZoneSameInstant(timeZone))
+ "'";
filterString += " TIME<='" + JDBC_DATE_FORMAT.format(endDate.withZoneSameInstant(timeZone)) + "'";
}
filterString += (filter.getOrdering() == Ordering.ASCENDING) ? " ORDER BY time ASC" : " ORDER BY time DESC";
if (filter.getPageSize() != 0x7fffffff) {