harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Zakharov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-5498) [classlib][text][icu][struts] DateFormatSymbols.getMonth() does not add empty string to the end of the list
Date Tue, 19 Feb 2008 13:04:45 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-5498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12570199#action_12570199
] 

Alexei Zakharov commented on HARMONY-5498:
------------------------------------------

Remark: I grant the license for the above-mentioned patch to ASF. Just pressed wrong button.

> [classlib][text][icu][struts] DateFormatSymbols.getMonth() does not add empty string
to the end of the list
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5498
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5498
>             Project: Harmony
>          Issue Type: Bug
>          Components: App-Oriented Bug Reports, Classlib
>         Environment: all
>            Reporter: Alexei Zakharov
>         Attachments: H5498-scenarioFix.patch
>
>
> This is a compatibility issue. Current ICU-based implementation of DateFormatSymbols#getMonths()
does not add an empty string to the end of the list. This behavior is not required by the
specification but RI does it. Our previous non-ICU implementation did it as well - see M4
snapshot.  The same issue exists for #getWeekdays(), #getShortMonths() and #getShortWeekdays()
methods. Please see the test case below.
> DateFormatSymbolsTest.java
> ---
> import java.text.DateFormatSymbols;
> public class DateFormatSymbolsTest {
>     public static void main(String argv[]) {
>         String[] months = new DateFormatSymbols().getMonths();
>         for (String m : months) {
>             System.out.println("\"" + m + "\"");
>         }
>     }
> }
> ---
> on RI (if English system locale is selected) the output is: 
> "January"
> "February"
> "March"
> "April"
> "May"
> "June"
> "July"
> "August"
> "September"
> "October"
> "November"
> "December"
> ""
> on Harmony (since r612718):
> "January"
> "February"
> "March"
> "April"
> "May"
> "June"
> "July"
> "August"
> "September"
> "October"
> "November"
> "December"
> The bad news here is that some application depends on such RI behaviour. Example - Struts
showcase application that comes together with Struts distribution. It directly uses "new DateFormatSymbols().getMonths();"
in one of its action. And if no empty string was supplied there is no empty choice in drop-down
list on the web page. So user is obliged to choose some month and can't leave the field blank.
However, this is not the intended behavior. 
> Our struts scenario fails since January 17 because of this issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message