mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8187551: MessageFormat.setFormat(int, Format) AIOOBE not thrown when documented
Reviewed-by: naoto, rriggs
This commit is contained in:
parent
448f3c1fcd
commit
fa64310889
2 changed files with 46 additions and 2 deletions
|
@ -701,6 +701,10 @@ public class MessageFormat extends Format {
|
|||
* larger than the number of format elements in the pattern string
|
||||
*/
|
||||
public void setFormat(int formatElementIndex, Format newFormat) {
|
||||
|
||||
if (formatElementIndex > maxOffset) {
|
||||
throw new ArrayIndexOutOfBoundsException(formatElementIndex);
|
||||
}
|
||||
formats[formatElementIndex] = newFormat;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue