You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by "vershnik (via GitHub)" <gi...@apache.org> on 2024/09/09 18:36:19 UTC

[PR] CXF-9054 do not use Date and SimpleDateFormat when parsing LocalDate,… [cxf]

vershnik opened a new pull request, #2056:
URL: https://github.com/apache/cxf/pull/2056

   … use the appropriate DateTimeFormatter for LocalDate


-- 
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: dev-unsubscribe@cxf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CXF-9054 do not use Date and SimpleDateFormat when parsing LocalDate,… [cxf]

Posted by "vershnik (via GitHub)" <gi...@apache.org>.
vershnik commented on PR #2056:
URL: https://github.com/apache/cxf/pull/2056#issuecomment-2339625157

   Even though it may turn out to be JDK issue, I think using DateTimeFormatter for parsing LocalDate is more appropriate and performance efficient (no need to create instances of SimpleDateFormat, Date, Instant, ZonedDateTime)


-- 
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: dev-unsubscribe@cxf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CXF-9054 do not use Date and SimpleDateFormat when parsing LocalDate,… [cxf]

Posted by "vershnik (via GitHub)" <gi...@apache.org>.
vershnik commented on PR #2056:
URL: https://github.com/apache/cxf/pull/2056#issuecomment-2355494258

   yes, looks like there is incompatibility between `DateTimeFormatter`  and `SimpleDateFormat`  
   For example `SimpleDateFormat`  for pattern 'yyyy-MM-dd' can parse even dates that contain time: 
   `parse("2019-07-07 23:59:59")`
   
   while  `DateTimeFormatter`  is more strict here. So this change cannot be backported.
   
   


-- 
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: dev-unsubscribe@cxf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CXF-9054 do not use Date and SimpleDateFormat when parsing LocalDate,… [cxf]

Posted by "reta (via GitHub)" <gi...@apache.org>.
reta commented on PR #2056:
URL: https://github.com/apache/cxf/pull/2056#issuecomment-2339105145

   Thanks @vershnik , as you pointed out, this is very likely JDK related issue [1] that is not related to CXF (and impact all other applications out there).
   
   [1] https://bugs.openjdk.org/browse/JDK-8294357


-- 
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: dev-unsubscribe@cxf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CXF-9054 do not use Date and SimpleDateFormat when parsing LocalDate,… [cxf]

Posted by "reta (via GitHub)" <gi...@apache.org>.
reta commented on PR #2056:
URL: https://github.com/apache/cxf/pull/2056#issuecomment-2344420243

   > Even though it may turn out to be JDK issue, I think using DateTimeFormatter for parsing LocalDate is more appropriate and performance efficient (no need to create instances of SimpleDateFormat, Date, Instant, ZonedDateTime)
   
   The `DateTimeFormatter` is certainly never API than `SimpleDateFormat` but to my knowledge,  `DateTimeFormatter` and `SimpleDateFormat` are not compatible [1], [2] (please correct me if I am wrong here). We could bring the changes than risk to break existing applications but those won't be backported. 
   
   To your point, it would make sense to migrate to `java.time` APIs but that should not be limited to `LocalDate` only (for example,  the `SearchUtils` still use  `SimpleDateFormat`).
   
   [1] https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html
   [2] https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html


-- 
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: dev-unsubscribe@cxf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CXF-9054 do not use Date and SimpleDateFormat when parsing LocalDate,… [cxf]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet merged PR #2056:
URL: https://github.com/apache/cxf/pull/2056


-- 
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: dev-unsubscribe@cxf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org