-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix DateTime initialization to always use offset from State and never from null #1269
Conversation
…timezones and default offset dates.
…tead rely on either the default offsetdatetime.
…tate whenever possible. Fix most units with non-null offsets. There are still test failures to investigate. Lots of cleanup needs to be done afterward.
…other machine on a DST date.
…est failures on machine set to DST date.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1269 +/- ##
=============================================
+ Coverage 0 61.36% +61.36%
- Complexity 0 6145 +6145
=============================================
Files 0 469 +469
Lines 0 23651 +23651
Branches 0 4566 +4566
=============================================
+ Hits 0 14514 +14514
- Misses 0 7028 +7028
- Partials 0 2109 +2109 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved, contingent upon adding a few test cases to get up to 80% coverage for DateTime
. I'm working on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. I have a couple of notes, but am willing to approve. I would like to see the fromJavaDate function restored unless there is a good reason for its removal.
import java.util.Iterator; | ||
import java.util.List; | ||
import java.util.TimeZone; | ||
import java.time.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noting the use of wildcard imports here, which is not best practice.
@@ -296,10 +294,8 @@ public Date toJavaDate() { | |||
return java.util.Date.from(dateTime.toInstant()); | |||
} | |||
|
|||
public static DateTime fromJavaDate(Date date) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very useful function that is used in other projects. I would like to know why it has been removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The IDE said it was unused and it's my instinct to clean up dead code.
Whoever is maintaining this PR feel free to add it back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a quick review of cqf-tooling and clinical-reasoning, this function is used when parsing the input reporting period. Since it's only used one place I'm fine either way.
Closes #863