You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexei Zakharov (JIRA)" <ji...@apache.org> on 2008/02/19 13:56:43 UTC
[jira] Commented: (HARMONY-5498) [classlib][text][icu][struts]
DateFormatSymbols.getMonth() does not add empty string to the end of the
list
[ https://issues.apache.org/jira/browse/HARMONY-5498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12570195#action_12570195 ]
Alexei Zakharov commented on HARMONY-5498:
------------------------------------------
Link to the mailing list discussion: http://mail-archives.apache.org/mod_mbox/harmony-dev/200802.mbox/%3c47B2BE59.5040706@gmail.com%3e
> [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
>
> 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.