8283668: Update IllegalFormatException to use sealed classes

Reviewed-by: iris, jpai
This commit is contained in:
Joe Darcy 2022-03-25 23:29:56 +00:00
parent 5ca8b91898
commit f520b4f891
13 changed files with 38 additions and 26 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2022, 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
@ -33,7 +33,19 @@ package java.util;
*
* @since 1.5
*/
public class IllegalFormatException extends IllegalArgumentException {
public sealed class IllegalFormatException extends IllegalArgumentException
permits DuplicateFormatFlagsException,
FormatFlagsConversionMismatchException,
IllegalFormatArgumentIndexException,
IllegalFormatCodePointException,
IllegalFormatConversionException,
IllegalFormatFlagsException,
IllegalFormatPrecisionException,
IllegalFormatWidthException,
MissingFormatArgumentException,
MissingFormatWidthException,
UnknownFormatConversionException,
UnknownFormatFlagsException {
@java.io.Serial
private static final long serialVersionUID = 18830826L;