未验证 提交 3c32ad10 编写于 作者: wu-sheng's avatar wu-sheng 提交者: GitHub

Revert "Make the duration error message more specific (#5755)" (#5758)

上级 7881ba32
...@@ -30,8 +30,6 @@ import org.joda.time.format.DateTimeFormatter; ...@@ -30,8 +30,6 @@ import org.joda.time.format.DateTimeFormatter;
public enum DurationUtils { public enum DurationUtils {
INSTANCE; INSTANCE;
private static final int MAX_TIME_SPAN = 500;
private static final DateTimeFormatter YYYY_MM_DD = DateTimeFormat.forPattern("yyyy-MM-dd"); private static final DateTimeFormatter YYYY_MM_DD = DateTimeFormat.forPattern("yyyy-MM-dd");
private static final DateTimeFormatter YYYY_MM_DD_HH = DateTimeFormat.forPattern("yyyy-MM-dd HH"); private static final DateTimeFormatter YYYY_MM_DD_HH = DateTimeFormat.forPattern("yyyy-MM-dd HH");
private static final DateTimeFormatter YYYY_MM_DD_HHMM = DateTimeFormat.forPattern("yyyy-MM-dd HHmm"); private static final DateTimeFormatter YYYY_MM_DD_HHMM = DateTimeFormat.forPattern("yyyy-MM-dd HHmm");
...@@ -121,11 +119,9 @@ public enum DurationUtils { ...@@ -121,11 +119,9 @@ public enum DurationUtils {
break; break;
} }
i++; i++;
if (i > MAX_TIME_SPAN) { if (i > 500) {
throw new UnexpectedException( throw new UnexpectedException(
"Duration data error, the span between the start time and the end time is too large, step: " "Duration data error, step: " + step.name() + ", start: " + startTimeBucket + ", end: " + endTimeBucket);
+ step.name() + ", start: " + startTimeBucket + ", end: " + endTimeBucket
+ ", max time span: " + MAX_TIME_SPAN);
} }
} }
while (endTimeBucket != durations.get(durations.size() - 1).getPoint()); while (endTimeBucket != durations.get(durations.size() - 1).getPoint());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册