8316629: j.text.DateFormatSymbols setZoneStrings() exception is unhelpful

Reviewed-by: naoto
This commit is contained in:
Justin Lu 2023-09-21 21:31:37 +00:00
parent 496264c1f9
commit ef49e6c0d7

View File

@ -612,7 +612,8 @@ public class DateFormatSymbols implements Serializable, Cloneable {
for (int i = 0; i < newZoneStrings.length; ++i) {
int len = newZoneStrings[i].length;
if (len < 5) {
throw new IllegalArgumentException();
throw new IllegalArgumentException(String.format(
"Row %s of the input array does not have a length of at least 5", i));
}
aCopy[i] = Arrays.copyOf(newZoneStrings[i], len);
}