mbeckerle commented on a change in pull request #116: Fix comparison of 
calendars that do not have timezones
URL: https://github.com/apache/incubator-daffodil/pull/116#discussion_r213066401
 
 

 ##########
 File path: 
daffodil-runtime1/src/main/scala/org/apache/daffodil/calendar/DFDLCalendar.scala
 ##########
 @@ -121,7 +121,8 @@ trait OrderedCalendar { self: DFDLCalendar =>
    * can be determined.
    */
   private def orderIgnoreTimeZone(p: DFDLDateTime, q: DFDLDateTime): 
DFDLCalendarOrder = {
-    Assert.invariant((p.hasTimeZone && q.hasTimeZone) || (!p.hasTimeZone && 
!q.hasTimeZone))
+    Assert.invariant(!p.hasTimeZone || p.calendar.getTimeZone == 
TimeZone.GMT_ZONE)
 
 Review comment:
   The scaladoc here is not consistent with what this method does anymore. It 
describes a contract that P and Q must match as to whether they have, or do not 
have timezone. 
   
   In what sense does this "ignore timezone" anyway? Seems to me it treats TZ 
like any other field, with the exception of the two assert.invariant calls.  Is 
this method's name actually indicative of it's behavior? 

----------------------------------------------------------------
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

Reply via email to