mbeckerle commented on a change in pull request #127: Only output milliseconds
in infoset when necessary
URL: https://github.com/apache/incubator-daffodil/pull/127#discussion_r226015539
##########
File path:
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/PrimitivesDateTime1.scala
##########
@@ -156,10 +156,14 @@ object TextCalendarConstants {
// before being used, setCalendar must be called on the SimpleDateFormat
final val tlDateTimeNoTZInfosetFormatter: ThreadLocal[SimpleDateFormat] =
createTLInfosetFormatter("uuuu-MM-dd'T'HH:mm:ss.SSSSSS")
final val tlDateTimeInfosetFormatter: ThreadLocal[SimpleDateFormat] =
createTLInfosetFormatter("uuuu-MM-dd'T'HH:mm:ss.SSSSSSxxxxx")
+ final val tlDateTimeNoTZNoFractSecInfosetFormatter:
ThreadLocal[SimpleDateFormat] =
createTLInfosetFormatter("uuuu-MM-dd'T'HH:mm:ss")
Review comment:
Can you just add code comments here explaining why all these variations...
i.e., we have all combinations of
has/doesn't have timeZone and microseconds resolution because we need to
keep track of whether the data had milliseconds and timezone information
initially or not, otherwise we end up having to assume TZ such as UTC, and
millseconds 000000 when really the data was silent about such information.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services