Steve Lawrence created DAFFODIL-2951:
----------------------------------------

             Summary: Calendar parsing is always lenient
                 Key: DAFFODIL-2951
                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2951
             Project: Daffodil
          Issue Type: Bug
          Components: Back End
    Affects Versions: 3.9.0
            Reporter: Steve Lawrence


In the DateTimeFormatterEv class, which is used to create the SimpleDateFormat 
use to parse string date/times, we have the line:

{code:scala}
formatter.setLenient(true) // TODO: should this use calendarCheckPolicy
{code}
https://github.com/apache/daffodil/blob/main/daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/processors/EvCalendarLanguage.scala#L123

We do use calendarCheckPolicy when calling setLenient on the Calendar:
https://github.com/apache/daffodil/blob/main/daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/processors/EvCalendarLanguage.scala#L81

But it seems like this setLenient call overrides that, making it so 
calendarCheckPolicy essentially is ignored, and text calendar parsing is always 
lenient.

I image we either need to remove this line and rely on Calendar having the 
correct check policy, or we need to do something like:
{code:scala}
formatter.setLeneient(calendar.isLenient)
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to