Skip to content

Commit f3e553e

Browse files
committed
Fix restricted API
1 parent 6cc40f0 commit f3e553e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/scheduler/Cron.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import org.elasticsearch.ElasticsearchParseException;
1010
import org.elasticsearch.common.time.DateFormatter;
11+
import org.elasticsearch.core.SuppressForbidden;
1112
import org.elasticsearch.xcontent.ToXContentFragment;
1213
import org.elasticsearch.xcontent.XContentBuilder;
1314

@@ -301,6 +302,7 @@ public void setTimeZone(TimeZone timeZone) {
301302
* a time that is previous to the given time)
302303
* @return the next valid time (since the epoch)
303304
*/
305+
@SuppressForbidden(reason = "In this case, the DST ambiguity of the atZone method is desired, understood and tested")
304306
public long getNextValidTimeAfter(final long time) {
305307

306308
LocalDateTime afterTimeLdt = LocalDateTime.ofInstant(java.time.Instant.ofEpochMilli(time), timeZone.toZoneId()).plusSeconds(1);

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/scheduler/LocalDateTimeLegacyWrapper.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,23 +117,23 @@ public void plusMonths(long months) {
117117
}
118118

119119
public void plusWeeks(long weeks) {
120-
ldt = ldt.plusWeeks(weeks);
120+
ldt = ldt.plusWeeks(weeks);
121121
}
122122

123123
public void plusDays(long days) {
124-
ldt = ldt.plusDays(days);
124+
ldt = ldt.plusDays(days);
125125
}
126126

127127
public void plusHours(long hours) {
128-
ldt = ldt.plusHours(hours);
128+
ldt = ldt.plusHours(hours);
129129
}
130130

131131
public void plusMinutes(long minutes) {
132-
ldt = ldt.plusMinutes(minutes);
132+
ldt = ldt.plusMinutes(minutes);
133133
}
134134

135135
public void plusSeconds(long seconds) {
136-
ldt = ldt.plusSeconds(seconds);
136+
ldt = ldt.plusSeconds(seconds);
137137
}
138138

139139
public boolean isAfter(ChronoLocalDateTime<?> other) {

0 commit comments

Comments
 (0)