[ 
https://issues.apache.org/jira/browse/WW-5813?focusedWorklogId=1049994&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1049994
 ]

ASF GitHub Bot logged work on WW-5813:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Oct/26 06:12
            Start Date: 25/Oct/26 06:12
    Worklog Time Spent: 10m 
      Work Description: sonarqubecloud[bot] commented on PR #2058:
URL: https://github.com/apache/struts/pull/2058#issuecomment-6394268631

   ## [![Quality Gate 
Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png
 'Quality Gate 
Passed')](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=2058) 
**Quality Gate passed**  
   Issues  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 New 
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=2058&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png
 '') [0 Accepted 
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=2058&issueStatuses=ACCEPTED)
   
   Measures  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts&pullRequest=2058&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [100.0% Coverage on New 
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=2058&metric=new_coverage&view=list)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0.0% Duplication on New 
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=2058&metric=new_duplicated_lines_density&view=list)
  
     
   <!

Issue Time Tracking
-------------------

    Worklog Id:     (was: 1049994)
    Time Spent: 20m  (was: 10m)

> DateConverter silently drops the time when the date-time separator does not 
> match the locale pattern
> ----------------------------------------------------------------------------------------------------
>
>                 Key: WW-5813
>                 URL: https://issues.apache.org/jira/browse/WW-5813
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core
>            Reporter: Lukasz Lenart
>            Assignee: Lukasz Lenart
>            Priority: Major
>             Fix For: 7.5.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> When a {{java.util.Date}} (or {{java.sql.Timestamp}}) property receives a 
> date-time whose separator between date and time differs from the locale's 
> date-time pattern, {{DateConverter}} converts it to midnight of that date 
> instead of rejecting it.
> h2. Example
> On JDK 25 the {{nl-NL}} SHORT/MEDIUM date-time pattern is {{dd-MM-y, 
> HH:mm:ss}} (JDK 17/21: {{dd-MM-y HH:mm:ss}}, the comma came with newer CLDR 
> data). Submitting
> {code}24-10-2026 10:15:30
> {code}
> to a {{Date}} property under {{nl-NL}} on JDK 25 yields {{2026-10-24 
> 00:00:00}}. The time is lost without any conversion error. An invalid time is 
> accepted the same way: {{24-10-2026 25:00:00}} also becomes midnight.
> h2. Cause
> No date-time format matches the whole input, so the converter falls back to a 
> date-only format ({{dd-MM-y}}). {{SimpleDateFormat.parse(String)}} stops at 
> the end of the date and ignores the trailing text, so the strict re-parse 
> succeeds on the prefix.
> This exists on {{main}} before WW-5812; WW-5812 only changed which format is 
> selected when one matches the whole input.
> h2. Possible fix
> Require the final parse to consume the whole input (a {{ParsePosition}} 
> check, as WW-5812's format selection already does), and throw 
> {{TypeConversionException}} otherwise.
> This is a behaviour change: any input with trailing text after a valid date, 
> which converts today, would then be rejected. It should be called out in the 
> release notes.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to