mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8235699: ArrayIndexOutOfBoundsException in CalendarBuilder.toString
Reviewed-by: phh, alanb, weijun, simonis, rriggs
This commit is contained in:
parent
ccb4ab5499
commit
e7e182a318
3 changed files with 79 additions and 3 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue