Skip to content

Commit

Permalink
adding braces to control flow statement
Browse files Browse the repository at this point in the history
Signed-off-by: Breno Faria <[email protected]>
  • Loading branch information
intrafindBreno committed Mar 2, 2022
1 parent c9aa088 commit 990ccb4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions server/src/main/java/org/opensearch/common/time/EpochTime.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,12 @@ public boolean isSupportedBy(TemporalAccessor temporal) {
public long getFrom(TemporalAccessor temporal) {
long instantSecondsInMillis = temporal.getLong(ChronoField.INSTANT_SECONDS) * 1_000;
if (instantSecondsInMillis >= 0) {
if (temporal.isSupported(ChronoField.NANO_OF_SECOND)) return instantSecondsInMillis + (temporal.getLong(
ChronoField.NANO_OF_SECOND
) / 1_000_000);
else return instantSecondsInMillis + temporal.getLong(ChronoField.MILLI_OF_SECOND);
if (temporal.isSupported(ChronoField.NANO_OF_SECOND)) {
return instantSecondsInMillis + (temporal.getLong(ChronoField.NANO_OF_SECOND) / 1_000_000);
}
else {
return instantSecondsInMillis + temporal.getLong(ChronoField.MILLI_OF_SECOND);
}
} else { // negative timestamp
if (temporal.isSupported(ChronoField.NANO_OF_SECOND)) {
long millis = instantSecondsInMillis;
Expand Down

0 comments on commit 990ccb4

Please sign in to comment.