diff --git a/.gitattributes b/.gitattributes
index 52d5a3b4ca..9321c165fc 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -463,6 +463,78 @@ icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_57.1/com.ib
icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_57.1/com.ibm.icu.util.ULocale.dat -text
icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_57.1/com.ibm.icu.util.UResourceTypeMismatchException.dat -text
icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_57.1/com.ibm.icu.util.VTimeZone.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.DateNumberFormat.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.IllegalIcuArgumentException.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.InvalidFormatException.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.JavaTimeZone.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.OlsonTimeZone.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.RelativeDateFormat.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.TZDBTimeZoneNames.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.TimeZoneAdapter.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.TimeZoneGenericNames.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.TimeZoneNamesImpl.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.duration.BasicDurationFormat.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.locale.LocaleSyntaxException.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.math.BigDecimal.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.math.MathContext.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.ArabicShapingException.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.ChineseDateFormat$Field.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.ChineseDateFormat.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.ChineseDateFormatSymbols.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.CompactDecimalFormat.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.CurrencyPluralInfo.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateFormat$Field.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateFormat.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateFormatSymbols.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateIntervalFormat.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateIntervalInfo$PatternInfo.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateIntervalInfo.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DecimalFormat.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DecimalFormatSymbols.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.MeasureFormat.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.MessageFormat$Field.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.MessageFormat.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.NumberFormat$Field.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.NumberFormat.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.PluralFormat.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.PluralRules.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.RuleBasedNumberFormat.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.SelectFormat.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.SimpleDateFormat.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.StringPrepParseException.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.TimeUnitFormat.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.TimeZoneFormat.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.AnnualTimeZoneRule.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.BuddhistCalendar.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.Calendar.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ChineseCalendar.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.CopticCalendar.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.Currency.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.DangiCalendar.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.DateInterval.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.DateTimeRule.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.EthiopicCalendar.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.GregorianCalendar.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.HebrewCalendar.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ICUCloneNotSupportedException.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ICUException.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ICUUncheckedIOException.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.IllformedLocaleException.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.IndianCalendar.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.InitialTimeZoneRule.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.IslamicCalendar.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.JapaneseCalendar.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.MeasureUnit.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.PersianCalendar.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.RuleBasedTimeZone.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.SimpleTimeZone.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.TaiwanCalendar.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.TimeArrayTimeZoneRule.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.TimeUnit.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.TimeZone.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ULocale.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.UResourceTypeMismatchException.dat -text
+icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.VTimeZone.dat -text
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/Trie2Test.setRanges1.16.tri2 -text
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/Trie2Test.setRanges1.32.tri2 -text
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/Trie2Test.setRanges2.16.tri2 -text
diff --git a/icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormatSymbols.java b/icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormatSymbols.java
index b769256325..c74c3f3b5d 100644
--- a/icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormatSymbols.java
+++ b/icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormatSymbols.java
@@ -1505,6 +1505,7 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
if (digitStrings == null) {
digitStrings = new String[10];
if (digits != null && digits.length == 10) {
+ zeroDigit = digits[0];
for (int i = 0; i < 10; i++) {
digitStrings[i] = String.valueOf(digits[i]);
}
@@ -1538,7 +1539,7 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
monetarySeparatorString = String.valueOf(monetarySeparator);
}
if (monetaryGroupingSeparatorString == null) {
- monetaryGroupingSeparatorString = String.valueOf(monetaryGroupingSeparatorString);
+ monetaryGroupingSeparatorString = String.valueOf(monetaryGroupingSeparator);
}
}
diff --git a/icu4j/main/classes/core/src/com/ibm/icu/util/IslamicCalendar.java b/icu4j/main/classes/core/src/com/ibm/icu/util/IslamicCalendar.java
index 76d893756e..f50d49e457 100644
--- a/icu4j/main/classes/core/src/com/ibm/icu/util/IslamicCalendar.java
+++ b/icu4j/main/classes/core/src/com/ibm/icu/util/IslamicCalendar.java
@@ -23,7 +23,7 @@ import com.ibm.icu.util.ULocale.Category;
* is used as the civil calendar in most of the Arab world and the
* liturgical calendar of the Islamic faith worldwide. This calendar
* is also known as the "Hijri" calendar, since it starts at the time
- * of Mohammed's emigration (or "hijra") to Medinah on Thursday,
+ * of Mohammed's emigration (or "hijra") to Medinah on Thursday,
* July 15, 622 AD (Julian).
*
* The Islamic calendar is strictly lunar, and thus an Islamic year of twelve
@@ -46,8 +46,8 @@ import com.ibm.icu.util.ULocale.Category;
* This is the default behavior of a newly-created IslamicCalendar
* object.
*
- * The Islamic religious calendar and Saudi Arabia's Umm al-Qura
- * calendar, however, are based on the observation of the crescent moon.
+ * The Islamic religious calendar and Saudi Arabia's Umm al-Qura
+ * calendar, however, are based on the observation of the crescent moon.
* It is thus affected by the position at which the
* observations are made, seasonal variations in the time of sunset, the
* eccentricities of the moon's orbit, and even the weather at the observation
@@ -63,21 +63,21 @@ import com.ibm.icu.util.ULocale.Category;
* calculations. At present, the approximations used in this class are fairly
* simplistic; they will be improved in later versions of the code.
*
- * Like the Islamic religious calendar, Umm al-Qura is also based
+ * Like the Islamic religious calendar, Umm al-Qura is also based
* on the sighting method of the crescent moon but is standardized by Saudi Arabia.
- *
+ *
* The {@link #setCalculationType(CalculationType) setCalculationType} method determines
* which approach is used to determine the start of a month. By default, the
* fixed-cycle civil calendar is used. However, if setCalculationType(ISLAMIC)
* is called, an approximation of the true lunar calendar will be used.
- * Similarly, if setCalculationType(ISLAMIC_UMALQURA)
is called, an approximation
+ * Similarly, if setCalculationType(ISLAMIC_UMALQURA)
is called, an approximation
* of the Umm al-Qura lunar calendar will be used.
*
* This class should not be subclassed.
*
- * IslamicCalendar usually should be instantiated using
+ * IslamicCalendar usually should be instantiated using
* {@link com.ibm.icu.util.Calendar#getInstance(ULocale)} passing in a ULocale
- * with the tag "@calendar=islamic"
or "@calendar=islamic-civil"
+ * with the tag "@calendar=islamic"
or "@calendar=islamic-civil"
* or "@calendar=islamic-umalqura"
.
*
* @see com.ibm.icu.util.GregorianCalendar
@@ -94,76 +94,76 @@ public class IslamicCalendar extends Calendar {
//-------------------------------------------------------------------------
// Constants...
//-------------------------------------------------------------------------
-
+
/**
- * Constant for Muharram, the 1st month of the Islamic year.
- * @stable ICU 2.8
+ * Constant for Muharram, the 1st month of the Islamic year.
+ * @stable ICU 2.8
*/
public static final int MUHARRAM = 0;
/**
- * Constant for Safar, the 2nd month of the Islamic year.
- * @stable ICU 2.8
+ * Constant for Safar, the 2nd month of the Islamic year.
+ * @stable ICU 2.8
*/
public static final int SAFAR = 1;
/**
- * Constant for Rabi' al-awwal (or Rabi' I), the 3rd month of the Islamic year.
- * @stable ICU 2.8
+ * Constant for Rabi' al-awwal (or Rabi' I), the 3rd month of the Islamic year.
+ * @stable ICU 2.8
*/
public static final int RABI_1 = 2;
/**
- * Constant for Rabi' al-thani or (Rabi' II), the 4th month of the Islamic year.
- * @stable ICU 2.8
+ * Constant for Rabi' al-thani or (Rabi' II), the 4th month of the Islamic year.
+ * @stable ICU 2.8
*/
public static final int RABI_2 = 3;
/**
- * Constant for Jumada al-awwal or (Jumada I), the 5th month of the Islamic year.
- * @stable ICU 2.8
+ * Constant for Jumada al-awwal or (Jumada I), the 5th month of the Islamic year.
+ * @stable ICU 2.8
*/
public static final int JUMADA_1 = 4;
/**
- * Constant for Jumada al-thani or (Jumada II), the 6th month of the Islamic year.
- * @stable ICU 2.8
+ * Constant for Jumada al-thani or (Jumada II), the 6th month of the Islamic year.
+ * @stable ICU 2.8
*/
public static final int JUMADA_2 = 5;
/**
- * Constant for Rajab, the 7th month of the Islamic year.
- * @stable ICU 2.8
+ * Constant for Rajab, the 7th month of the Islamic year.
+ * @stable ICU 2.8
*/
public static final int RAJAB = 6;
/**
- * Constant for Sha'ban, the 8th month of the Islamic year.
- * @stable ICU 2.8
+ * Constant for Sha'ban, the 8th month of the Islamic year.
+ * @stable ICU 2.8
*/
public static final int SHABAN = 7;
/**
- * Constant for Ramadan, the 9th month of the Islamic year.
- * @stable ICU 2.8
+ * Constant for Ramadan, the 9th month of the Islamic year.
+ * @stable ICU 2.8
*/
public static final int RAMADAN = 8;
/**
- * Constant for Shawwal, the 10th month of the Islamic year.
- * @stable ICU 2.8
+ * Constant for Shawwal, the 10th month of the Islamic year.
+ * @stable ICU 2.8
*/
public static final int SHAWWAL = 9;
/**
- * Constant for Dhu al-Qi'dah, the 11th month of the Islamic year.
- * @stable ICU 2.8
+ * Constant for Dhu al-Qi'dah, the 11th month of the Islamic year.
+ * @stable ICU 2.8
*/
public static final int DHU_AL_QIDAH = 10;
/**
- * Constant for Dhu al-Hijjah, the 12th month of the Islamic year.
- * @stable ICU 2.8
+ * Constant for Dhu al-Hijjah, the 12th month of the Islamic year.
+ * @stable ICU 2.8
*/
public static final int DHU_AL_HIJJAH = 11;
@@ -331,7 +331,7 @@ public class IslamicCalendar extends Calendar {
public void setCivil(boolean beCivil)
{
civil = beCivil;
-
+
if (beCivil && cType != CalculationType.ISLAMIC_CIVIL) {
// The fields of the calendar will become invalid, because the calendar
// rules are different
@@ -348,7 +348,7 @@ public class IslamicCalendar extends Calendar {
setTimeInMillis(m);
}
}
-
+
/**
* Returns true
if this object is using the fixed-cycle civil
* calendar, or false
if using the religious, astronomical
@@ -362,7 +362,7 @@ public class IslamicCalendar extends Calendar {
}
return false;
}
-
+
//-------------------------------------------------------------------------
// Minimum / Maximum access functions
//-------------------------------------------------------------------------
@@ -396,9 +396,9 @@ public class IslamicCalendar extends Calendar {
{/* */}, // JULIAN_DAY
{/* */}, // MILLISECONDS_IN_DAY
};
-
+
/*
- * bit map array where a bit turned on represents a month with 30 days.
+ * bit map array where a bit turned on represents a month with 30 days.
*/
private static final int[] UMALQURA_MONTHLENGTH = {
//* 1300 -1302 */ "1010 1010 1010", "1101 0101 0100", "1110 1100 1001",
@@ -510,6 +510,7 @@ public class IslamicCalendar extends Calendar {
/**
* @stable ICU 2.8
*/
+ @Override
protected int handleGetLimit(int field, int limitType) {
return LIMITS[field][limitType];
}
@@ -578,7 +579,7 @@ public class IslamicCalendar extends Calendar {
{
return (14 + 11 * year) % 30 < 11;
}
-
+
/**
* Return the day # on which the given year starts. Days are counted
* from the Hijri epoch, origin 0.
@@ -594,7 +595,7 @@ public class IslamicCalendar extends Calendar {
} else if(cType == CalculationType.ISLAMIC_UMALQURA){
year -= UMALQURA_YEAR_START;
// rounded least-squares fit of the dates previously calculated from UMALQURA_MONTHLENGTH iteration
- int yrStartLinearEstimate = (int)((354.36720 * (double)year) + 460322.05 + 0.5);
+ int yrStartLinearEstimate = (int)((354.36720 * year) + 460322.05 + 0.5);
// need a slight correction to some
ys = yrStartLinearEstimate + UMALQURA_YEAR_START_ESTIMATE_FIX[year];
}
@@ -630,7 +631,7 @@ public class IslamicCalendar extends Calendar {
return ms;
}
-
+
/**
* Find the day number on which a particular month of the true/lunar
* Islamic calendar starts.
@@ -646,7 +647,7 @@ public class IslamicCalendar extends Calendar {
if (start == CalendarCache.EMPTY)
{
// Make a guess at when the month started, using the average length
- long origin = HIJRA_MILLIS
+ long origin = HIJRA_MILLIS
+ (long)Math.floor(month * CalendarAstronomer.SYNODIC_MONTH) * ONE_DAY;
double age = moonAge(origin);
@@ -667,7 +668,7 @@ public class IslamicCalendar extends Calendar {
}
start = (origin - HIJRA_MILLIS) / ONE_DAY + 1;
-
+
cache.put(month, start);
}
return start;
@@ -676,7 +677,7 @@ public class IslamicCalendar extends Calendar {
/**
* Return the "age" of the moon at the given time; this is the difference
* in ecliptic latitude between the moon and the sun. This method simply
- * calls CalendarAstronomer.moonAge, converts to degrees,
+ * calls CalendarAstronomer.moonAge, converts to degrees,
* and adjusts the resultto be in the range [-180, 180].
*
* @param time The time at which the moon's age is desired,
@@ -685,7 +686,7 @@ public class IslamicCalendar extends Calendar {
static final double moonAge(long time)
{
double age = 0;
-
+
synchronized(astro) {
astro.setTime(time);
age = astro.getMoonAge();
@@ -702,12 +703,12 @@ public class IslamicCalendar extends Calendar {
//-------------------------------------------------------------------------
// Internal data....
//
-
+
// And an Astronomer object for the moon age calculations
private static CalendarAstronomer astro = new CalendarAstronomer();
-
+
private static CalendarCache cache = new CalendarCache();
-
+
/**
* true
if this object uses the fixed-cycle Islamic civil calendar,
* and false
if it approximates the true religious calendar using
@@ -716,10 +717,10 @@ public class IslamicCalendar extends Calendar {
* @serial
*/
private boolean civil = true;
-
+
/**
* determines the type of calculation to use for this instance
- *
+ *
* @serial
* @stable ICU 52
*/
@@ -736,17 +737,18 @@ public class IslamicCalendar extends Calendar {
* @param month The hijri month, 0-based
* @stable ICU 2.8
*/
+ @Override
protected int handleGetMonthLength(int extendedYear, int month) {
int length;
-
+
if (cType == CalculationType.ISLAMIC_CIVIL
|| cType == CalculationType.ISLAMIC_TBLA
|| (cType == CalculationType.ISLAMIC_UMALQURA && (extendedYear < UMALQURA_YEAR_START || extendedYear > UMALQURA_YEAR_END) )) {
length = 29 + (month+1) % 2;
if (month == DHU_AL_HIJJAH && civilLeapYear(extendedYear)) {
length++;
- }
+ }
}
else if (cType == CalculationType.ISLAMIC) {
month = 12*(extendedYear-1) + month;
@@ -754,7 +756,7 @@ public class IslamicCalendar extends Calendar {
}
else { // cType == CalculationType.ISLAMIC_UMALQURA should be true at this point and not null.
int idx = (extendedYear - UMALQURA_YEAR_START); // calculate year offset into bit map array
- int mask = (0x01 << (11 - month)); // set mask for bit corresponding to month
+ int mask = (0x01 << (11 - month)); // set mask for bit corresponding to month
if((UMALQURA_MONTHLENGTH[idx] & mask) == 0 ) {
length = 29;
}
@@ -769,8 +771,9 @@ public class IslamicCalendar extends Calendar {
* Return the number of days in the given Islamic year
* @stable ICU 2.8
*/
+ @Override
protected int handleGetYearLength(int extendedYear) {
- int length =0;
+ int length =0;
if (cType == CalculationType.ISLAMIC_CIVIL
|| cType == CalculationType.ISLAMIC_TBLA
|| (cType == CalculationType.ISLAMIC_UMALQURA && (extendedYear < UMALQURA_YEAR_START || extendedYear > UMALQURA_YEAR_END) )) {
@@ -785,7 +788,7 @@ public class IslamicCalendar extends Calendar {
return length;
}
-
+
//-------------------------------------------------------------------------
// Functions for converting from field values to milliseconds....
//-------------------------------------------------------------------------
@@ -798,9 +801,10 @@ public class IslamicCalendar extends Calendar {
/**
* @stable ICU 2.8
*/
+ @Override
protected int handleComputeMonthStart(int eyear, int month, boolean useMonth) {
return (int)(monthStart(eyear, month) + ((cType == CalculationType.ISLAMIC_TBLA)? ASTRONOMICAL_EPOC: CIVIL_EPOC) - 1);
- }
+ }
//-------------------------------------------------------------------------
// Functions for converting from milliseconds to field values
@@ -809,6 +813,7 @@ public class IslamicCalendar extends Calendar {
/**
* @stable ICU 2.8
*/
+ @Override
protected int handleGetExtendedYear() {
int year;
if (newerField(EXTENDED_YEAR, YEAR) == EXTENDED_YEAR) {
@@ -829,12 +834,13 @@ public class IslamicCalendar extends Calendar {
* DAY_OF_MONTH
* DAY_OF_YEAR
* EXTENDED_YEAR
- *
+ *
* The DAY_OF_WEEK and DOW_LOCAL fields are already set when this
* method is called. The getGregorianXxx() methods return Gregorian
* calendar equivalents for the given Julian day.
* @stable ICU 2.8
*/
+ @Override
protected void handleComputeFields(int julianDay) {
int year =0, month=0, dayOfMonth=0, dayOfYear=0;
long monthStart;
@@ -878,14 +884,14 @@ public class IslamicCalendar extends Calendar {
} else {
int y =UMALQURA_YEAR_START-1, m =0;
long d = 1;
- while(d > 0) {
- y++;
+ while(d > 0) {
+ y++;
d = days - yearStart(y) +1;
if(d == handleGetYearLength(y)) {
m=11;
break;
} else if(d < handleGetYearLength(y) ) {
- int monthLen = handleGetMonthLength(y, m);
+ int monthLen = handleGetMonthLength(y, m);
m=0;
while(d > monthLen) {
d -= monthLen;
@@ -900,24 +906,24 @@ public class IslamicCalendar extends Calendar {
}
}
-
+
dayOfMonth = (int)(days - monthStart(year, month)) + 1;
// Now figure out the day of the year.
dayOfYear = (int)(days - monthStart(year, 0) + 1);
-
+
internalSet(ERA, 0);
internalSet(YEAR, year);
internalSet(EXTENDED_YEAR, year);
internalSet(MONTH, month);
internalSet(DAY_OF_MONTH, dayOfMonth);
- internalSet(DAY_OF_YEAR, dayOfYear);
- }
-
+ internalSet(DAY_OF_YEAR, dayOfYear);
+ }
+
/**
* enumeration of available calendar calculation types
- *
+ *
* @stable ICU 52
*/
public enum CalculationType {
@@ -954,17 +960,17 @@ public class IslamicCalendar extends Calendar {
return bcpType;
}
};
-
+
/**
* sets the calculation type for this calendar.
- *
+ *
* @stable ICU 55
*/
public void setCalculationType(CalculationType type) {
cType = type;
-
+
// ensure civil property is up-to-date
- if(cType == CalculationType.ISLAMIC_CIVIL)
+ if(cType == CalculationType.ISLAMIC_CIVIL)
civil = true;
else
civil = false;
@@ -972,7 +978,7 @@ public class IslamicCalendar extends Calendar {
/**
* gets the calculation type for this calendar.
- *
+ *
* @stable ICU 55
*/
public CalculationType getCalculationType() {
@@ -984,23 +990,24 @@ public class IslamicCalendar extends Calendar {
*/
private void setCalcTypeForLocale(ULocale locale) {
String localeCalType = CalendarUtil.getCalendarType(locale);
- if("islamic-civil".equals(localeCalType))
+ if("islamic-civil".equals(localeCalType))
setCalculationType(CalculationType.ISLAMIC_CIVIL);
- else if("islamic-umalqura".equals(localeCalType))
+ else if("islamic-umalqura".equals(localeCalType))
setCalculationType(CalculationType.ISLAMIC_UMALQURA);
- else if("islamic-tbla".equals(localeCalType))
+ else if("islamic-tbla".equals(localeCalType))
setCalculationType(CalculationType.ISLAMIC_TBLA);
else if(localeCalType.startsWith("islamic"))
- setCalculationType(CalculationType.ISLAMIC); // needs to be last so it's always the default if it's islamic-something-unhandled
- else
+ setCalculationType(CalculationType.ISLAMIC); // needs to be last so it's always the default if it's islamic-something-unhandled
+ else
setCalculationType(CalculationType.ISLAMIC_CIVIL); // default for any non-islamic calendar locale
}
-
+
/**
* {@inheritDoc}
* @stable ICU 3.8
*/
+ @Override
public String getType() {
if (cType == null) {
// TODO: getType() is called during Islamic calendar
@@ -1011,20 +1018,19 @@ public class IslamicCalendar extends Calendar {
return cType.bcpType();
}
- private void readObject(ObjectInputStream in) throws IOException,ClassNotFoundException
- {
- in.defaultReadObject();
-
- if(cType != CalculationType.ISLAMIC_CIVIL)
- return; // we've serialized something new, nothing else to do
-
- // new calculation type is civil (default) but civil is false. This will only happen
- // when deserializing a non-civil calender so need to adjust new CalculationType to match
- // serialized form
- if(!civil)
- cType = CalculationType.ISLAMIC;
+ private void readObject(ObjectInputStream in) throws IOException,ClassNotFoundException {
+ in.defaultReadObject();
+
+ if (cType == null) {
+ // The serialized data was created by an ICU version before CalculationType
+ // was introduced.
+ cType = civil ? CalculationType.ISLAMIC_CIVIL : CalculationType.ISLAMIC;
+ } else {
+ // Make sure 'civil' is consistent with CalculationType
+ civil = (cType == CalculationType.ISLAMIC_CIVIL);
+ }
}
-
+
/*
private static CalendarFactory factory;
public static CalendarFactory factory() {
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/CalendarHandler.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/CalendarHandler.java
index 80483f1382..8d071721e6 100644
--- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/CalendarHandler.java
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/CalendarHandler.java
@@ -34,10 +34,25 @@ import com.ibm.icu.util.ULocale;
*/
public abstract class CalendarHandler implements SerializableTestUtility.Handler
{
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
Calendar cal_a = (Calendar) a;
Calendar cal_b = (Calendar) b;
+
+ // Make sure tzid is preserved
+ TimeZone tz_a = cal_a.getTimeZone();
+ TimeZone tz_b = cal_b.getTimeZone();
+
+ if (!tz_a.getID().equals(tz_b.getID())) {
+ return false;
+ }
+
+ // The deserialized TimeZone may have different rule.
+ // To compare the behavior, we need to use the same
+ // TimeZone.
+ cal_a.setTimeZone(tz_b);
+
long now = System.currentTimeMillis();
cal_a.setTimeInMillis(now);
@@ -51,6 +66,7 @@ public abstract class CalendarHandler implements SerializableTestUtility.Handler
static class BasicCalendarHandler extends CalendarHandler
{
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
@@ -64,193 +80,205 @@ public abstract class CalendarHandler implements SerializableTestUtility.Handler
return calendars;
}
}
-
+
static class BuddhistCalendarHandler extends CalendarHandler
{
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
TimeZone tst = TimeZone.getTimeZone("Asia/Bangkok");
BuddhistCalendar calendars[] = new BuddhistCalendar[locales.length];
-
+
for (int i = 0; i < locales.length; i += 1) {
calendars[i] = new BuddhistCalendar(tst, locales[i]);
}
-
+
return calendars;
}
}
-
+
static class ChineseCalendarHandler extends CalendarHandler
{
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
TimeZone cst = TimeZone.getTimeZone("Asia/Shanghai");
ChineseCalendar calendars[] = new ChineseCalendar[locales.length];
-
+
for (int i = 0; i < locales.length; i += 1) {
calendars[i] = new ChineseCalendar(cst, locales[i]);
}
-
- return calendars;
+
+ return calendars;
}
}
-
+
static class CopticCalendarHandler extends CalendarHandler
{
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
TimeZone ast = TimeZone.getTimeZone("Europe/Athens");
CopticCalendar calendars[] = new CopticCalendar[locales.length];
-
+
for (int i = 0; i < locales.length; i += 1) {
calendars[i] = new CopticCalendar(ast, locales[i]);
}
-
- return calendars;
+
+ return calendars;
}
}
static class DangiCalendarHandler extends CalendarHandler
{
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
TimeZone kst = TimeZone.getTimeZone("Asia/Seoul");
DangiCalendar calendars[] = new DangiCalendar[locales.length];
-
+
for (int i = 0; i < locales.length; i += 1) {
calendars[i] = new DangiCalendar(kst, ULocale.forLocale(locales[i]));
}
-
- return calendars;
+
+ return calendars;
}
}
static class EthiopicCalendarHandler extends CalendarHandler
{
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
TimeZone ast = TimeZone.getTimeZone("Africa/Addis_Ababa");
EthiopicCalendar calendars[] = new EthiopicCalendar[locales.length];
-
+
for (int i = 0; i < locales.length; i += 1) {
calendars[i] = new EthiopicCalendar(ast, locales[i]);
}
-
- return calendars;
+
+ return calendars;
}
}
static class GregorianCalendarHandler extends CalendarHandler
{
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
TimeZone pst = TimeZone.getTimeZone("America/Los_Angeles");
GregorianCalendar calendars[] = new GregorianCalendar[locales.length];
-
+
for (int i = 0; i < locales.length; i += 1) {
calendars[i] = new GregorianCalendar(pst, locales[i]);
}
-
- return calendars;
+
+ return calendars;
}
}
static class HebrewCalendarHandler extends CalendarHandler
{
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
TimeZone jst = TimeZone.getTimeZone("Asia/Jerusalem");
HebrewCalendar calendars[] = new HebrewCalendar[locales.length];
-
+
for (int i = 0; i < locales.length; i += 1) {
calendars[i] = new HebrewCalendar(jst, locales[i]);
}
-
- return calendars;
+
+ return calendars;
}
}
-
+
static class IndianCalendarHandler extends CalendarHandler
{
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
TimeZone jst = TimeZone.getTimeZone("Asia/Calcutta");
IndianCalendar calendars[] = new IndianCalendar[locales.length];
-
+
for (int i = 0; i < locales.length; i += 1) {
calendars[i] = new IndianCalendar(jst, locales[i]);
}
-
- return calendars;
+
+ return calendars;
}
}
-
+
static class IslamicCalendarHandler extends CalendarHandler
{
+ @Override
public Object[] getTestObjects() {
Locale locales[] = SerializableTestUtility.getLocales();
TimeZone cst = TimeZone.getTimeZone("Africa/Cairo");
IslamicCalendar calendars[] = new IslamicCalendar[locales.length];
-
+
for (int i = 0; i < locales.length; i += 1) {
calendars[i] = new IslamicCalendar(cst, locales[i]);
}
-
- return calendars;
+
+ return calendars;
}
}
static class JapaneseCalendarHandler extends CalendarHandler
{
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
TimeZone jst = TimeZone.getTimeZone("Asia/Tokyo");
JapaneseCalendar calendars[] = new JapaneseCalendar[locales.length];
-
+
for (int i = 0; i < locales.length; i += 1) {
calendars[i] = new JapaneseCalendar(jst, locales[i]);
}
-
- return calendars;
+
+ return calendars;
}
}
static class PersianCalendarHandler extends CalendarHandler
{
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
TimeZone kst = TimeZone.getTimeZone("Asia/Tehran");
PersianCalendar calendars[] = new PersianCalendar[locales.length];
-
+
for (int i = 0; i < locales.length; i += 1) {
calendars[i] = new PersianCalendar(kst, ULocale.forLocale(locales[i]));
}
-
- return calendars;
+
+ return calendars;
}
}
static class TaiwanCalendarHandler extends CalendarHandler {
+ @Override
public Object[] getTestObjects() {
Locale locales[] = SerializableTestUtility.getLocales();
TimeZone cst = TimeZone.getTimeZone("Asia/Shanghai");
TaiwanCalendar calendars[] = new TaiwanCalendar[locales.length];
-
+
for (int i = 0; i < locales.length; i += 1) {
calendars[i] = new TaiwanCalendar(cst, locales[i]);
}
-
- return calendars;
+
+ return calendars;
}
}
}
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/CompatibilityTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/CompatibilityTest.java
index 1541370cab..9af3542272 100644
--- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/CompatibilityTest.java
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/CompatibilityTest.java
@@ -12,12 +12,16 @@ package com.ibm.icu.dev.test.serializable;
import java.io.File;
import java.io.FileFilter;
+import java.io.FileInputStream;
import java.io.IOException;
+import java.net.JarURLConnection;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Enumeration;
import java.util.List;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -34,92 +38,167 @@ import junitparams.Parameters;
@RunWith(JUnitParamsRunner.class)
public class CompatibilityTest extends TestFmwk
{
- //TODO(junit) - requires code to read the serialized classes from a jar
- @Ignore
+ private static final class FileHolder {
+ String className;
+ String icuVersion;
+ byte[] b;
+ boolean skip;
+
+ FileHolder(String fileName, byte[] b) {
+ this.b = b;
+
+ // Replace '\' with '/' to normalize fileName before extracting
+ // substrings. This is required if serialization test data is
+ // loaded from Windows file system.
+ String tmpPath = fileName.replaceAll("\\\\", "/");
+
+ int fileBreak = tmpPath.lastIndexOf('/');
+ this.className = fileName.substring(fileBreak + 1, tmpPath.lastIndexOf('.'));
+ int finalDirBreak = tmpPath.lastIndexOf("/ICU");
+ this.icuVersion = tmpPath.substring(finalDirBreak + 1, fileBreak);
+ className = className.substring(className.lastIndexOf('/') + 1);
+
+ this.skip = skipFile(this.icuVersion, this.className);
+ }
+
+ private static boolean skipFile(String icuVersion, String className) {
+ for (int skip = 0; skip < SKIP_CASES.length; skip++) {
+ if (icuVersion.equals(SKIP_CASES[skip][0]) && className.equals(SKIP_CASES[skip][1])) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return icuVersion + "[" + className + "]";
+ }
+ }
+
@Test
@Parameters(method="generateClassList")
- public void testCompatibility(String testFileName) throws ClassNotFoundException, IOException {
- File testFile = new File(testFileName);
- Object[] oldObjects = SerializableTestUtility.getSerializedObjects(testFile);
- int start = testFileName.lastIndexOf('/') + 1;
- int end = testFileName.lastIndexOf('.');
- String className = testFileName.substring(start, end);
- Handler classHandler = SerializableTestUtility.getHandler(className);
-
+ public void testCompatibility(FileHolder holder) throws ClassNotFoundException, IOException {
+ if (holder.skip) {
+ logln("Skipping File = " + holder);
+ return;
+ }
+
+ Object[] oldObjects = SerializableTestUtility.getSerializedObjects(holder.b);
+ Handler classHandler = SerializableTestUtility.getHandler(holder.className);
+
Object[] testObjects = classHandler.getTestObjects();
for (int i = 0; i < testObjects.length; i++) {
if (!classHandler.hasSameBehavior(oldObjects[i], testObjects[i])) {
errln("Input object " + i + " failed behavior test.");
- }
+ }
}
}
-
- @SuppressWarnings("unused")
- private List generateClassList() {
- List classList = new ArrayList();
+ @SuppressWarnings("unused")
+ private List generateClassList() throws IOException {
URL dataURL = getClass().getResource("data");
+ String protocol = dataURL.getProtocol();
+
+ if (protocol.equals("jar")) {
+ return getJarList(dataURL);
+ } else if (protocol.equals("file")) {
+ return getFileList(dataURL);
+ } else {
+ errln("Don't know how to test " + dataURL);
+ return null;
+ }
+ }
+
+ private List getFileList(URL dataURL) throws IOException {
+ List classList = new ArrayList();
File topDir = new File(dataURL.getPath());
- File dataDirs[] = topDir.listFiles(new FileFilter() {
+ File dataDirs[] = topDir.listFiles(new FileFilter() {
+ @Override
public boolean accept(File pathname) {
return pathname.isDirectory();
}});
- File dataDirs2[] = topDir.listFiles();
- System.out.println("topDir = " + topDir);
- //System.out.println("dataDirs = " + dataDirs);
- System.out.println("dataDirs2 = " + dataDirs2);
- for (File dataDir : dataDirs2) {
- System.out.println("\t" + dataDir);
- }
for (File dataDir : dataDirs) {
- File files[] = dataDir.listFiles(new FileFilter() {
+ File files[] = dataDir.listFiles(new FileFilter() {
+ @Override
public boolean accept(File pathname) {
return pathname.isFile() && pathname.getName().endsWith(".dat");
}});
- String dataDirName = dataDir.getName();
+ for (File file : files) {
+ FileInputStream fis = new FileInputStream(file);
+ byte[] fileBytes;
+ try {
+ fileBytes = SerializableTestUtility.copyStreamBytes(fis);
+ } finally {
+ fis.close();
+ }
+ classList.add(new FileHolder(file.getAbsolutePath(), fileBytes));
+ }
+ }
+ return classList;
+ }
- element_loop:
- for (File file : files) {
- String filename = file.getName();
- String className = filename.substring(0, filename.lastIndexOf("."));
+ private List getJarList(URL jarURL) throws IOException {
+ List classList = new ArrayList();
+
+ String prefix = jarURL.getPath();
+ int ix = prefix.indexOf("!/");
+ if (ix >= 0) {
+ prefix = prefix.substring(ix + 2);
+ }
+
+ JarFile jarFile = null;
+ try {
+ String urlAsString = jarURL.toExternalForm();
+ ix = urlAsString.indexOf("!/");
+ jarURL = new URL(urlAsString.substring(0, ix + 2));
+
+ JarURLConnection conn = (JarURLConnection) jarURL.openConnection();
+ jarFile = conn.getJarFile();
+ Enumeration entries = jarFile.entries();
+ while (entries.hasMoreElements()) {
+ JarEntry entry = (JarEntry) entries.nextElement();
+ if (!entry.isDirectory()) {
+ String entryName = entry.getName();
+
+ if (entryName.startsWith(prefix) && entryName.endsWith(".dat")) {
+ FileHolder holder = new FileHolder(entryName,
+ SerializableTestUtility.copyStreamBytes(jarFile.getInputStream(entry)));
+ classList.add(holder);
- // Skip some cases which do not work well
- for (int skip = 0; skip < SKIP_CASES.length; skip++) {
- if (dataDirName.equals(SKIP_CASES[skip][0]) && filename.equals(SKIP_CASES[skip][1])) {
- logln("Skipping test case - " + dataDirName + "/" + className);
- continue element_loop;
}
}
- classList.add(file.getAbsolutePath());
+ }
+ } finally {
+ if (jarFile != null) {
+ jarFile.close();
}
}
- // TODO(junit): add randomization support on the list based on the params object
-
return classList;
}
private static final String[][] SKIP_CASES = {
// ICU 52+ PluralRules/PluralFormat/CurrencyPluralInfo are not
- // serialization-compatible with previous versions.
- {"ICU_50.1", "com.ibm.icu.text.CurrencyPluralInfo.dat"},
- {"ICU_51.1", "com.ibm.icu.text.CurrencyPluralInfo.dat"},
+ // serialization-compatible with previous versions.
+ {"ICU_50.1", "com.ibm.icu.text.CurrencyPluralInfo"},
+ {"ICU_51.1", "com.ibm.icu.text.CurrencyPluralInfo"},
- {"ICU_50.1", "com.ibm.icu.text.PluralFormat.dat"},
- {"ICU_51.1", "com.ibm.icu.text.PluralFormat.dat"},
+ {"ICU_50.1", "com.ibm.icu.text.PluralFormat"},
+ {"ICU_51.1", "com.ibm.icu.text.PluralFormat"},
- {"ICU_50.1", "com.ibm.icu.text.PluralRules.dat"},
- {"ICU_51.1", "com.ibm.icu.text.PluralRules.dat"},
+ {"ICU_50.1", "com.ibm.icu.text.PluralRules"},
+ {"ICU_51.1", "com.ibm.icu.text.PluralRules"},
// GeneralMeasureFormat was in technical preview, but is going away after ICU 52.1.
- {"ICU_52.1", "com.ibm.icu.text.GeneralMeasureFormat.dat"},
+ {"ICU_52.1", "com.ibm.icu.text.GeneralMeasureFormat"},
// RuleBasedNumberFormat
- {"ICU_3.6", "com.ibm.icu.text.RuleBasedNumberFormat.dat"},
+ {"ICU_3.6", "com.ibm.icu.text.RuleBasedNumberFormat"},
// ICU 4.8+ MessageFormat is not serialization-compatible with previous versions.
- {"ICU_3.6", "com.ibm.icu.text.MessageFormat.dat"},
+ {"ICU_3.6", "com.ibm.icu.text.MessageFormat"},
};
}
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/CoverageTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/CoverageTest.java
index 35900e2046..ffe623d23f 100644
--- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/CoverageTest.java
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/CoverageTest.java
@@ -38,7 +38,7 @@ public class CoverageTest extends TestFmwk {
Handler classHandler = SerializableTestUtility.getHandler(className);
if (classHandler == null) {
if (!Modifier.isAbstract(m)) {
- //errln("Missing test handler. Update the list of tests in SerializableTest.java to include a test case for " + className);
+ errln("Missing test handler. Update the list of tests in SerializableTest.java to include a test case for " + className);
}
return;
}
@@ -48,10 +48,10 @@ public class CoverageTest extends TestFmwk {
for (int i = 0; i < testObjects.length; i++) {
if (!classHandler.hasSameBehavior(serializedObjects[i], testObjects[i])) {
errln("Input object " + className + "(" + i + ") failed behavior test.");
- }
+ }
}
}
-
+
List generateClassList() throws IOException {
return SerializableTestUtility.getSerializationClassList(this);
}
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/FormatHandler.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/FormatHandler.java
index 8c44a3d18e..f79d4fceaa 100644
--- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/FormatHandler.java
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/FormatHandler.java
@@ -68,303 +68,303 @@ public class FormatHandler
static HashMap cannedShortMonthNames = new HashMap();
static String en_CA_MonthNames[] = {
- "January",
- "February",
- "March",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December",
+ "January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December",
};
static String fr_CA_MonthNames[] = {
- "janvier",
- "f\u00E9vrier",
- "mars",
- "avril",
- "mai",
- "juin",
- "juillet",
- "ao\u00FBt",
- "septembre",
- "octobre",
- "novembre",
- "d\u00E9cembre",
+ "janvier",
+ "f\u00E9vrier",
+ "mars",
+ "avril",
+ "mai",
+ "juin",
+ "juillet",
+ "ao\u00FBt",
+ "septembre",
+ "octobre",
+ "novembre",
+ "d\u00E9cembre",
};
static String zh_Hans_CN_MonthNames[] = {
- "\u4E00\u6708",
- "\u4E8C\u6708",
- "\u4E09\u6708",
- "\u56DB\u6708",
- "\u4E94\u6708",
- "\u516D\u6708",
- "\u4E03\u6708",
- "\u516B\u6708",
- "\u4E5D\u6708",
- "\u5341\u6708",
- "\u5341\u4E00\u6708",
- "\u5341\u4E8C\u6708",
+ "\u4E00\u6708",
+ "\u4E8C\u6708",
+ "\u4E09\u6708",
+ "\u56DB\u6708",
+ "\u4E94\u6708",
+ "\u516D\u6708",
+ "\u4E03\u6708",
+ "\u516B\u6708",
+ "\u4E5D\u6708",
+ "\u5341\u6708",
+ "\u5341\u4E00\u6708",
+ "\u5341\u4E8C\u6708",
};
static String zh_CN_MonthNames[] = {
- "\u4E00\u6708",
- "\u4E8C\u6708",
- "\u4E09\u6708",
- "\u56DB\u6708",
- "\u4E94\u6708",
- "\u516D\u6708",
- "\u4E03\u6708",
- "\u516B\u6708",
- "\u4E5D\u6708",
- "\u5341\u6708",
- "\u5341\u4E00\u6708",
- "\u5341\u4E8C\u6708",
+ "\u4E00\u6708",
+ "\u4E8C\u6708",
+ "\u4E09\u6708",
+ "\u56DB\u6708",
+ "\u4E94\u6708",
+ "\u516D\u6708",
+ "\u4E03\u6708",
+ "\u516B\u6708",
+ "\u4E5D\u6708",
+ "\u5341\u6708",
+ "\u5341\u4E00\u6708",
+ "\u5341\u4E8C\u6708",
};
static String zh_MonthNames[] = {
- "\u4E00\u6708",
- "\u4E8C\u6708",
- "\u4E09\u6708",
- "\u56DB\u6708",
- "\u4E94\u6708",
- "\u516D\u6708",
- "\u4E03\u6708",
- "\u516B\u6708",
- "\u4E5D\u6708",
- "\u5341\u6708",
- "\u5341\u4E00\u6708",
- "\u5341\u4E8C\u6708",
+ "\u4E00\u6708",
+ "\u4E8C\u6708",
+ "\u4E09\u6708",
+ "\u56DB\u6708",
+ "\u4E94\u6708",
+ "\u516D\u6708",
+ "\u4E03\u6708",
+ "\u516B\u6708",
+ "\u4E5D\u6708",
+ "\u5341\u6708",
+ "\u5341\u4E00\u6708",
+ "\u5341\u4E8C\u6708",
};
static String en_MonthNames[] = {
- "January",
- "February",
- "March",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December",
+ "January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December",
};
static String fr_FR_MonthNames[] = {
- "janvier",
- "f\u00E9vrier",
- "mars",
- "avril",
- "mai",
- "juin",
- "juillet",
- "ao\u00FBt",
- "septembre",
- "octobre",
- "novembre",
- "d\u00E9cembre",
+ "janvier",
+ "f\u00E9vrier",
+ "mars",
+ "avril",
+ "mai",
+ "juin",
+ "juillet",
+ "ao\u00FBt",
+ "septembre",
+ "octobre",
+ "novembre",
+ "d\u00E9cembre",
};
static String fr_MonthNames[] = {
- "janvier",
- "f\u00E9vrier",
- "mars",
- "avril",
- "mai",
- "juin",
- "juillet",
- "ao\u00FBt",
- "septembre",
- "octobre",
- "novembre",
- "d\u00E9cembre",
+ "janvier",
+ "f\u00E9vrier",
+ "mars",
+ "avril",
+ "mai",
+ "juin",
+ "juillet",
+ "ao\u00FBt",
+ "septembre",
+ "octobre",
+ "novembre",
+ "d\u00E9cembre",
};
static String de_MonthNames[] = {
- "Januar",
- "Februar",
- "M\u00E4rz",
- "April",
- "Mai",
- "Juni",
- "Juli",
- "August",
- "September",
- "Oktober",
- "November",
- "Dezember",
+ "Januar",
+ "Februar",
+ "M\u00E4rz",
+ "April",
+ "Mai",
+ "Juni",
+ "Juli",
+ "August",
+ "September",
+ "Oktober",
+ "November",
+ "Dezember",
};
static String de_DE_MonthNames[] = {
- "Januar",
- "Februar",
- "M\u00E4rz",
- "April",
- "Mai",
- "Juni",
- "Juli",
- "August",
- "September",
- "Oktober",
- "November",
- "Dezember",
+ "Januar",
+ "Februar",
+ "M\u00E4rz",
+ "April",
+ "Mai",
+ "Juni",
+ "Juli",
+ "August",
+ "September",
+ "Oktober",
+ "November",
+ "Dezember",
};
static String it_MonthNames[] = {
- "gennaio",
- "febbraio",
- "marzo",
- "aprile",
- "maggio",
- "giugno",
- "luglio",
- "agosto",
- "settembre",
- "ottobre",
- "novembre",
- "dicembre",
+ "gennaio",
+ "febbraio",
+ "marzo",
+ "aprile",
+ "maggio",
+ "giugno",
+ "luglio",
+ "agosto",
+ "settembre",
+ "ottobre",
+ "novembre",
+ "dicembre",
};
static String it_IT_MonthNames[] = {
- "gennaio",
- "febbraio",
- "marzo",
- "aprile",
- "maggio",
- "giugno",
- "luglio",
- "agosto",
- "settembre",
- "ottobre",
- "novembre",
- "dicembre",
+ "gennaio",
+ "febbraio",
+ "marzo",
+ "aprile",
+ "maggio",
+ "giugno",
+ "luglio",
+ "agosto",
+ "settembre",
+ "ottobre",
+ "novembre",
+ "dicembre",
};
static String ja_JP_MonthNames[] = {
- "1\u6708",
- "2\u6708",
- "3\u6708",
- "4\u6708",
- "5\u6708",
- "6\u6708",
- "7\u6708",
- "8\u6708",
- "9\u6708",
- "10\u6708",
- "11\u6708",
- "12\u6708",
+ "1\u6708",
+ "2\u6708",
+ "3\u6708",
+ "4\u6708",
+ "5\u6708",
+ "6\u6708",
+ "7\u6708",
+ "8\u6708",
+ "9\u6708",
+ "10\u6708",
+ "11\u6708",
+ "12\u6708",
};
static String ja_MonthNames[] = {
- "1\u6708",
- "2\u6708",
- "3\u6708",
- "4\u6708",
- "5\u6708",
- "6\u6708",
- "7\u6708",
- "8\u6708",
- "9\u6708",
- "10\u6708",
- "11\u6708",
- "12\u6708",
+ "1\u6708",
+ "2\u6708",
+ "3\u6708",
+ "4\u6708",
+ "5\u6708",
+ "6\u6708",
+ "7\u6708",
+ "8\u6708",
+ "9\u6708",
+ "10\u6708",
+ "11\u6708",
+ "12\u6708",
};
static String ko_KR_MonthNames[] = {
- "1\uC6D4",
- "2\uC6D4",
- "3\uC6D4",
- "4\uC6D4",
- "5\uC6D4",
- "6\uC6D4",
- "7\uC6D4",
- "8\uC6D4",
- "9\uC6D4",
- "10\uC6D4",
- "11\uC6D4",
- "12\uC6D4",
+ "1\uC6D4",
+ "2\uC6D4",
+ "3\uC6D4",
+ "4\uC6D4",
+ "5\uC6D4",
+ "6\uC6D4",
+ "7\uC6D4",
+ "8\uC6D4",
+ "9\uC6D4",
+ "10\uC6D4",
+ "11\uC6D4",
+ "12\uC6D4",
};
static String ko_MonthNames[] = {
- "1\uC6D4",
- "2\uC6D4",
- "3\uC6D4",
- "4\uC6D4",
- "5\uC6D4",
- "6\uC6D4",
- "7\uC6D4",
- "8\uC6D4",
- "9\uC6D4",
- "10\uC6D4",
- "11\uC6D4",
- "12\uC6D4",
+ "1\uC6D4",
+ "2\uC6D4",
+ "3\uC6D4",
+ "4\uC6D4",
+ "5\uC6D4",
+ "6\uC6D4",
+ "7\uC6D4",
+ "8\uC6D4",
+ "9\uC6D4",
+ "10\uC6D4",
+ "11\uC6D4",
+ "12\uC6D4",
};
static String zh_Hant_TW_MonthNames[] = {
- "\u4E00\u6708",
- "\u4E8C\u6708",
- "\u4E09\u6708",
- "\u56DB\u6708",
- "\u4E94\u6708",
- "\u516D\u6708",
- "\u4E03\u6708",
- "\u516B\u6708",
- "\u4E5D\u6708",
- "\u5341\u6708",
- "\u5341\u4E00\u6708",
- "\u5341\u4E8C\u6708",
+ "\u4E00\u6708",
+ "\u4E8C\u6708",
+ "\u4E09\u6708",
+ "\u56DB\u6708",
+ "\u4E94\u6708",
+ "\u516D\u6708",
+ "\u4E03\u6708",
+ "\u516B\u6708",
+ "\u4E5D\u6708",
+ "\u5341\u6708",
+ "\u5341\u4E00\u6708",
+ "\u5341\u4E8C\u6708",
};
static String zh_TW_MonthNames[] = {
- "\u4E00\u6708",
- "\u4E8C\u6708",
- "\u4E09\u6708",
- "\u56DB\u6708",
- "\u4E94\u6708",
- "\u516D\u6708",
- "\u4E03\u6708",
- "\u516B\u6708",
- "\u4E5D\u6708",
- "\u5341\u6708",
- "\u5341\u4E00\u6708",
- "\u5341\u4E8C\u6708",
+ "\u4E00\u6708",
+ "\u4E8C\u6708",
+ "\u4E09\u6708",
+ "\u56DB\u6708",
+ "\u4E94\u6708",
+ "\u516D\u6708",
+ "\u4E03\u6708",
+ "\u516B\u6708",
+ "\u4E5D\u6708",
+ "\u5341\u6708",
+ "\u5341\u4E00\u6708",
+ "\u5341\u4E8C\u6708",
};
static String en_GB_MonthNames[] = {
- "January",
- "February",
- "March",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December",
+ "January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December",
};
static String en_US_MonthNames[] = {
- "January",
- "February",
- "March",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December",
+ "January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December",
};
static String en_CA_ShortMonthNames[] = {
@@ -666,7 +666,7 @@ public class FormatHandler
"Nov",
"Dec",
};
-
+
static {
cannedMonthNames.put("en_CA", en_CA_MonthNames);
cannedMonthNames.put("fr_CA", fr_CA_MonthNames);
@@ -715,20 +715,24 @@ public class FormatHandler
{
DateFormatSymbols dfs =new DateFormatSymbols(GregorianCalendar.class, uloc);
String key = uloc.toString();
-
+
dfs.setMonths((String[]) cannedMonthNames.get(key));
dfs.setShortMonths((String[]) cannedShortMonthNames.get(key));
-
+
return dfs;
}
-
+
private static SimpleDateFormat getCannedSimpleDateFormat(String pattern, ULocale uloc)
{
DateFormatSymbols dfs = getCannedDateFormatSymbols(uloc);
-
- return new SimpleDateFormat(pattern, dfs, uloc);
+
+ // Force PT
+ TimeZone pt = TimeZone.getTimeZone("America/Los_Angeles");
+ SimpleDateFormat cannedSDF = new SimpleDateFormat(pattern, dfs, uloc);
+ cannedSDF.setTimeZone(pt);
+ return cannedSDF;
}
-
+
/*
* The serialized form of a normally created DecimalFormatSymbols object
* will have locale-specific data in it that might change from one version
@@ -736,187 +740,187 @@ public class FormatHandler
* data into the test objects we create.
*/
static HashMap cannedDecimalFormatSymbols = new HashMap();
-
+
static String en_CA_StringSymbols[] = {
- "$",
- "E",
- "\u221E",
- "CAD",
- "\uFFFD",
+ "$",
+ "E",
+ "\u221E",
+ "CAD",
+ "\uFFFD",
".#,-.*;%\u2030+@0"
};
static String fr_CA_StringSymbols[] = {
- "$",
- "E",
- "\u221E",
- "CAD",
- "\uFFFD",
+ "$",
+ "E",
+ "\u221E",
+ "CAD",
+ "\uFFFD",
",#\u00A0-,*;%\u2030+@0"
};
static String zh_CN_StringSymbols[] = {
- "\uFFE5",
- "E",
- "\u221E",
- "CNY",
+ "\uFFE5",
+ "E",
+ "\u221E",
+ "CNY",
"\uFFFD",
".#,-.*;%\u2030+@0"
};
static String zh_StringSymbols[] = {
- "\u00A4",
- "E",
- "\u221E",
- "XXX",
- "\uFFFD",
+ "\u00A4",
+ "E",
+ "\u221E",
+ "XXX",
+ "\uFFFD",
".#,-.*;%\u2030+@0"
};
static String en_StringSymbols[] = {
- "\u00A4",
- "E",
- "\u221E",
- "XXX",
- "\uFFFD",
+ "\u00A4",
+ "E",
+ "\u221E",
+ "XXX",
+ "\uFFFD",
".#,-.*;%\u2030+@0"
};
static String fr_FR_StringSymbols[] = {
- "\u20AC",
- "E",
- "\u221E",
- "EUR",
- "\uFFFD",
+ "\u20AC",
+ "E",
+ "\u221E",
+ "EUR",
+ "\uFFFD",
",#\u00A0-,*;%\u2030+@0"
};
static String fr_StringSymbols[] = {
- "\u00A4",
- "E",
- "\u221E",
- "XXX",
- "\uFFFD",
+ "\u00A4",
+ "E",
+ "\u221E",
+ "XXX",
+ "\uFFFD",
",#\u00A0-,*;%\u2030+@0"
};
static String de_StringSymbols[] = {
- "\u00A4",
- "E",
- "\u221E",
- "XXX",
+ "\u00A4",
+ "E",
+ "\u221E",
+ "XXX",
"\uFFFD",
",#.-,*;%\u2030+@0"
};
static String de_DE_StringSymbols[] = {
- "\u20AC",
- "E",
- "\u221E",
- "EUR",
- "\uFFFD",
+ "\u20AC",
+ "E",
+ "\u221E",
+ "EUR",
+ "\uFFFD",
",#.-,*;%\u2030+@0"
};
static String it_StringSymbols[] = {
- "\u00A4",
- "E",
- "\u221E",
- "XXX",
- "\uFFFD",
+ "\u00A4",
+ "E",
+ "\u221E",
+ "XXX",
+ "\uFFFD",
",#.-,*;%\u2030+@0"
};
static String it_IT_StringSymbols[] = {
- "\u20AC",
- "E",
- "\u221E",
- "EUR",
- "\uFFFD",
+ "\u20AC",
+ "E",
+ "\u221E",
+ "EUR",
+ "\uFFFD",
",#.-,*;%\u2030+@0"
};
static String ja_JP_StringSymbols[] = {
- "\uFFE5",
- "E",
- "\u221E",
- "JPY",
- "\uFFFD",
+ "\uFFE5",
+ "E",
+ "\u221E",
+ "JPY",
+ "\uFFFD",
".#,-.*;%\u2030+@0"
};
static String ja_StringSymbols[] = {
- "\u00A4",
- "E",
- "\u221E",
- "XXX",
- "\uFFFD",
+ "\u00A4",
+ "E",
+ "\u221E",
+ "XXX",
+ "\uFFFD",
".#,-.*;%\u2030+@0"
};
static String ko_KR_StringSymbols[] = {
- "\uFFE6",
- "E",
- "\u221E",
- "KRW",
+ "\uFFE6",
+ "E",
+ "\u221E",
+ "KRW",
"\uFFFD",
".#,-.*;%\u2030+@0"
};
static String ko_StringSymbols[] = {
- "\u00A4",
- "E",
- "\u221E",
- "XXX",
+ "\u00A4",
+ "E",
+ "\u221E",
+ "XXX",
"\uFFFD",
".#,-.*;%\u2030+@0"
};
static String zh_Hans_CN_StringSymbols[] = {
- "\uFFE5",
- "E",
- "\u221E",
- "CNY",
- "\uFFFD",
+ "\uFFE5",
+ "E",
+ "\u221E",
+ "CNY",
+ "\uFFFD",
".#,-.*;%\u2030+@0"
};
static String zh_Hant_TW_StringSymbols[] = {
- "NT$",
- "E",
- "\u221E",
- "TWD",
- "\uFFFD",
+ "NT$",
+ "E",
+ "\u221E",
+ "TWD",
+ "\uFFFD",
".#,-.*;%\u2030+@0"
};
static String zh_TW_StringSymbols[] = {
- "NT$",
- "E",
- "\u221E",
- "TWD",
- "\uFFFD",
+ "NT$",
+ "E",
+ "\u221E",
+ "TWD",
+ "\uFFFD",
".#,-.*;%\u2030+@0"
};
static String en_GB_StringSymbols[] = {
- "\u00A3",
- "E",
- "\u221E",
- "GBP",
- "\uFFFD",
+ "\u00A3",
+ "E",
+ "\u221E",
+ "GBP",
+ "\uFFFD",
".#,-.*;%\u2030+@0"
};
static String en_US_StringSymbols[] = {
- "$",
- "E",
- "\u221E",
- "USD",
+ "$",
+ "E",
+ "\u221E",
+ "USD",
"\uFFFD",
".#,-.*;%\u2030+@0"
};
-
+
static {
cannedDecimalFormatSymbols.put("en_CA", en_CA_StringSymbols);
cannedDecimalFormatSymbols.put("fr_CA", fr_CA_StringSymbols);
@@ -939,7 +943,7 @@ public class FormatHandler
cannedDecimalFormatSymbols.put("en_GB", en_GB_StringSymbols);
cannedDecimalFormatSymbols.put("en_US", en_US_StringSymbols);
}
-
+
private static char[] getCharSymbols(DecimalFormatSymbols dfs)
{
char symbols[] = {
@@ -956,10 +960,10 @@ public class FormatHandler
dfs.getSignificantDigit(),
dfs.getZeroDigit()
};
-
+
return symbols;
}
-
+
private static void setCharSymbols(DecimalFormatSymbols dfs, char symbols[])
{
dfs.setDecimalSeparator(symbols[0]);
@@ -975,7 +979,7 @@ public class FormatHandler
dfs.setSignificantDigit(symbols[10]);
dfs.setZeroDigit(symbols[11]);
}
-
+
private static String[] getStringSymbols(DecimalFormatSymbols dfs)
{
String symbols[] = {
@@ -985,16 +989,16 @@ public class FormatHandler
dfs.getInternationalCurrencySymbol(),
dfs.getNaN()
};
-
+
return symbols;
}
-
+
private static DecimalFormatSymbols getCannedDecimalFormatSymbols(ULocale uloc)
{
DecimalFormatSymbols dfs = new DecimalFormatSymbols(uloc);
-
+
setSymbols(dfs, (String[]) cannedDecimalFormatSymbols.get(uloc.toString()));
-
+
return dfs;
}
@@ -1002,7 +1006,7 @@ public class FormatHandler
{
return new DecimalFormat(pattern, getCannedDecimalFormatSymbols(uloc));
}
-
+
private static void setSymbols(DecimalFormatSymbols dfs, String symbols[])
{
dfs.setCurrencySymbol(symbols[0]);
@@ -1010,26 +1014,28 @@ public class FormatHandler
dfs.setInfinity(symbols[2]);
dfs.setInternationalCurrencySymbol(symbols[3]);
dfs.setNaN(symbols[4]);
-
+
setCharSymbols(dfs, symbols[5].toCharArray());
}
-
+
public static class RelativeDateFormatHandler implements SerializableTestUtility.Handler
{
+ @Override
public Object[] getTestObjects()
{
- DateFormat formats[] = {
+ DateFormat formats[] = {
DateFormat.getDateInstance(DateFormat.RELATIVE_LONG,new ULocale("en")),
DateFormat.getDateInstance(DateFormat.RELATIVE_SHORT,new ULocale("ru")),
};
-
+
return formats;
}
-
+
+ @Override
public boolean hasSameBehavior(Object a, Object b) {
DateFormat da = (DateFormat)a;
DateFormat db = (DateFormat)b;
-
+
Date d = new Date(System.currentTimeMillis());
return da.format(d).equals(db.format(d));
}
@@ -1037,21 +1043,23 @@ public class FormatHandler
public static class BasicDurationFormatHandler implements SerializableTestUtility.Handler
{
+ @Override
public Object[] getTestObjects()
{
- DurationFormat formats[] = {
+ DurationFormat formats[] = {
DurationFormat.getInstance(new ULocale("en"))
-
+
};
-
+
return formats;
}
-
+
//TODO: Revisit this after 3.8
+ @Override
public boolean hasSameBehavior(Object a, Object b) {
//DurationFormat da = (DurationFormat)a;
//DurationFormat db = (DurationFormat)b;
-
+
//Date d = new Date(12345);
//System.err.println("Warning: BasicDurationFormat test is being skipped for now.");
return true;
@@ -1061,6 +1069,7 @@ public class FormatHandler
public static class NumberFormatHandler implements SerializableTestUtility.Handler
{
+ @Override
public Object[] getTestObjects()
{
ULocale uloc = ULocale.forLocale(Locale.US);
@@ -1068,12 +1077,12 @@ public class FormatHandler
/*
* The code below was used to genereate the
* serialized NumberFormat objects in ICU 3.6:
- *
+ *
* NumberFormat.getInstance(Locale.US)
* NumberFormat.getCurrencyInstance(Locale.US)
* NumberFormat.getPercentInstance(Locale.US)
* NumberFormat.getScientificInstance(Locale.US)
- *
+ *
* Because the locale data might now be different that it was in
* ICU 3.6, the only way to guarantee that the object we generate
* will match the ICU 3.6 objects is to generate DecimalFormat objects
@@ -1084,32 +1093,34 @@ public class FormatHandler
getCannedDecimalFormat("\u00A4#,##0.00;(\u00A4#,##0.00)", uloc),
getCannedDecimalFormat("#,##0%", uloc),
getCannedDecimalFormat("#E0", uloc)
-
+
};
-
+
return formats;
}
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
NumberFormat format_a = (NumberFormat) a;
NumberFormat format_b = (NumberFormat) b;
double number = 1234.56;
-
+
return format_a.format(number).equals(format_b.format(number));
}
}
-
+
public static class DecimalFormatHandler extends NumberFormatHandler
{
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
DecimalFormat formats[] = new DecimalFormat[locales.length];
-
+
for (int i = 0; i < locales.length; i += 1) {
ULocale uloc = ULocale.forLocale(locales[i]);
-
+
formats[i] = getCannedDecimalFormat("#,##0.###", uloc);
}
if (formats[0] != null) {
@@ -1127,15 +1138,15 @@ public class FormatHandler
return formats;
}
}
-
+
public static class RuleBasedNumberFormatHandler extends NumberFormatHandler
{
// default rules, from root.txt
String xx_SpelloutRules = "=#,##0.######=;\n";
String xx_OrdinalRules = "=#,##0=;\n";
String xx_DurationRules = "=#,##0=;\n";
-
- String ja_spelloutRules =
+
+ String ja_spelloutRules =
"%financial:\n" +
"\u96f6; \u58f1; \u5f10; \u53c2; \u56db; \u4f0d; \u516d; \u4e03; \u516b; \u4e5d;\n" +
"\u62fe[>>];\n" +
@@ -1146,7 +1157,7 @@ public class FormatHandler
"100,000,000: <<\u5104[>>];\n" +
"1,000,000,000,000: <<\u5146[>>];\n" +
"10,000,000,000,000,000: =#,##0=;\n" +
-
+
"%traditional:\n" +
"\u96f6; \u4e00; \u4e8c; \u4e09; \u56db; \u4e94; \u516d; \u4e03; \u516b; \u4e5d;\n" +
"\u5341[>>];\n" +
@@ -1157,8 +1168,8 @@ public class FormatHandler
"100,000,000: <<\u5104[>>];\n" +
"1,000,000,000,000: <<\u5146[>>];\n" +
"10,000,000,000,000,000: =#,##0=;";
-
- String en_SpelloutRules =
+
+ String en_SpelloutRules =
// This rule set shows the normal simple formatting rules for English
"%simplified:\n" +
// negative number rule. This rule is used to format negative
@@ -1320,7 +1331,7 @@ public class FormatHandler
"1,000,000: , =%default=;" +
"%%lenient-parse:\n" +
"& ' ' , ',' ;\n";
-
+
String fr_SpelloutRules =
// the main rule set
"%main:\n" +
@@ -1371,10 +1382,10 @@ public class FormatHandler
"1,000,000,000,000,000: =#,##0=;\n" +
// %%alt-ones is used to insert "et" when the ones digit is 1
"%%alt-ones:\n" +
- "; et-un; =%main=;\n" +
+ "; et-un; =%main=;\n" +
"%%lenient-parse:\n" +
"&\u0000 << ' ' << ',' << '-';\n";
-
+
String de_SpelloutRules =
// 1 is "eins" when by itself, but turns into "ein" in most
// combinations
@@ -1414,7 +1425,7 @@ public class FormatHandler
"& ae , \u00e4 & ae , \u00c4\n" +
"& oe , \u00f6 & oe , \u00d6\n" +
"& ue , \u00fc & ue , \u00dc\n";
-
+
String it_SpelloutRules =
// main rule set. Follows the patterns of the preceding rule sets,
// except that the final vowel is omitted from words ending in
@@ -1495,7 +1506,7 @@ public class FormatHandler
"1000: omille; omill[>%%with-i>];\n" +
"2000: <%%with-o%%with-a>];\n" +
"100,000: =%main=;\n" ;
-
+
String en_OrdinalRules =
// this rule set formats the numeral and calls %%abbrev to
// supply the abbreviation
@@ -1512,7 +1523,7 @@ public class FormatHandler
// at 100, we repeat the whole cycle by considering only the
// tens and ones digits in picking an abbreviation
"100: >>;\n";
-
+
String en_DurationRules =
// main rule set for formatting with words
"%with-words:\n" +
@@ -1560,76 +1571,76 @@ public class FormatHandler
"& ':' = '.' = ' ' = '-';\n";
HashMap cannedData = new HashMap();
-
+
{
cannedData.put("en_CA/SpelloutRules", en_SpelloutRules);
cannedData.put("en_CA/OrdinalRules", en_OrdinalRules);
cannedData.put("en_CA/DurationRules", en_DurationRules);
-
+
cannedData.put("fr_CA/SpelloutRules", fr_SpelloutRules);
cannedData.put("fr_CA/OrdinalRules", xx_OrdinalRules);
cannedData.put("fr_CA/DurationRules", xx_DurationRules);
-
+
cannedData.put("zh_CN/SpelloutRules", en_SpelloutRules);
cannedData.put("zh_CN/OrdinalRules", en_OrdinalRules);
cannedData.put("zh_CH/DurationRules", xx_DurationRules);
-
+
cannedData.put("zh/SpelloutRules", en_SpelloutRules);
cannedData.put("zh/OrdinalRules", en_OrdinalRules);
cannedData.put("zh_DurationRules", xx_DurationRules);
-
+
cannedData.put("en/SpelloutRules", en_SpelloutRules);
cannedData.put("en/OrdinalRules", en_OrdinalRules);
cannedData.put("en/DurationRules", en_DurationRules);
-
+
cannedData.put("fr_FR/SpelloutRules", fr_SpelloutRules);
cannedData.put("fr_FR/OrdinalRules", xx_OrdinalRules);
cannedData.put("fr_FR/DurationRules", xx_DurationRules);
-
+
cannedData.put("fr/SpelloutRules", fr_SpelloutRules);
cannedData.put("fr/OrdinalRules", xx_OrdinalRules);
cannedData.put("fr/DurationRules", xx_DurationRules);
-
+
cannedData.put("de/SpelloutRules", de_SpelloutRules);
cannedData.put("de/OrdinalRules", xx_OrdinalRules);
cannedData.put("de/DurationRules", xx_DurationRules);
-
+
cannedData.put("de_DE/SpelloutRules", de_SpelloutRules);
cannedData.put("de_DE/OrdinalRules", xx_OrdinalRules);
cannedData.put("de_DE/DurationRules", xx_DurationRules);
-
+
cannedData.put("it/SpelloutRules", it_SpelloutRules);
cannedData.put("it/OrdinalRules", xx_OrdinalRules);
cannedData.put("it/DurationRules", xx_DurationRules);
-
+
cannedData.put("it_IT/SpelloutRules", it_SpelloutRules);
cannedData.put("it_IT/OrdinalRules", xx_OrdinalRules);
cannedData.put("it_IT/DuratonRules", xx_DurationRules);
-
+
cannedData.put("ko_KR/SpelloutRules", en_SpelloutRules);
cannedData.put("ko_KR/OrdinalRules", en_OrdinalRules);
cannedData.put("ko_KR/DurationRules", en_DurationRules);
-
+
cannedData.put("ko/SpelloutRules", en_SpelloutRules);
cannedData.put("ko/OrdinalRules", en_OrdinalRules);
cannedData.put("ko/DurationRules", en_DurationRules);
-
+
cannedData.put("zh_Hans_CN/SpelloutRules", en_SpelloutRules);
cannedData.put("zh_Hans_CN/OrdinalRules", en_OrdinalRules);
cannedData.put("zh_Hans_CH/DurationRules", xx_DurationRules);
-
+
cannedData.put("zh_Hant_TW/SpelloutRules", en_SpelloutRules);
cannedData.put("zh_Hant_TW/OrdinalRules", en_OrdinalRules);
cannedData.put("zh_Hant_TW/DurationRules", en_DurationRules);
-
+
cannedData.put("zh_TW/SpelloutRules", en_SpelloutRules);
cannedData.put("zh_TW/OrdinalRules", en_OrdinalRules);
cannedData.put("zh_TW/DurationRules", en_DurationRules);
-
+
cannedData.put("en_GB/SpelloutRules", en_GB_SpelloutRules);
cannedData.put("en_GB/OrdinalRules", en_OrdinalRules);
cannedData.put("en_GB/DurationRules", en_DurationRules);
-
+
cannedData.put("en_US/SpelloutRules", en_SpelloutRules);
cannedData.put("en_US/OrdinalRules", en_OrdinalRules);
cannedData.put("en_US/DurationRules", en_DurationRules);
@@ -1637,25 +1648,26 @@ public class FormatHandler
cannedData.put("ja/SpelloutRules", ja_spelloutRules);
cannedData.put("ja/OrdinalRules", xx_OrdinalRules);
cannedData.put("ja/DurationRules", xx_DurationRules);
-
+
cannedData.put("ja_JP/SpelloutRules", ja_spelloutRules);
cannedData.put("ja_JP/OrdinalRules", xx_OrdinalRules);
cannedData.put("ja_JP/DurationRules", xx_DurationRules);
}
-
+
int types[] = {RuleBasedNumberFormat.SPELLOUT, RuleBasedNumberFormat.ORDINAL, RuleBasedNumberFormat.DURATION};
String typeNames[] = {"SpelloutRules", "OrdinalRules", "DurationRules"};
-
+
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
RuleBasedNumberFormat formats[] = new RuleBasedNumberFormat[types.length * locales.length];
int i = 0;
-
+
for (int t = 0; t < types.length; t += 1) {
for (int l = 0; l < locales.length; l += 1) {
String cannedRules = (String) cannedData.get(locales[l].toString() + "/" + typeNames[t]);
-
+
if (cannedRules != null) {
formats[i++] = new RuleBasedNumberFormat(cannedRules, locales[l]);
} else {
@@ -1663,30 +1675,32 @@ public class FormatHandler
}
}
}
-
+
return formats;
}
}
-
+
public static class DecimalFormatSymbolsHandler implements SerializableTestUtility.Handler
{
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
DecimalFormatSymbols dfs[] = new DecimalFormatSymbols[locales.length];
-
+
for (int i = 0; i < locales.length; i += 1) {
ULocale uloc = ULocale.forLocale(locales[i]);
dfs[i] = getCannedDecimalFormatSymbols(uloc);
-// System.out.println("\n " + uloc.toString() + " = \"" +
+// System.out.println("\n " + uloc.toString() + " = \"" +
// com.ibm.icu.impl.Utility.escape(String.valueOf(getCharSymbols(dfs[i]), 0, 12)) + "\"");
}
-
+
return dfs;
}
-
+
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
DecimalFormatSymbols dfs_a = (DecimalFormatSymbols) a;
@@ -1699,9 +1713,10 @@ public class FormatHandler
return SerializableTestUtility.compareStrings(strings_a, strings_b) && SerializableTestUtility.compareChars(chars_a, chars_b);
}
}
-
+
public static class CurrencyPluralInfoHandler implements SerializableTestUtility.Handler
{
+ @Override
public Object[] getTestObjects()
{
CurrencyPluralInfo currencyPluralInfo[] = {
@@ -1715,45 +1730,51 @@ public class FormatHandler
}
return currencyPluralInfo;
}
-
+
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
return a.equals(b);
}
}
-
+
public static class CompactDecimalFormatHandler extends NumberFormatHandler {
+ @Override
public Object[] getTestObjects() {
return new CompactDecimalFormat[0];
}
}
-
+
public static class MessageFormatHandler implements SerializableTestUtility.Handler
{
+ @Override
public Object[] getTestObjects()
{
MessageFormat formats[] = {new MessageFormat("pattern{0}")};
-
+
return formats;
}
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
MessageFormat mfa = (MessageFormat) a;
MessageFormat mfb = (MessageFormat) b;
Object arguments[] = {new Integer(123456)};
-
+
return mfa.format(arguments) != mfb.format(arguments);
}
}
public static class MessageFormatFieldHandler implements SerializableTestUtility.Handler
{
+ @Override
public Object[] getTestObjects()
{
return new Object[] {MessageFormat.Field.ARGUMENT};
}
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
return (a == b);
@@ -1764,7 +1785,7 @@ public class FormatHandler
{
static HashMap cannedPatterns = new HashMap();
static Date fixedDate;
-
+
{
cannedPatterns.put("en_CA", "EEEE, MMMM d, yyyy h:mm:ss a z");
cannedPatterns.put("fr_CA", "EEEE d MMMM yyyy HH' h 'mm' min 'ss' s 'z");
@@ -1786,35 +1807,45 @@ public class FormatHandler
cannedPatterns.put("zh_TW", "yyyy'\u5E74'M'\u6708'd'\u65E5'EEEE ahh'\u6642'mm'\u5206'ss'\u79D2' z");
cannedPatterns.put("en_GB", "EEEE, d MMMM yyyy HH:mm:ss z");
cannedPatterns.put("en_US", "EEEE, MMMM d, yyyy h:mm:ss a z");
-
+
// Get a date that will likely not move in or out of Daylight savings time...
Calendar cal = Calendar.getInstance(Locale.US);
-
+
cal.clear();
cal.set(2007, Calendar.JANUARY, 1, 12, 0, 0); // January 1, 2007 12:00:00 PM.
fixedDate = cal.getTime();
}
-
+
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
DateFormat formats[] = new DateFormat[locales.length];
-
+
for (int i = 0; i < locales.length; i += 1) {
ULocale uloc = ULocale.forLocale(locales[i]);
-
+
//formats[i] = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, locales[i]);
formats[i] = getCannedSimpleDateFormat((String)cannedPatterns.get(uloc.toString()), uloc);
}
-
+
return formats;
}
-
+
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
DateFormat dfa = (DateFormat) a;
DateFormat dfb = (DateFormat) b;
- //Date date = new Date(System.currentTimeMillis());
+
+ // We previously did not use 'canned' time zone.
+ TimeZone tza = dfa.getTimeZone();
+ TimeZone tzb = dfb.getTimeZone();
+ if (!tza.getID().equals(tzb.getID())) {
+ // If IDs do not match, reset TimeZone in dfa.
+ dfa.setTimeZone(tzb);
+ }
+
String sfa = dfa.format(fixedDate);
String sfb = dfb.format(fixedDate);
@@ -1841,14 +1872,19 @@ public class FormatHandler
sfa = dfa.format(fixedDate);
}
-
- return sfa.equals(sfb);
+
+ //return sfa.equals(sfb);
+ if (!sfa.equals(sfb)) {
+ return false;
+ }
+ return true;
}
-
+
}
public static class DateFormatFieldHandler implements SerializableTestUtility.Handler
{
+ @Override
public Object[] getTestObjects() {
return new Object[] {
DateFormat.Field.AM_PM,
@@ -1877,6 +1913,7 @@ public class FormatHandler
DateFormat.Field.QUARTER
};
}
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
return (a == b);
@@ -1885,32 +1922,34 @@ public class FormatHandler
public static class DateFormatSymbolsHandler implements SerializableTestUtility.Handler
{
-
+
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
DateFormatSymbols dfs[] = new DateFormatSymbols[locales.length];
-
+
for (int i = 0; i < locales.length; i += 1) {
ULocale uloc = ULocale.forLocale(locales[i]);
-
+
dfs[i] = getCannedDateFormatSymbols(uloc);
}
-
+
return dfs;
}
-
+
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
DateFormatSymbols dfs_a = (DateFormatSymbols) a;
DateFormatSymbols dfs_b = (DateFormatSymbols) b;
String months_a[] = dfs_a.getMonths();
String months_b[] = dfs_b.getMonths();
-
+
return SerializableTestUtility.compareStrings(months_a, months_b);
}
}
-
+
public static class SimpleDateFormatHandler extends DateFormatHandler
{
String patterns[] = {
@@ -1919,25 +1958,27 @@ public class FormatHandler
"yyyy MMM d",
"yy/MM/dd"
};
-
+
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
SimpleDateFormat dateFormats[] = new SimpleDateFormat[patterns.length * locales.length];
int i = 0;
-
+
for (int p = 0; p < patterns.length; p += 1) {
for (int l = 0; l < locales.length; l += 1) {
dateFormats[i++] = getCannedSimpleDateFormat(patterns[p], ULocale.forLocale(locales[l]));
}
}
-
+
return dateFormats;
}
}
public static class DateIntervalFormatHandler implements SerializableTestUtility.Handler
{
+ @Override
public Object[] getTestObjects()
{
DateIntervalFormat dateIntervalFormats[] = {
@@ -1946,6 +1987,7 @@ public class FormatHandler
return dateIntervalFormats;
}
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
DateIntervalFormat dfa = (DateIntervalFormat) a;
@@ -1961,6 +2003,7 @@ public class FormatHandler
public static class DateIntervalInfoHandler implements SerializableTestUtility.Handler
{
+ @Override
public Object[] getTestObjects()
{
DateIntervalInfo dateIntervalInfo[] = {
@@ -1971,6 +2014,7 @@ public class FormatHandler
return dateIntervalInfo;
}
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
return a.equals(b);
@@ -1980,16 +2024,18 @@ public class FormatHandler
public static class PatternInfoHandler implements SerializableTestUtility.Handler
{
+ @Override
public Object[] getTestObjects()
{
DateIntervalInfo.PatternInfo patternInfo[] = {
- new DateIntervalInfo.PatternInfo("yyyy MMM dd - ",
+ new DateIntervalInfo.PatternInfo("yyyy MMM dd - ",
"dd",
false)
};
return patternInfo;
}
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
return a.equals(b);
@@ -2004,32 +2050,35 @@ public class FormatHandler
"y'x'G-Ml-d",
"y'x'G-Ml-d"
};
-
+
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
ChineseDateFormat dateFormats[] = new ChineseDateFormat[patterns.length * locales.length];
int i = 0;
-
+
for (int p = 0; p < patterns.length; p += 1) {
for (int l = 0; l < locales.length; l += 1) {
ULocale locale = new ULocale(locales[l].toString() + "@calendar=chinese");
-
+
dateFormats[i++] = new ChineseDateFormat(patterns[p], locale);
}
}
-
+
return dateFormats;
}
}
public static class ChineseDateFormatFieldHandler implements SerializableTestUtility.Handler
{
+ @Override
public Object[] getTestObjects() {
return new Object[] {
ChineseDateFormat.Field.IS_LEAP_MONTH
};
}
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
return (a == b);
@@ -2038,30 +2087,32 @@ public class FormatHandler
public static class ChineseDateFormatSymbolsHandler extends DateFormatSymbolsHandler
{
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
ChineseDateFormatSymbols cdfs[] = new ChineseDateFormatSymbols[locales.length];
-
+
for (int i = 0; i < locales.length; i += 1) {
ULocale uloc = ULocale.forLocale(locales[i]);
-
+
cdfs[i] = new ChineseDateFormatSymbols(uloc);
cdfs[i].setMonths((String[]) cannedMonthNames.get(uloc.toString()));
}
-
+
return cdfs;
}
-
+
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
if (! super.hasSameBehavior(a, b)) {
return false;
}
-
+
ChineseDateFormatSymbols cdfs_a = (ChineseDateFormatSymbols) a;
ChineseDateFormatSymbols cdfs_b = (ChineseDateFormatSymbols) b;
-
+
// The old test did this, which tested that the leap month marker never
// changed from one ICU version to the next; this is not a valid test.
//return cdfs_a.getLeapMonth(0).equals(cdfs_b.getLeapMonth(0)) &&
@@ -2079,6 +2130,7 @@ public class FormatHandler
public static class NumberFormatFieldHandler implements SerializableTestUtility.Handler
{
+ @Override
public Object[] getTestObjects()
{
NumberFormat.Field fields[] = {
@@ -2087,21 +2139,23 @@ public class FormatHandler
NumberFormat.Field.GROUPING_SEPARATOR, NumberFormat.Field.INTEGER, NumberFormat.Field.PERCENT,
NumberFormat.Field.PERMILLE, NumberFormat.Field.SIGN
};
-
+
return fields;
}
-
+
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
NumberFormat.Field field_a = (NumberFormat.Field) a;
NumberFormat.Field field_b = (NumberFormat.Field) b;
-
+
return field_a.toString().equals(field_b.toString());
}
}
public static class DateNumberFormatHandler implements SerializableTestUtility.Handler
{
+ @Override
public Object[] getTestObjects()
{
Locale locales[] = SerializableTestUtility.getLocales();
@@ -2113,6 +2167,7 @@ public class FormatHandler
return dnfmts;
}
+ @Override
public boolean hasSameBehavior(Object a, Object b) {
return a.equals(b);
}
@@ -2120,12 +2175,14 @@ public class FormatHandler
public static class SelectFormatHandler implements SerializableTestUtility.Handler {
+ @Override
public Object[] getTestObjects() {
SelectFormat[] selfmts = {new SelectFormat("keyword{phrase} other{otherPhrase}")};
return selfmts;
}
+ @Override
public boolean hasSameBehavior(Object a, Object b) {
SelectFormat sfa = (SelectFormat) a;
SelectFormat sfb = (SelectFormat) b;
@@ -2136,6 +2193,7 @@ public class FormatHandler
}
public static class PluralFormatHandler implements SerializableTestUtility.Handler {
+ @Override
public Object[] getTestObjects() {
Locale[] locales = { Locale.US }; // main test is in plural rules handler
PluralFormat[] plfmts = new PluralFormat[locales.length];
@@ -2149,6 +2207,7 @@ public class FormatHandler
}
return plfmts;
}
+ @Override
public boolean hasSameBehavior(Object a, Object b) {
PluralFormat pfa = (PluralFormat)a;
PluralFormat pfb = (PluralFormat)b;
@@ -2181,6 +2240,7 @@ public class FormatHandler
"few: n mod 100 in 3..4; one: n mod 100 is 1; two: n mod 100 is 2", // sl
};
+ @Override
public Object[] getTestObjects() {
PluralRules[] plrulz = new PluralRules[cannedRules.length];
for (int i = 0; i < cannedRules.length; i++) {
@@ -2192,18 +2252,21 @@ public class FormatHandler
}
return plrulz;
}
+ @Override
public boolean hasSameBehavior(Object a, Object b) {
return a.equals(b);
}
}
-
+
public static class PluralRulesSerialProxyHandler implements SerializableTestUtility.Handler {
// Tested through PluralRules, so just a stub here to keep CoverageTest happy
final String[] cannedRules = {};
+ @Override
public Object[] getTestObjects() {
return new PluralRules[cannedRules.length];
}
+ @Override
public boolean hasSameBehavior(Object a, Object b) {
return a.equals(b);
}
@@ -2213,9 +2276,11 @@ public class FormatHandler
public static class TimeUnitFormatHandler implements SerializableTestUtility.Handler {
// TODO - more test coverage!
+ @Override
public Object[] getTestObjects() {
return new Object[] { new TimeUnitFormat().setLocale(ULocale.ENGLISH) };
}
+ @Override
public boolean hasSameBehavior(Object a, Object b) {
TimeUnitFormat tufa = (TimeUnitFormat)a;
TimeUnitFormat tufb = (TimeUnitFormat)b;
@@ -2229,12 +2294,14 @@ public class FormatHandler
}
public static class TimeZoneNamesHandler implements SerializableTestUtility.Handler {
+ @Override
public Object[] getTestObjects() {
return new Object[] {
TimeZoneNames.getInstance(ULocale.ENGLISH),
TimeZoneNames.getInstance(ULocale.JAPAN)
};
}
+ @Override
public boolean hasSameBehavior(Object a, Object b) {
TimeZoneNames tzna = (TimeZoneNames)a;
TimeZoneNames tznb = (TimeZoneNames)b;
@@ -2263,12 +2330,14 @@ public class FormatHandler
}
public static class TimeZoneGenericNamesHandler implements SerializableTestUtility.Handler {
+ @Override
public Object[] getTestObjects() {
return new Object[] {
TimeZoneGenericNames.getInstance(ULocale.ENGLISH),
TimeZoneGenericNames.getInstance(ULocale.JAPAN)
};
}
+ @Override
public boolean hasSameBehavior(Object a, Object b) {
TimeZoneGenericNames tzgna = (TimeZoneGenericNames)a;
TimeZoneGenericNames tzgnb = (TimeZoneGenericNames)b;
@@ -2302,12 +2371,14 @@ public class FormatHandler
}
public static class TZDBTimeZoneNamesHandler implements SerializableTestUtility.Handler {
+ @Override
public Object[] getTestObjects() {
return new Object[] {
TimeZoneNames.getTZDBInstance(ULocale.ENGLISH),
TimeZoneNames.getTZDBInstance(ULocale.JAPAN)
};
}
+ @Override
public boolean hasSameBehavior(Object a, Object b) {
TZDBTimeZoneNames tzdbna = (TZDBTimeZoneNames)a;
TZDBTimeZoneNames tzdbnb = (TZDBTimeZoneNames)b;
@@ -2348,12 +2419,14 @@ public class FormatHandler
public static class TimeZoneFormatHandler implements SerializableTestUtility.Handler {
static final String CUSTOM_GMT_PATTERN = "Offset {0} from UTC";
+ @Override
public Object[] getTestObjects() {
TimeZoneFormat tzfmt = TimeZoneFormat.getInstance(ULocale.ENGLISH).cloneAsThawed();
tzfmt.setGMTPattern(CUSTOM_GMT_PATTERN);
return new Object[] {tzfmt};
}
+ @Override
public boolean hasSameBehavior(Object a, Object b) {
TimeZoneFormat tzfa = (TimeZoneFormat)a;
TimeZoneFormat tzfb = (TimeZoneFormat)b;
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/SerializableTestUtility.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/SerializableTestUtility.java
index 04a9c56b55..99660b0c05 100644
--- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/SerializableTestUtility.java
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/SerializableTestUtility.java
@@ -16,6 +16,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.reflect.Modifier;
@@ -70,34 +71,36 @@ public class SerializableTestUtility {
e.printStackTrace();
}
}
-
+
public interface Handler
{
public Object[] getTestObjects();
-
+
public boolean hasSameBehavior(Object a, Object b);
}
-
+
public static Handler getHandler(String className)
{
return (Handler) map.get(className);
}
-
+
private static class TimeZoneHandler implements Handler
{
String[] ZONES = { "GMT", "MET", "IST" };
+ @Override
public Object[] getTestObjects()
{
TimeZone zones[] = new TimeZone[ZONES.length];
-
+
for(int z = 0; z < ZONES.length; z += 1) {
zones[z] = TimeZone.getTimeZone(ZONES[z]);
}
-
+
return zones;
}
-
+
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
TimeZone zone_a = (TimeZone) a;
@@ -122,89 +125,91 @@ public class SerializableTestUtility {
return bSame;
}
}
-
+
private static Locale locales[] = {
- Locale.CANADA, Locale.CANADA_FRENCH, Locale.CHINA,
- Locale.CHINESE, Locale.ENGLISH, Locale.FRANCE, Locale.FRENCH,
- Locale.GERMAN, Locale.GERMANY, Locale.ITALIAN, Locale.ITALY,
- Locale.JAPAN, Locale.JAPANESE, Locale.KOREA, Locale.KOREAN,
- Locale.PRC, Locale.SIMPLIFIED_CHINESE, Locale.TAIWAN,
+ Locale.CANADA, Locale.CANADA_FRENCH, Locale.CHINA,
+ Locale.CHINESE, Locale.ENGLISH, Locale.FRANCE, Locale.FRENCH,
+ Locale.GERMAN, Locale.GERMANY, Locale.ITALIAN, Locale.ITALY,
+ Locale.JAPAN, Locale.JAPANESE, Locale.KOREA, Locale.KOREAN,
+ Locale.PRC, Locale.SIMPLIFIED_CHINESE, Locale.TAIWAN,
Locale.TRADITIONAL_CHINESE, Locale.UK, Locale.US
};
-
+
private static Locale places[] = {
- Locale.CANADA, Locale.CANADA_FRENCH, Locale.CHINA,
- Locale.FRANCE, Locale.GERMANY, Locale.ITALY,
- Locale.JAPAN, Locale.KOREA, Locale.PRC, Locale.TAIWAN,
+ Locale.CANADA, Locale.CANADA_FRENCH, Locale.CHINA,
+ Locale.FRANCE, Locale.GERMANY, Locale.ITALY,
+ Locale.JAPAN, Locale.KOREA, Locale.PRC, Locale.TAIWAN,
Locale.UK, Locale.US
};
-
+
public static Locale[] getLocales()
{
return locales;
}
-
+
public static boolean compareStrings(String a[], String b[])
{
if (a.length != b.length) {
return false;
}
-
+
for (int i = 0; i < a.length; i += 1) {
if (! a[i].equals(b[i])) {
return false;
}
}
-
+
return true;
}
-
+
public static boolean compareChars(char a[], char b[])
{
if (a.length != b.length) {
return false;
}
-
+
for (int i = 0; i < a.length; i += 1) {
if (a[i] != b[i]) {
return false;
}
}
-
+
return true;
}
private static class SimpleTimeZoneHandler extends TimeZoneHandler
{
+ @Override
public Object[] getTestObjects()
{
SimpleTimeZone simpleTimeZones[] = new SimpleTimeZone[6];
-
+
simpleTimeZones[0] = new SimpleTimeZone(32400000, "MyTimeZone");
-
+
simpleTimeZones[1] = new SimpleTimeZone(32400000, "Asia/Tokyo");
-
+
simpleTimeZones[2] = new SimpleTimeZone(32400000, "Asia/Tokyo");
simpleTimeZones[2].setRawOffset(0);
-
+
simpleTimeZones[3] = new SimpleTimeZone(32400000, "Asia/Tokyo");
simpleTimeZones[3].setStartYear(100);
-
+
simpleTimeZones[4] = new SimpleTimeZone(32400000, "Asia/Tokyo");
simpleTimeZones[4].setStartYear(1000);
simpleTimeZones[4].setDSTSavings(1800000);
simpleTimeZones[4].setStartRule(3, 4, 180000);
simpleTimeZones[4].setEndRule(6, 3, 4, 360000);
-
+
simpleTimeZones[5] = new SimpleTimeZone(32400000, "Asia/Tokyo");
simpleTimeZones[5].setStartRule(2, 3, 4, 360000);
simpleTimeZones[5].setEndRule(6, 3, 4, 360000);
-
+
return simpleTimeZones;
}
}
private static class VTimeZoneHandler extends TimeZoneHandler {
+ @Override
public Object[] getTestObjects() {
//TODO
VTimeZone[] vtzs = new VTimeZone[1];
@@ -218,11 +223,11 @@ public class SerializableTestUtility {
new AnnualTimeZoneRule("EST", -5*HOUR, 0,
new DateTimeRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2*HOUR, DateTimeRule.WALL_TIME),
1967, 2006),
-
+
new AnnualTimeZoneRule("EST", -5*HOUR, 0,
new DateTimeRule(Calendar.NOVEMBER, 1, Calendar.SUNDAY, true, 2*HOUR, DateTimeRule.WALL_TIME),
2007, AnnualTimeZoneRule.MAX_YEAR),
-
+
new AnnualTimeZoneRule("EDT", -5*HOUR, 1*HOUR,
new DateTimeRule(Calendar.APRIL, -1, Calendar.SUNDAY, 2*HOUR, DateTimeRule.WALL_TIME),
1967, 1973),
@@ -250,6 +255,7 @@ public class SerializableTestUtility {
private static class RuleBasedTimeZoneHandler extends TimeZoneHandler
{
+ @Override
public Object[] getTestObjects()
{
RuleBasedTimeZone ruleBasedTimeZones[] = new RuleBasedTimeZone[2];
@@ -270,6 +276,7 @@ public class SerializableTestUtility {
}
private static class DateTimeRuleHandler implements Handler {
+ @Override
public Object[] getTestObjects() {
DateTimeRule[] rules = new DateTimeRule[4];
@@ -288,6 +295,7 @@ public class SerializableTestUtility {
return rules;
}
+ @Override
public boolean hasSameBehavior(Object a, Object b) {
return hasSameRule((DateTimeRule)a, (DateTimeRule)b);
}
@@ -313,7 +321,7 @@ public class SerializableTestUtility {
break;
}
}
- return bSame;
+ return bSame;
}
}
@@ -323,14 +331,16 @@ public class SerializableTestUtility {
ra.getDSTSavings() == rb.getDSTSavings()) {
return true;
}
- return false;
+ return false;
}
private static class AnnualTimeZoneRuleHandler implements Handler {
+ @Override
public Object[] getTestObjects() {
return TEST_US_EASTERN;
}
+ @Override
public boolean hasSameBehavior(Object a, Object b) {
AnnualTimeZoneRule ra = (AnnualTimeZoneRule)a;
AnnualTimeZoneRule rb = (AnnualTimeZoneRule)b;
@@ -344,6 +354,7 @@ public class SerializableTestUtility {
}
private static class InitialTimeZoneRuleHandler implements Handler {
+ @Override
public Object[] getTestObjects() {
TimeZoneRule[] rules = new TimeZoneRule[2];
rules[0] = new InitialTimeZoneRule("EST", -5*HOUR, 0);
@@ -351,12 +362,14 @@ public class SerializableTestUtility {
return rules;
}
+ @Override
public boolean hasSameBehavior(Object a, Object b) {
return compareTimeZoneRules((TimeZoneRule)a, (TimeZoneRule)b);
}
}
private static class TimeArrayTimeZoneRuleHandler implements Handler {
+ @Override
public Object[] getTestObjects() {
TimeArrayTimeZoneRule[] rules = new TimeArrayTimeZoneRule[1];
long[] ttime = new long[] {-631152000000L, 0L, 946684800000L}; /* {1950-1-1, 1970-1-1, 2000-1-1} */
@@ -364,6 +377,7 @@ public class SerializableTestUtility {
return rules;
}
+ @Override
public boolean hasSameBehavior(Object a, Object b) {
TimeArrayTimeZoneRule ra = (TimeArrayTimeZoneRule)a;
TimeArrayTimeZoneRule rb = (TimeArrayTimeZoneRule)b;
@@ -393,36 +407,40 @@ public class SerializableTestUtility {
private static class ULocaleHandler implements Handler
{
+ @Override
public Object[] getTestObjects()
{
ULocale uLocales[] = new ULocale[locales.length];
-
+
for (int i = 0; i < locales.length; i += 1) {
uLocales[i] = ULocale.forLocale(locales[i]);
}
-
+
return uLocales;
}
-
+
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
ULocale uloc_a = (ULocale) a;
ULocale uloc_b = (ULocale) b;
-
+
return uloc_a.getName().equals(uloc_b.getName());
}
}
-
+
public static class DateIntervalHandler implements Handler
{
private DateInterval dateInterval[] = {
new DateInterval(0L, 1164931200000L/*20061201T000000Z*/)
};
+ @Override
public Object[] getTestObjects()
{
return dateInterval;
}
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
return a.equals(b);
@@ -431,28 +449,30 @@ public class SerializableTestUtility {
private static class CurrencyHandler implements Handler
{
+ @Override
public Object[] getTestObjects()
{
Currency currencies[] = new Currency[places.length];
-
+
for (int i = 0; i < places.length; i += 1) {
currencies[i] = Currency.getInstance(places[i]);
}
-
+
return currencies;
}
-
+
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
-
+
Currency curr_a = (Currency) a;
Currency curr_b = (Currency) b;
-
- return a == b
- || a != null && b != null
+
+ return a == b
+ || a != null && b != null
&& curr_a.getCurrencyCode() != null
&& curr_a.getCurrencyCode().equals(curr_b.getCurrencyCode());
-
+
}
}
@@ -464,7 +484,7 @@ public class SerializableTestUtility {
"Europe/Amsterdam", "Europe/Athens", "Europe/Berlin", "Europe/London", "Europe/Malta", "Europe/Moscow",
"Europe/Paris", "Europe/Rome"
};
-
+
private static long sampleTimes[] = {
1136073600000L, // 20060101T000000Z
1138752000000L, // 20060201T000000Z
@@ -482,18 +502,20 @@ public class SerializableTestUtility {
private static class OlsonTimeZoneHandler implements Handler
{
+ @Override
public Object[] getTestObjects()
{
OlsonTimeZone timeZones[] = new OlsonTimeZone[zoneIDs.length];
-
+
for (int i = 0; i < zoneIDs.length; i += 1) {
timeZones[i] = new OlsonTimeZone(zoneIDs[i]);
}
-
+
return timeZones;
-
+
}
-
+
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
OlsonTimeZone otz_a = (OlsonTimeZone) a;
@@ -516,24 +538,26 @@ public class SerializableTestUtility {
private static class TimeZoneAdapterHandler implements Handler
{
+ @Override
public Object[] getTestObjects()
{
TimeZoneAdapter timeZones[] = new TimeZoneAdapter[zoneIDs.length];
-
+
for (int i = 0; i < zoneIDs.length; i += 1) {
timeZones[i] = new TimeZoneAdapter(TimeZone.getTimeZone(zoneIDs[i]));
}
-
+
return timeZones;
-
+
}
-
+
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
GregorianCalendar cal = new GregorianCalendar();
TimeZoneAdapter tza_a = (TimeZoneAdapter) a;
TimeZoneAdapter tza_b = (TimeZoneAdapter) b;
-
+
int a_offset, b_offset;
boolean a_dst, b_dst;
boolean bSame = true;
@@ -562,6 +586,7 @@ public class SerializableTestUtility {
private static class JavaTimeZoneHandler implements Handler {
String[] ZONES = { "GMT", "America/New_York", "GMT+05:45" };
+ @Override
public Object[] getTestObjects() {
JavaTimeZone zones[] = new JavaTimeZone[ZONES.length];
for(int z = 0; z < ZONES.length; z += 1) {
@@ -570,7 +595,8 @@ public class SerializableTestUtility {
}
return zones;
}
-
+
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
TimeZone zone_a = (TimeZone) a;
@@ -610,26 +636,28 @@ public class SerializableTestUtility {
"12.34567890",
"1.234567890",
".1234567890"};
-
+
+ @Override
public Object[] getTestObjects()
{
BigDecimal bds[] = new BigDecimal[values.length];
-
+
for (int i = 0; i < values.length; i += 1) {
bds[i] = new BigDecimal(values[i]);
}
-
+
return bds;
}
-
+
+ @Override
public boolean hasSameBehavior(Object a, Object b) {
BigDecimal bda = (BigDecimal) a;
BigDecimal bdb = (BigDecimal) b;
-
+
return bda.toString().equals(bdb.toString());
}
}
-
+
private static class MathContextHandler implements Handler
{
int forms[] = {MathContext.PLAIN, MathContext.ENGINEERING, MathContext.SCIENTIFIC};
@@ -638,41 +666,44 @@ public class SerializableTestUtility {
MathContext.ROUND_HALF_DOWN, MathContext.ROUND_HALF_EVEN, MathContext.ROUND_HALF_UP,
MathContext.ROUND_UNNECESSARY, MathContext.ROUND_UP};
+ @Override
public Object[] getTestObjects()
{
int objectCount = forms.length * rounds.length;
MathContext contexts[] = new MathContext[objectCount];
int i = 0;
-
+
for (int f = 0; f < forms.length; f += 1) {
for (int r = 0; r < rounds.length; r += 1) {
int digits = f * r;
boolean lostDigits = (r & 1) != 0;
-
+
contexts[i++] = new MathContext(digits, forms[f], lostDigits, rounds[r]);
}
}
-
+
return contexts;
}
-
+
+ @Override
public boolean hasSameBehavior(Object a, Object b)
{
MathContext mca = (MathContext) a;
MathContext mcb = (MathContext) b;
-
+
return mca.toString().equals(mcb.toString());
}
}
private static abstract class ExceptionHandlerBase implements Handler {
+ @Override
public boolean hasSameBehavior(Object a, Object b) {
return sameThrowable((Exception) a, (Exception) b);
}
// Exception.equals() does not seem to work.
private static final boolean sameThrowable(Throwable a, Throwable b) {
- return a == null ? b == null :
+ return a == null ? b == null :
b == null ? false :
a.getClass().equals(b.getClass()) &&
Utility.objectEquals(a.getMessage(), b.getMessage()) &&
@@ -681,6 +712,7 @@ public class SerializableTestUtility {
}
private static class ICUExceptionHandler extends ExceptionHandlerBase {
+ @Override
public Object[] getTestObjects() {
return new ICUException[] {
new ICUException(),
@@ -692,6 +724,7 @@ public class SerializableTestUtility {
}
private static class ICUUncheckedIOExceptionHandler extends ExceptionHandlerBase {
+ @Override
public Object[] getTestObjects() {
return new ICUUncheckedIOException[] {
new ICUUncheckedIOException(),
@@ -703,6 +736,7 @@ public class SerializableTestUtility {
}
private static class ICUCloneNotSupportedExceptionHandler extends ExceptionHandlerBase {
+ @Override
public Object[] getTestObjects() {
return new ICUCloneNotSupportedException[] {
new ICUCloneNotSupportedException(),
@@ -714,7 +748,7 @@ public class SerializableTestUtility {
}
private static HashMap map = new HashMap();
-
+
static {
map.put("com.ibm.icu.util.TimeZone", new TimeZoneHandler());
map.put("com.ibm.icu.util.SimpleTimeZone", new SimpleTimeZoneHandler());
@@ -731,7 +765,7 @@ public class SerializableTestUtility {
map.put("com.ibm.icu.impl.TimeZoneAdapter", new TimeZoneAdapterHandler());
map.put("com.ibm.icu.math.BigDecimal", new BigDecimalHandler());
map.put("com.ibm.icu.math.MathContext", new MathContextHandler());
-
+
map.put("com.ibm.icu.text.NumberFormat", new FormatHandler.NumberFormatHandler());
map.put("com.ibm.icu.text.DecimalFormat", new FormatHandler.DecimalFormatHandler());
map.put("com.ibm.icu.text.CompactDecimalFormat", new FormatHandler.CompactDecimalFormatHandler());
@@ -772,7 +806,7 @@ public class SerializableTestUtility {
map.put("com.ibm.icu.util.JapaneseCalendar", new CalendarHandler.JapaneseCalendarHandler());
map.put("com.ibm.icu.util.PersianCalendar", new CalendarHandler.PersianCalendarHandler());
map.put("com.ibm.icu.util.TaiwanCalendar", new CalendarHandler.TaiwanCalendarHandler());
-
+
map.put("com.ibm.icu.text.ArabicShapingException", new ExceptionHandler.ArabicShapingExceptionHandler());
map.put("com.ibm.icu.text.StringPrepParseException", new ExceptionHandler.StringPrepParseExceptionHandler());
map.put("com.ibm.icu.util.UResourceTypeMismatchException", new ExceptionHandler.UResourceTypeMismatchExceptionHandler());
@@ -798,7 +832,7 @@ public class SerializableTestUtility {
map.put("com.ibm.icu.util.ICUUncheckedIOException", new ICUUncheckedIOExceptionHandler());
map.put("com.ibm.icu.util.ICUCloneNotSupportedException", new ICUCloneNotSupportedExceptionHandler());
}
-
+
/*
* Serialization Helpers
*/
@@ -829,6 +863,17 @@ public class SerializableTestUtility {
return objects;
}
+ static byte[] copyStreamBytes(InputStream is) throws IOException {
+ byte[] buffer = new byte[1024];
+
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ int len;
+ while((len = is.read(buffer, 0, buffer.length)) >= 0) {
+ bos.write(buffer, 0, len);
+ }
+ return bos.toByteArray();
+ }
+
static List getSerializationClassList(Object caller) throws IOException {
List classList = new ArrayList();
Enumeration urlEnum = caller.getClass().getClassLoader().getResources("com/ibm/icu");
@@ -842,8 +887,6 @@ public class SerializableTestUtility {
CoverageClassVisitor visitor = new CoverageClassVisitor(classList);
handler.guide(visitor, true, false);
}
- // TODO(junit): add randomization support on the list based on the params object
-
return classList;
}
@@ -853,7 +896,7 @@ public class SerializableTestUtility {
public CoverageClassVisitor(List classNamesList) {
this.classNames = classNamesList;
}
-
+
/* (non-Javadoc)
* @see com.ibm.icu.impl.URLHandler.URLVisitor#visit(java.lang.String)
*/
@@ -881,7 +924,7 @@ public class SerializableTestUtility {
// Known Issue: "10268", "Serializable interface is not implemented in PluralRules$FixedDecimal"
return;
}
-
+
if (c.isEnum() || !serializable.isAssignableFrom(c)) {
//System.out.println("@@@ Skipping: " + className);
return;
@@ -891,8 +934,8 @@ public class SerializableTestUtility {
return;
}
- this.classNames.add(className);
- }
+ this.classNames.add(className);
+ }
}
public static void serializeObjects(File oof, Object[] objectsOut) throws IOException {
@@ -900,6 +943,6 @@ public class SerializableTestUtility {
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(objectsOut);
- oos.close();
+ oos.close();
}
}
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/SerializableWriter.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/SerializableWriter.java
index be6448e543..c7c8775c57 100644
--- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/SerializableWriter.java
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/SerializableWriter.java
@@ -16,23 +16,24 @@ import java.net.URL;
import java.util.List;
import com.ibm.icu.dev.test.serializable.SerializableTestUtility.Handler;
+import com.ibm.icu.util.TimeZone;
import com.ibm.icu.util.VersionInfo;
/**
* This class writes the test objects for each class to a file. The work is
* actually done by the superclass, CoverageTest. This class just constructs
* a CoverageTest w/ a non-null path, which tells it to write the data.
- *
+ *
*/
public class SerializableWriter
{
String path;
-
+
public SerializableWriter(String path)
{
this.path = path;
}
-
+
private static String folderName()
{
int major = VersionInfo.ICU_VERSION.getMajor();
@@ -40,21 +41,21 @@ public class SerializableWriter
int milli = VersionInfo.ICU_VERSION.getMilli();
int micro = VersionInfo.ICU_VERSION.getMicro();
StringBuffer result = new StringBuffer("ICU_");
-
+
result.append(major);
result.append(".");
result.append(minor);
-
+
if (milli != 0 || micro != 0) {
result.append(".");
result.append(milli);
-
+
if (micro != 0) {
result.append(".");
result.append(micro);
}
}
-
+
return result.toString();
}
@@ -67,11 +68,16 @@ public class SerializableWriter
} else {
outDir = args[0] + "/" + folderName();
}
+
+ // Override default TimeZone, so serialized data always use
+ // the consistent zone if not specified.
+ TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles"));
+
SerializableWriter writer = new SerializableWriter(outDir);
-
+
writer.serialize();
}
-
+
public void serialize() throws IOException {
File outDir = new File(this.path);
if (!outDir.exists()) {
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.DateNumberFormat.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.DateNumberFormat.dat
new file mode 100644
index 0000000000..aadb61b6f3
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.DateNumberFormat.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2e076133fbfb1fa01df3515276900f0d813d218fc3f3659e61f0fa8360d4db41
+size 2602
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.IllegalIcuArgumentException.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.IllegalIcuArgumentException.dat
new file mode 100644
index 0000000000..fcdf7074bc
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.IllegalIcuArgumentException.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d46a8bf51841a49ecd7e6aacd3a24a33a435e93d624be020286ab560bdb56cc3
+size 858
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.InvalidFormatException.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.InvalidFormatException.dat
new file mode 100644
index 0000000000..73959821a2
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.InvalidFormatException.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:007f10d179c32c17a62c1e021e3ee1381507c666472b54c31a9e72682bafa734
+size 2821
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.JavaTimeZone.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.JavaTimeZone.dat
new file mode 100644
index 0000000000..d603ef173a
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.JavaTimeZone.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3b71a1aa6334661bafe78b40cdd292172639a4983f620a6aeafd8157451010fd
+size 2543
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.OlsonTimeZone.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.OlsonTimeZone.dat
new file mode 100644
index 0000000000..670baab5d0
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.OlsonTimeZone.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d7ba49ddbe1ad869e09c92ada38237971c4c1c8de16ab8769ddde3f9188247e3
+size 20881
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.RelativeDateFormat.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.RelativeDateFormat.dat
new file mode 100644
index 0000000000..beb35dbf48
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.RelativeDateFormat.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1c14ed2e27b5f6556750e42125976c5a027371bea9d0965f6aac091f65da1e68
+size 11745
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.TZDBTimeZoneNames.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.TZDBTimeZoneNames.dat
new file mode 100644
index 0000000000..5a848aeca7
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.TZDBTimeZoneNames.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8608e66b6546ae9f6bb85d79b4b3beca87ab638f29d7df33e0caaebba54a6e23
+size 277
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.TimeZoneAdapter.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.TimeZoneAdapter.dat
new file mode 100644
index 0000000000..ddf4db08e8
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.TimeZoneAdapter.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9ab6c8736be1b77c7a1b7665d2feb013c00072e4b11c6cea44cdec9f645d6e5f
+size 21314
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.TimeZoneGenericNames.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.TimeZoneGenericNames.dat
new file mode 100644
index 0000000000..63fda57dcc
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.TimeZoneGenericNames.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b8ef55074e7991297b91ac7380f700f51d18690ee28fe7499d1381b39b0ea2d3
+size 407
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.TimeZoneNamesImpl.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.TimeZoneNamesImpl.dat
new file mode 100644
index 0000000000..c35851b579
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.TimeZoneNamesImpl.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:812d83205f06d1db97d0819087505a54d6950156cae86d828be0badbfbfc23f0
+size 237
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.duration.BasicDurationFormat.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.duration.BasicDurationFormat.dat
new file mode 100644
index 0000000000..236f236348
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.duration.BasicDurationFormat.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:be22e604c7544d27c107537930361e3526870a26c1a249e2d9f41ddc1d3239f5
+size 383
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.locale.LocaleSyntaxException.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.locale.LocaleSyntaxException.dat
new file mode 100644
index 0000000000..cd08852b0f
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.impl.locale.LocaleSyntaxException.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2ceb146db0a66f1a8d06786791d5dbd25d6fd2f426e05f97d574db36b36638f1
+size 873
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.math.BigDecimal.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.math.BigDecimal.dat
new file mode 100644
index 0000000000..f7fdd5692e
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.math.BigDecimal.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f98076a5c5a606c20e2a049bdcf0ab2e615c54ee8e54d5757fb5c098b90d1273
+size 520
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.math.MathContext.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.math.MathContext.dat
new file mode 100644
index 0000000000..32df3deacf
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.math.MathContext.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:57a0769d52aeb561113d877592e03a42106ea2a80ec7b59ebb812deb7788c170
+size 595
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.ArabicShapingException.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.ArabicShapingException.dat
new file mode 100644
index 0000000000..18315bb898
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.ArabicShapingException.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:690b4fe479e544675e35e16712620911f1a53e43d20e702b27dfdfa3c0e83e56
+size 2821
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.ChineseDateFormat$Field.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.ChineseDateFormat$Field.dat
new file mode 100644
index 0000000000..80067c81a3
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.ChineseDateFormat$Field.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:db0685c5127565fd7ce341056104753b6599826d54d06fde4f9e4f2bd734544f
+size 312
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.ChineseDateFormat.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.ChineseDateFormat.dat
new file mode 100644
index 0000000000..eda1c02d4b
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.ChineseDateFormat.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:10de87551bd60bd9fba29753d5b2a2bf632210369d780e7ab8989b7b3f129048
+size 92518
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.ChineseDateFormatSymbols.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.ChineseDateFormatSymbols.dat
new file mode 100644
index 0000000000..f3febdbf5e
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.ChineseDateFormatSymbols.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3d5beee0e054eb94606e71559f7ec316d6feae409e4c6aec7599e7c570065f15
+size 39846
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.CompactDecimalFormat.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.CompactDecimalFormat.dat
new file mode 100644
index 0000000000..16c2093578
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.CompactDecimalFormat.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:125293c45e05b468166d42e25fef4dad72989bf8a60003b70e9f266788bde4fd
+size 65
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.CurrencyPluralInfo.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.CurrencyPluralInfo.dat
new file mode 100644
index 0000000000..448af7b74f
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.CurrencyPluralInfo.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a55aa52c6c1edf080da6c13e5e2a8d285cff872a1e3a73365891a6f23ce3c708
+size 1186
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateFormat$Field.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateFormat$Field.dat
new file mode 100644
index 0000000000..47c1ebf9c9
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateFormat$Field.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e237efb9ce85357480d9dd5d8d0911ce008744c51778c42e21c9d206a8252095
+size 792
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateFormat.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateFormat.dat
new file mode 100644
index 0000000000..a8a2d72cf1
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateFormat.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1471904e4c84ce2bc2047d24618aa52901be0166bb7d39636799a7836846332c
+size 47091
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateFormatSymbols.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateFormatSymbols.dat
new file mode 100644
index 0000000000..465fec912f
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateFormatSymbols.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a6d4d03f175b168e78b142747b523ed85583e239a72cda1ea8529ec29426ab19
+size 31740
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateIntervalFormat.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateIntervalFormat.dat
new file mode 100644
index 0000000000..01aa1f7eea
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateIntervalFormat.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:438a0452ca86ab03d6ecc5d04911b99d3a787a66f3f9259bb01a30943491bbec
+size 10974
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateIntervalInfo$PatternInfo.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateIntervalInfo$PatternInfo.dat
new file mode 100644
index 0000000000..e660cb3058
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateIntervalInfo$PatternInfo.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2b5593c919fb29bab1d8ca90b6bd69db8669386ec4088da85b8a8ec93d1d8acd
+size 270
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateIntervalInfo.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateIntervalInfo.dat
new file mode 100644
index 0000000000..26a38ab1a5
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DateIntervalInfo.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:875bb8966aff03b29eac45bf77914c14365ffb416d7c61da37098372c6bc9160
+size 568
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DecimalFormat.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DecimalFormat.dat
new file mode 100644
index 0000000000..27ae05cebc
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DecimalFormat.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1b034a3f554a6fa60e385d9066b9daa5c4f0b0d732c7bbb1dbb2611273480e0d
+size 12451
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DecimalFormatSymbols.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DecimalFormatSymbols.dat
new file mode 100644
index 0000000000..e897e04ca3
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.DecimalFormatSymbols.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:36af0d2ba0e418fa1c9ceb7586e0b7567ceadc34c5d229fd2b20b79acac0a916
+size 7109
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.MeasureFormat.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.MeasureFormat.dat
new file mode 100644
index 0000000000..8276f1424f
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.MeasureFormat.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fa437a891f5d947c988592f56888cb96fbda9f97719f49e73a19851111f3ed89
+size 4044
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.MessageFormat$Field.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.MessageFormat$Field.dat
new file mode 100644
index 0000000000..052ec8cc11
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.MessageFormat$Field.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9a6147211fa9bf91b682c75e5bf6609143e9b41ff952f3349fb05833dc798584
+size 249
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.MessageFormat.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.MessageFormat.dat
new file mode 100644
index 0000000000..5179dd7674
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.MessageFormat.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8c204a5460c44ab7be5a2070b6250f03cdb3e3a65ebdd257949fac2c6dda3150
+size 382
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.NumberFormat$Field.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.NumberFormat$Field.dat
new file mode 100644
index 0000000000..f43046877d
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.NumberFormat$Field.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:00baeb776002e737189513debb0d9634dcdf6821a55f9d138ddd207d5bdd90b6
+size 449
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.NumberFormat.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.NumberFormat.dat
new file mode 100644
index 0000000000..6aa223c61b
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.NumberFormat.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a3cf26862ce0858125089315303321a9dbd3c6d14023db139f2183d6b02268c2
+size 4738
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.PluralFormat.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.PluralFormat.dat
new file mode 100644
index 0000000000..0443fa96b7
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.PluralFormat.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:194e815fdd82aa71706ecc30d956a4b989479abad909f6aae2be6c8d4e6f1953
+size 3853
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.PluralRules.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.PluralRules.dat
new file mode 100644
index 0000000000..88fc043c6c
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.PluralRules.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a83cb51352d9b291a9e527e4fe3e8d5392a340ba0d1544d65bd9d0dd8b642026
+size 872
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.RuleBasedNumberFormat.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.RuleBasedNumberFormat.dat
new file mode 100644
index 0000000000..f8aaf52c68
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.RuleBasedNumberFormat.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3e41842affa91bd0d5aef2bd95f546d22fdff59f32181bfc6cd50ac788a0ffdd
+size 44566
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.SelectFormat.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.SelectFormat.dat
new file mode 100644
index 0000000000..43679c6473
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.SelectFormat.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f75aa31550301ece69b7ed355f8b3414b73e6cf5e6ce8bd1b1bd7e4aec61156b
+size 202
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.SimpleDateFormat.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.SimpleDateFormat.dat
new file mode 100644
index 0000000000..5c65d5aa90
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.SimpleDateFormat.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:39d2494df3dcc26a103a88e341e0765008b34bb5d6b31867a50f70fa05c9c96f
+size 90967
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.StringPrepParseException.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.StringPrepParseException.dat
new file mode 100644
index 0000000000..7287b62a9a
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.StringPrepParseException.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:65a8af42fdd81a7b0dfaf8c42016b1a16aae58390a902f4be4e385928cddbbb5
+size 7356
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.TimeUnitFormat.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.TimeUnitFormat.dat
new file mode 100644
index 0000000000..d940ed2f93
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.TimeUnitFormat.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fee16b9a8376b7b8d4436f302e12be17683ce3f4242d104c0eaee0b9fb58916c
+size 3497
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.TimeZoneFormat.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.TimeZoneFormat.dat
new file mode 100644
index 0000000000..6bfd712f23
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.text.TimeZoneFormat.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ee4276e3758d856a8c17d99a7b8d54e7aa75687ba0b20203aaa77be6d33df3ec
+size 774
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.AnnualTimeZoneRule.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.AnnualTimeZoneRule.dat
new file mode 100644
index 0000000000..74ffe4ba0c
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.AnnualTimeZoneRule.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0b2e5cb7636e2141e6d937d0fdf2d3b824a4319ece4c2b1bfd294299519d6987
+size 898
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.BuddhistCalendar.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.BuddhistCalendar.dat
new file mode 100644
index 0000000000..eef24e9a8c
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.BuddhistCalendar.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:10c21e3231036ccc5f75ce5020209c8e5c6dd3eac8629ffd46a239577c56b457
+size 2672
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.Calendar.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.Calendar.dat
new file mode 100644
index 0000000000..1a5ce2ed91
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.Calendar.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c81ad0fb06808843b155c6728f16e8eb41e4980b8e23023bfba16dc76d376604
+size 4090
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ChineseCalendar.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ChineseCalendar.dat
new file mode 100644
index 0000000000..396915be5f
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ChineseCalendar.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:34227de2543ddb4465321ebfdec9d0534f42320dca2ffa379d05c15cddf68c74
+size 3152
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.CopticCalendar.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.CopticCalendar.dat
new file mode 100644
index 0000000000..c267237565
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.CopticCalendar.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:23aecc677159bdd4eaae83c2a46ced6c7612a2b47f1b8c7b5e96bd5127f79e39
+size 3328
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.Currency.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.Currency.dat
new file mode 100644
index 0000000000..2d55cbab33
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.Currency.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e69c5ec7b30b43892842f01c23b163ae2f5b28251d541c7930a6b25cd097d898
+size 345
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.DangiCalendar.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.DangiCalendar.dat
new file mode 100644
index 0000000000..a5e3afef56
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.DangiCalendar.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:00464957f1e2baafdf2fb1dce9ea0badc34931691d10f9de1e667ee0c41f1d31
+size 3538
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.DateInterval.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.DateInterval.dat
new file mode 100644
index 0000000000..dde6bea175
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.DateInterval.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:23ea1aac56dc3581502d59b006be4e963c0dcf7d7fa9d205480523c5c2c9b34a
+size 139
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.DateTimeRule.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.DateTimeRule.dat
new file mode 100644
index 0000000000..7f31f1073b
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.DateTimeRule.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:95e547b62781546a7fa18adbb52bb14a39f766f24c3f136789504cd32d72570b
+size 324
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.EthiopicCalendar.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.EthiopicCalendar.dat
new file mode 100644
index 0000000000..b7d324bc9a
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.EthiopicCalendar.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d56d0e24f773828f946a36c185fce7b32ea3aaa8aa615e801bc5d9568aab4a6d
+size 2621
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.GregorianCalendar.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.GregorianCalendar.dat
new file mode 100644
index 0000000000..82100a6630
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.GregorianCalendar.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6bd5cb471c0acd397450a83df5c78d4b8036caf17f7b62f8b624fc67983c5df5
+size 4099
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.HebrewCalendar.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.HebrewCalendar.dat
new file mode 100644
index 0000000000..38d81bac85
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.HebrewCalendar.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e23d53e994cdc71874877aa5503d882f82499a00db006640d379a43abc7b27df
+size 3647
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ICUCloneNotSupportedException.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ICUCloneNotSupportedException.dat
new file mode 100644
index 0000000000..e58f4ca359
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ICUCloneNotSupportedException.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:60ea769bec61fb4027207f3fd7032ddae50ad0bbde57994819e6f68d90f9a6b6
+size 1393
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ICUException.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ICUException.dat
new file mode 100644
index 0000000000..3809c7802c
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ICUException.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d521366ed6b5f5ee0165cf84a218d6f530ceb1d7bbec46a5a8f9f01aafc9d7aa
+size 1298
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ICUUncheckedIOException.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ICUUncheckedIOException.dat
new file mode 100644
index 0000000000..a7b81b1146
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ICUUncheckedIOException.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c292e0ef621dee820a3c788b48f1b888e368b7dd0e4e7f5af516035f9c192193
+size 1331
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.IllformedLocaleException.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.IllformedLocaleException.dat
new file mode 100644
index 0000000000..719bfe7668
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.IllformedLocaleException.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d7de8827353dc30a9d1470d9f8919d67cc31f4e0856cf071b936c5e794a9a1c4
+size 923
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.IndianCalendar.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.IndianCalendar.dat
new file mode 100644
index 0000000000..af831ac155
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.IndianCalendar.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fc560e256e8b79c84a6c069c0703ac760b00da74ed4a7a22331d876f86027957
+size 2493
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.InitialTimeZoneRule.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.InitialTimeZoneRule.dat
new file mode 100644
index 0000000000..faea30f9be
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.InitialTimeZoneRule.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5e87a78c208e64f9a1a791d6a207f1372700b8cb66e8c06296d3ca918bb8d115
+size 241
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.IslamicCalendar.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.IslamicCalendar.dat
new file mode 100644
index 0000000000..d9d0d8bb65
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.IslamicCalendar.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ae24712c0aeb231fcfb54c4c4f0e39eb05286d590c15803484ea766e6a57c2b0
+size 3876
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.JapaneseCalendar.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.JapaneseCalendar.dat
new file mode 100644
index 0000000000..799bb97cb5
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.JapaneseCalendar.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cb31552ed16ceed9847bbcb99f559038a7f39717262210cca391504ac7bf4043
+size 2750
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.MeasureUnit.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.MeasureUnit.dat
new file mode 100644
index 0000000000..0d41383944
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.MeasureUnit.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:20e3c8b651ca2b9706c4f15d3c2a06821bebbe9e797a87acad6e236089e520af
+size 173
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.PersianCalendar.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.PersianCalendar.dat
new file mode 100644
index 0000000000..600a57f8bc
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.PersianCalendar.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:44079dbb9fc299f7b58a4fae18076ef255341c87c5e6b208839433f849e796da
+size 3664
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.RuleBasedTimeZone.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.RuleBasedTimeZone.dat
new file mode 100644
index 0000000000..9537c28763
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.RuleBasedTimeZone.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f811ee6e4cd76878e700c3eafb0627b3b0cb0524668dc844b0c9b055e649e682
+size 1401
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.SimpleTimeZone.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.SimpleTimeZone.dat
new file mode 100644
index 0000000000..faa1a48e45
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.SimpleTimeZone.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:09693cbb7c8d078a5d9696dda0a410916c41f2503320ba76e7d3449b996d8e26
+size 1152
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.TaiwanCalendar.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.TaiwanCalendar.dat
new file mode 100644
index 0000000000..c04eee979a
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.TaiwanCalendar.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9ae9f999dccc91e30783dc41207b216529e2cc1c0a916d3aa04ff153535cac8c
+size 2821
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.TimeArrayTimeZoneRule.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.TimeArrayTimeZoneRule.dat
new file mode 100644
index 0000000000..20c84389f4
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.TimeArrayTimeZoneRule.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:250f185d9bedd33f314c4e04498c43f9c5d921a086fae76b720e53b23db6b822
+size 312
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.TimeUnit.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.TimeUnit.dat
new file mode 100644
index 0000000000..0d41383944
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.TimeUnit.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:20e3c8b651ca2b9706c4f15d3c2a06821bebbe9e797a87acad6e236089e520af
+size 173
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.TimeZone.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.TimeZone.dat
new file mode 100644
index 0000000000..474bab4c9b
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.TimeZone.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a6f6ba35d524dd1f2ad021a4283812432f27a6654abc376364f90dbba036c0f3
+size 1588
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ULocale.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ULocale.dat
new file mode 100644
index 0000000000..7bbeb2a63f
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.ULocale.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2097a6ceea62f53f9176b507ba431c7a379d5fc5d33f8b5f123dfb9e3b37246d
+size 365
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.UResourceTypeMismatchException.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.UResourceTypeMismatchException.dat
new file mode 100644
index 0000000000..9c21a0a4a7
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.UResourceTypeMismatchException.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dbbe1553bda6ba60b97f950f2baa4974317a7dc8f4481886b51fa780839d58df
+size 2886
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.VTimeZone.dat b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.VTimeZone.dat
new file mode 100644
index 0000000000..ebf1e7dfc3
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_58.1/com.ibm.icu.util.VTimeZone.dat
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d5dfdb001674451c65fd2e84654ca8ecee73f6f015bf42721e9aaa6f480b9b4b
+size 2676