From 05ca2e6ca8a8ef81928d1af0a11cfe37333bbad2 Mon Sep 17 00:00:00 2001 From: Yoshito Umaoka Date: Wed, 28 May 2008 15:36:15 +0000 Subject: [PATCH] ICU-6304 Fixed test failures. Added @provisional to new draft APIs. X-SVN-Rev: 24025 --- .../icu/dev/test/format/DateFormatTest.java | 14 ++++----- icu4j/src/com/ibm/icu/text/DateFormat.java | 29 ++++++++++++++++++- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/icu4j/src/com/ibm/icu/dev/test/format/DateFormatTest.java b/icu4j/src/com/ibm/icu/dev/test/format/DateFormatTest.java index 8cf5648d85..ca5fac600b 100644 --- a/icu4j/src/com/ibm/icu/dev/test/format/DateFormatTest.java +++ b/icu4j/src/com/ibm/icu/dev/test/format/DateFormatTest.java @@ -64,16 +64,14 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk { {DateFormat.MONTH_DAY, "MMMMd","en","MMMM d"}, {DateFormat.ABBR_MONTH_DAY, "MMMd","en","MMM d"}, {DateFormat.NUM_MONTH_DAY, "Md","en","M/d"}, - {DateFormat.MONTH_DAY_WEEKDAY, "MMMMdE","en","E MMMM d"}, - {DateFormat.ABBR_MONTH_DAY_WEEKDAY, "MMMdE","en","E MMM d"}, - {DateFormat.NUM_MONTH_DAY_WEEKDAY, "MdE","en","E M d"}, + {DateFormat.MONTH_DAY_WEEKDAY, "MMMMdE","en","E, MMMM d"}, + {DateFormat.ABBR_MONTH_DAY_WEEKDAY, "MMMdE","en","E, MMM d"}, + {DateFormat.NUM_MONTH_DAY_WEEKDAY, "MdE","en","E, M/d"}, {DateFormat.YEAR_MONTH, "yyyyMMMM","en","MMMM yyyy"}, {DateFormat.YEAR_ABBR_MONTH, "yyyyMMM","en","MMM yyyy"}, - {DateFormat.YEAR_NUM_MONTH, "yyyyM","en","M yyyy"}, - {DateFormat.YEAR_ABBR_MONTH_DAY_WEEKDAY, "yyyyMMMdEEE", "en", - "EEE, MMM d, yyyy"}, - {DateFormat.YEAR_NUM_MONTH_DAY_WEEKDAY, "yyyyMdEEE", "en", - "EEE, M d, yyyy"}, + {DateFormat.YEAR_NUM_MONTH, "yyyyM","en","M/yyyy"}, + {DateFormat.YEAR_ABBR_MONTH_DAY_WEEKDAY, "yyyyMMMdEEE", "en", "EEE, MMM d, yyyy"}, + {DateFormat.YEAR_NUM_MONTH_DAY_WEEKDAY, "yyyyMdEEE", "en", "EEE, M/d/yyyy"}, {DateFormat.YEAR_QUARTER, "yyyyQQQ", "en", "QQQ yyyy"}, {DateFormat.YEAR_ABBR_QUARTER, "yyyyQ", "en", "Q yyyy"} }; diff --git a/icu4j/src/com/ibm/icu/text/DateFormat.java b/icu4j/src/com/ibm/icu/text/DateFormat.java index 2b3c712186..7d94e61228 100644 --- a/icu4j/src/com/ibm/icu/text/DateFormat.java +++ b/icu4j/src/com/ibm/icu/text/DateFormat.java @@ -677,60 +677,70 @@ public abstract class DateFormat extends UFormat { /** * Constant for date pattern denoted by the skeleton mss. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String MINUTE_SECOND = "mss"; /** * Constant for date pattern denoted by the skeleton Hmm. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String HOUR_MINUTE = "Hmm"; /** * Constant for date pattern denoted by the skeleton Hmmss. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String HOUR_MINUTE_SECOND = "Hmmss"; /** * Constant for date pattern denoted by the skeleton hmma. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String HOUR12_MINUTE = "hmma"; /** * Constant for date pattern denoted by the skeleton hmmssa. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String HOUR12_MINUTE_SECOND = "hmmssa"; /** * Constant for date pattern denoted by the skeleton d. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String DAY = "d"; /** * Constant for date pattern denoted by the skeleton LLLL. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String MONTH = "LLLL"; /** * Constant for date pattern denoted by the skeleton LLL. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String ABBR_MONTH = "LLL"; /** * Constant for date pattern denoted by the skeleton yyyy. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String YEAR = "yyyy"; /** * Constant for date pattern denoted by the skeleton MMMMd. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String MONTH_DAY = "MMMMd"; @@ -738,72 +748,84 @@ public abstract class DateFormat extends UFormat { /** * Constant for date pattern denoted by the skeleton MMMd. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String ABBR_MONTH_DAY = "MMMd"; /** * Constant for date pattern denoted by the skeleton Md. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String NUM_MONTH_DAY = "Md"; /** * Constant for date pattern denoted by the skeleton MMMMdE. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String MONTH_DAY_WEEKDAY = "MMMMdE"; /** * Constant for date pattern denoted by the skeleton MMMdE. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String ABBR_MONTH_DAY_WEEKDAY = "MMMdE"; /** * Constant for date pattern denoted by the skeleton MdE. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String NUM_MONTH_DAY_WEEKDAY = "MdE"; /** * Constant for date pattern denoted by the skeleton yyyyMMMM. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String YEAR_MONTH = "yyyyMMMM"; /** * Constant for date pattern denoted by the skeleton yyyyMMM. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String YEAR_ABBR_MONTH = "yyyyMMM"; /** * Constant for date pattern denoted by the skeleton yyyyM. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String YEAR_NUM_MONTH = "yyyyM"; /** * Constant for date pattern denoted by the skeleton yyyyMMMdEEE. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String YEAR_ABBR_MONTH_DAY_WEEKDAY = "yyyyMMMdEEE"; /** * Constant for date pattern denoted by the skeleton yyyyMdEEE. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String YEAR_NUM_MONTH_DAY_WEEKDAY = "yyyyMdEEE"; /** * Constant for date pattern denoted by the skeleton yyyyQQQ. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String YEAR_QUARTER = "yyyyQQQ"; /** * Constant for date pattern denoted by the skeleton yyyyQ. * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public static final String YEAR_ABBR_QUARTER = "yyyyQ"; @@ -1365,7 +1387,8 @@ public abstract class DateFormat extends UFormat { /** * Convenience overload * @draft ICU 4.0 - */ + * @provisional This API might change or be removed in a future release. + */ public final static DateFormat getPatternInstance(String pattern) { return getPatternInstance(pattern, ULocale.getDefault()); } @@ -1373,6 +1396,7 @@ public abstract class DateFormat extends UFormat { /** * Convenience overload * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public final static DateFormat getPatternInstance(String pattern, Locale locale) { return getPatternInstance(pattern, ULocale.forLocale(locale)); @@ -1393,6 +1417,7 @@ public abstract class DateFormat extends UFormat { * @param locale The locale for which the date/time format is desired. * * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public final static DateFormat getPatternInstance(String pattern, ULocale locale) { DateTimePatternGenerator generator = DateTimePatternGenerator.getInstance(locale); @@ -1403,6 +1428,7 @@ public abstract class DateFormat extends UFormat { /** * Convenience overload * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public final static DateFormat getPatternInstance(Calendar cal, String pattern, Locale locale) { return getPatternInstance(cal, pattern, ULocale.forLocale(locale)); @@ -1425,6 +1451,7 @@ public abstract class DateFormat extends UFormat { * @param locale The locale for which the date/time format is desired. * * @draft ICU 4.0 + * @provisional This API might change or be removed in a future release. */ public final static DateFormat getPatternInstance(Calendar cal, String pattern, ULocale locale) { DateTimePatternGenerator generator = DateTimePatternGenerator.getInstance(locale);