Replace ICU-based date/time comparison in TDML Runner with XMLGregorianCalendar#1677
Merged
Merged
Conversation
stevedlawrence
approved these changes
Jun 5, 2026
stevedlawrence
left a comment
Member
There was a problem hiding this comment.
+1, just a number of really minor comments
808e6dd to
767168b
Compare
olabusayoT
approved these changes
Jun 5, 2026
olabusayoT
left a comment
Contributor
There was a problem hiding this comment.
+1 Looks good, but couple comments about the contexless ignore
767168b to
61a5668
Compare
…anCalendar The TDML date/time comparison previously used the DFDLDate/Time/DateTimeConversion classes, which create ICU objects. This broke cross-testing against the IBM DFDL cross tester, which depends on an older ICU version (e.g. it lacks Calendar.clone()). Compare xs:date/time/dateTime values by parsing into XMLGregorianCalendar and using its XSD order relation (compare()), keeping ICU off the comparison path entirely. XMLGregorianCalendar implements XSD 1.0, which does not permit year zero, so it rejects values like "0000-01-01". Two tests whose data uses year zero (yearfromdate_03 and yearfromdatetime_03) are temporarily ignored as a result. These expose a pre-existing Daffodil bug: Daffodil produces year-zero values that are invalid under XSD 1.0, which needs to be addressed separately. The tests should be re-enabled (or converted to negative tests) once that is resolved. Broaden the catch in verifyParserTestData from XMLDifferenceException back to Exception, so exceptions thrown transitively by compareAndReport's callees are wrapped as TDMLExceptions. Restores the generic catch that was in place before commit b9fb1e5, which narrowed it to XMLDifferenceException. DAFFODIL-3077
61a5668 to
63e76f9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The TDML date/time comparison previously used the DFDLDate/Time/DateTimeConversion classes, which create ICU objects. This broke cross-testing against the IBM DFDL cross tester, which depends on an older ICU version (e.g. it lacks Calendar.clone()).
Compare xs:date/time/dateTime values by parsing into XMLGregorianCalendar and using its XSD order relation (compare()), keeping ICU off the comparison path entirely.
XMLGregorianCalendar implements XSD 1.0, which does not permit year zero, so it rejects values like "0000-01-01". Two tests whose data uses year zero (yearfromdate_03 and yearfromdatetime_03) are temporarily ignored as a result. These expose a pre-existing Daffodil bug: Daffodil produces year-zero values that are invalid under XSD 1.0, which needs to be addressed separately. The tests should be re-enabled (or converted to negative tests) once that is resolved.
Broaden the catch in verifyParserTestData from XMLDifferenceException back to Exception, so exceptions thrown transitively by compareAndReport's callees are wrapped as TDMLExceptions. Restores the generic catch that was in place beforecommit b9fb1e5, which narrowed it to XMLDifferenceException.
DAFFODIL-3077