Skip to content

Conversation

@pgomulka
Copy link
Contributor

@pgomulka pgomulka commented Nov 22, 2018

part of the migrating joda time work.
migration watcher plugin to use JDK's java-time

refers #27330

This commit moves the aggregation and mapping code from joda time to
java time.

This includes field mappers, root object mappers, aggregations with date
histograms, query builders and a lot of changes within tests.
* "Asia/Kathmandu, 1 Jan 1986 - Time Zone Change (IST → NPT), at 00:00:00 clocks were turned forward 00:15 minutes
*/
// This test fails because we cannot parse negative epoch milli seconds yet... but perhaps we dont have to if we use instants in the
// rangefield method?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this change sneak in ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not be here (old comment, not in master). will remove

public void testAckStatusIsResetOnUnmetCondition() {
HashMap<String, ActionStatus> myMap = new HashMap<>();
ActionStatus actionStatus = new ActionStatus(now());
ActionStatus actionStatus = new ActionStatus(ZonedDateTime.now());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know these are only tests, but we can we avoid using the default TZ ? For anyone that looks at the unit tests for examples, this can lead to bugs.

Copy link
Contributor Author

@pgomulka pgomulka Jan 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, good advice. I will change this and another test in this PR that is also missing this

@jakelandis
Copy link
Contributor

Overall this change looks good a couple small comments.

However a broader question, (not suggesting that we do this now), why do we pass a ZonedDateTime around everywhere if we only care about UTC timezone ? I would think that passing around LocaleDateTime and only add the UTC timezone information when/where needed (like for serialization) would be more accurate and less prone to bugs.

@pgomulka
Copy link
Contributor Author

pgomulka commented Feb 1, 2019

personally I feel a bit safer knowing that all the dates used around are in UTC. Not entirely sure which places you have in mind where LocalDateTime would be better suited? Definitely worth discussing and refactoring in a next PR.

Copy link
Contributor

@jakelandis jakelandis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

thanks for the updates and tackling this large chunk of code.

email.priority(Email.Priority.resolve(parser.text()));
} else if (Field.SENT_DATE.match(currentFieldName, parser.getDeprecationHandler())) {
email.sentDate(new DateTime(parser.text(), DateTimeZone.UTC));
email.sentDate(ZonedDateTime.parse(parser.text())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd go with a strict_date_time formatter for clarity here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Core Core issues without another label >non-issue v7.0.0-beta1

Projects

None yet

Development

Successfully merging this pull request may close these issues.