8235699: ArrayIndexOutOfBoundsException in CalendarBuilder.toString

Reviewed-by: phh, alanb, weijun, simonis, rriggs
This commit is contained in:
Clive Verghese 2020-02-05 16:39:45 +01:00 committed by Volker Simonis
parent ccb4ab5499
commit e7e182a318
3 changed files with 79 additions and 3 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -148,9 +148,9 @@ class CalendarBuilder {
public String toString() {
StringJoiner sj = new StringJoiner(",", "CalendarBuilder:[", "]");
for (int i = 0; i < field.length; i++) {
for (int i = 0; i < MAX_FIELD; i++) {
if (isSet(i)) {
sj.add(i + "=" + field[MAX_FIELD + i]);
sj.add(i + "=" + field[i] + ":" + field[MAX_FIELD + i]);
}
}
return sj.toString();