Skip to content

Commit

Permalink
[CONJ-410] merging correction to handle null value for Java 8 Offset'…
Browse files Browse the repository at this point in the history
…s DateTime 6 - part 2
  • Loading branch information
rusher committed Feb 27, 2017
1 parent 7d8c371 commit b9d0eb5
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1935,29 +1935,29 @@ public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
return (T) getBigInteger(rawBytes, col);

case "java.time.LocalDateTime":
if (rawBytes == null && rawBytes.length == 0) return null;
if (rawBytes == null || rawBytes.length == 0) return null;
ZonedDateTime zonedDateTime = getZonedDateTime(rawBytes, col, LocalDateTime.class);
return zonedDateTime == null ? null : type.cast(zonedDateTime.withZoneSameInstant(ZoneId.systemDefault()).toLocalDateTime());

case "java.time.ZonedDateTime":
if (rawBytes == null && rawBytes.length == 0) return null;
if (rawBytes == null || rawBytes.length == 0) return null;
return type.cast(getZonedDateTime(rawBytes, col, ZonedDateTime.class));

case "java.time.OffsetDateTime":
if (rawBytes == null && rawBytes.length == 0) return null;
if (rawBytes == null || rawBytes.length == 0) return null;
ZonedDateTime tmpZonedDateTime = getZonedDateTime(rawBytes, col, OffsetDateTime.class);
return tmpZonedDateTime == null ? null : type.cast(tmpZonedDateTime.toOffsetDateTime());

case "java.time.LocalDate":
if (rawBytes == null && rawBytes.length == 0) return null;
if (rawBytes == null || rawBytes.length == 0) return null;
return type.cast(getLocalDate(rawBytes, col));

case "java.time.LocalTime":
if (rawBytes == null && rawBytes.length == 0) return null;
if (rawBytes == null || rawBytes.length == 0) return null;
return type.cast(getLocalTime(rawBytes, col));

case "java.time.OffsetTime":
if (rawBytes == null && rawBytes.length == 0) return null;
if (rawBytes == null || rawBytes.length == 0) return null;
return type.cast(getOffsetTime(rawBytes, col));

default:
Expand Down

0 comments on commit b9d0eb5

Please sign in to comment.