aizu-m opened a new pull request, #132:
URL: https://github.com/apache/poi-xmlbeans/pull/132

       org.opentest4j.AssertionFailedError: minInclusive ==> expected: <false> 
but was: <true>
           at 
misc.checkin.IncomparableMinFacetValidateTest.incomparableDateTimeFailsEveryBound(IncomparableMinFacetValidateTest.java:81)
   
   Found while reading the bound checks in `JavaGDateHolderEx.validateValue`. 
`compareToGDate` is documented to return 2 for an incomparable pair, and the 
four checks did not look like they agreed on what 2 means. Ran one bound 
against one value under each facet to see:
   
       dateTime, bound 2000-01-01T12:00:00Z, value 2000-01-01T12:00:00
         minInclusive   validates
         minExclusive   validates
         maxInclusive   rejected
         maxExclusive   rejected
   
   The value has no timezone and sits within 14 hours of the bound, so the 
order is indeterminate. The max checks test `> 0` and `>= 0`. 2 satisfies both, 
so the value is reported. The min checks test `< 0` and `<= 0`. 2 satisfies 
neither, so the value passes. It is not greater than or equal to the bound, so 
it should fail the min facets too.
   
   `JavaGDurationHolderEx.validateValue` has the same shape and gives the same 
result: P1M against a bound of P30D validates under both min facets and is 
rejected under both max facets.
   
   The schema compiler already takes this view. `StscSimpleTypeResolver` 
refuses a derived bound when `comparison == 2`.
   
   The fix reports 2 in the two min checks of each holder. Only values whose 
order against the bound is indeterminate change, and the max facets already 
reject those. The float, double, decimal and integer holders compare with a 
total order, so they are untouched.
   
   Regression test added in `IncomparableMinFacetValidateTest`. On trunk the 
two incomparable cases fail as above, with the fix all four pass, and 
`./gradlew test` is green.
   
   AI tooling was used to help prepare this change.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to