Commit 2e26a5d
Zachary Tong
Throw exception if legacy interval cannot be parsed (#41972)
Due to the fallthrough logic, DateIntervalWrapper assumed that an
otherwise unparsable interval was a legacy fixed millis interval. This
could then NPE if the interval was just illegal ("foobar").
This commit correctly checks if the legacy millis parsing fails too,
and throws an IllegalArgumentException at that point signaling the
provided interval is bad.1 parent 61c28bc commit 2e26a5d
File tree
3 files changed
+20
-10
lines changed- server/src
- main/java/org/elasticsearch/search/aggregations/bucket/histogram
- test/java/org/elasticsearch/search/aggregations/bucket/histogram
- x-pack/plugin/src/test/resources/rest-api-spec/test/rollup
3 files changed
+20
-10
lines changedLines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
292 | | - | |
293 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
294 | 297 | | |
295 | | - | |
| 298 | + | |
| 299 | + | |
296 | 300 | | |
297 | 301 | | |
298 | 302 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1097 | 1097 | | |
1098 | 1098 | | |
1099 | 1099 | | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
1100 | 1110 | | |
1101 | 1111 | | |
1102 | 1112 | | |
| |||
Lines changed: 2 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1246 | 1246 | | |
1247 | 1247 | | |
1248 | 1248 | | |
1249 | | - | |
1250 | | - | |
1251 | | - | |
| 1249 | + | |
1252 | 1250 | | |
1253 | 1251 | | |
1254 | 1252 | | |
| |||
1264 | 1262 | | |
1265 | 1263 | | |
1266 | 1264 | | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
| 1265 | + | |
1270 | 1266 | | |
1271 | 1267 | | |
1272 | 1268 | | |
| |||
0 commit comments