Skip to content
Snippets Groups Projects
Commit c64bc936 authored by Ivan Frade's avatar Ivan Frade
Browse files

SystemReader: Give a default implementation to #getTimezoneAt()

This abstract method forces subclasses (e.g. DelegateSystemReader in
gerrit) to update their code, but there is no strong reason to make it
abstract (subclasses can override it if needed).

Make the method concrete using the current default implementation
(which is the same in the mock).

Change-Id: Id1df0d71cab1d86879adf48e782f0050d3abcfa9
parent bf48fb73
No related branches found
No related tags found
No related merge requests found
...@@ -244,11 +244,6 @@ public int getTimezone(long when) { ...@@ -244,11 +244,6 @@ public int getTimezone(long when) {
return getTimeZone().getOffset(when) / (60 * 1000); return getTimeZone().getOffset(when) / (60 * 1000);
} }
@Override
public ZoneOffset getTimeZoneAt(Instant when) {
return getTimeZoneId().getRules().getOffset(when);
}
@Override @Override
public TimeZone getTimeZone() { public TimeZone getTimeZone() {
return TimeZone.getTimeZone("GMT-03:30"); return TimeZone.getTimeZone("GMT-03:30");
......
...@@ -178,11 +178,6 @@ public Instant now() { ...@@ -178,11 +178,6 @@ public Instant now() {
public int getTimezone(long when) { public int getTimezone(long when) {
return getTimeZone().getOffset(when) / (60 * 1000); return getTimeZone().getOffset(when) / (60 * 1000);
} }
@Override
public ZoneOffset getTimeZoneAt(Instant when) {
return getTimeZoneId().getRules().getOffset(when);
}
} }
/** /**
...@@ -569,7 +564,9 @@ public MonotonicClock getClock() { ...@@ -569,7 +564,9 @@ public MonotonicClock getClock() {
* @return the local time zone * @return the local time zone
* @since 7.1 * @since 7.1
*/ */
public abstract ZoneOffset getTimeZoneAt(Instant when); public ZoneOffset getTimeZoneAt(Instant when) {
return getTimeZoneId().getRules().getOffset(when);
}
/** /**
* Get system time zone, possibly mocked for testing * Get system time zone, possibly mocked for testing
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment