Skip to content
Permalink
Browse files
8283668: Update IllegalFormatException to use sealed classes
Reviewed-by: iris, jpai
  • Loading branch information
jddarcy committed Mar 25, 2022
1 parent 5ca8b91 commit f520b4f891b71c630bc13f5db4f305194ef227e5
Showing 13 changed files with 38 additions and 26 deletions.
@@ -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
@@ -35,7 +35,7 @@
*
* @since 1.5
*/
public class DuplicateFormatFlagsException extends IllegalFormatException {
public non-sealed class DuplicateFormatFlagsException extends IllegalFormatException {

@java.io.Serial
private static final long serialVersionUID = 18890531L;
@@ -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
@@ -34,7 +34,7 @@
*
* @since 1.5
*/
public class FormatFlagsConversionMismatchException
public non-sealed class FormatFlagsConversionMismatchException
extends IllegalFormatException
{
@java.io.Serial
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 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,7 @@
*
* @since 16
*/
class IllegalFormatArgumentIndexException extends IllegalFormatException {
final class IllegalFormatArgumentIndexException extends IllegalFormatException {

@java.io.Serial
private static final long serialVersionUID = 4191767811181838112L;
@@ -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
@@ -36,7 +36,7 @@
*
* @since 1.5
*/
public class IllegalFormatCodePointException extends IllegalFormatException {
public non-sealed class IllegalFormatCodePointException extends IllegalFormatException {

@java.io.Serial
private static final long serialVersionUID = 19080630L;
@@ -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
@@ -35,7 +35,7 @@
*
* @since 1.5
*/
public class IllegalFormatConversionException extends IllegalFormatException {
public non-sealed class IllegalFormatConversionException extends IllegalFormatException {

@java.io.Serial
private static final long serialVersionUID = 17000126L;
@@ -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 @@
*
* @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;
@@ -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
@@ -34,7 +34,7 @@
*
* @since 1.5
*/
public class IllegalFormatFlagsException extends IllegalFormatException {
public non-sealed class IllegalFormatFlagsException extends IllegalFormatException {

@java.io.Serial
private static final long serialVersionUID = 790824L;
@@ -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
@@ -34,7 +34,7 @@
*
* @since 1.5
*/
public class IllegalFormatPrecisionException extends IllegalFormatException {
public non-sealed class IllegalFormatPrecisionException extends IllegalFormatException {

@java.io.Serial
private static final long serialVersionUID = 18711008L;
@@ -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,7 @@
*
* @since 1.5
*/
public class IllegalFormatWidthException extends IllegalFormatException {
public non-sealed class IllegalFormatWidthException extends IllegalFormatException {

@java.io.Serial
private static final long serialVersionUID = 16660902L;
@@ -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
@@ -36,7 +36,7 @@
*
* @since 1.5
*/
public class MissingFormatArgumentException extends IllegalFormatException {
public non-sealed class MissingFormatArgumentException extends IllegalFormatException {

@java.io.Serial
private static final long serialVersionUID = 19190115L;
@@ -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
@@ -34,7 +34,7 @@
*
* @since 1.5
*/
public class MissingFormatWidthException extends IllegalFormatException {
public non-sealed class MissingFormatWidthException extends IllegalFormatException {

@java.io.Serial
private static final long serialVersionUID = 15560123L;
@@ -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
@@ -34,7 +34,7 @@
*
* @since 1.5
*/
public class UnknownFormatConversionException extends IllegalFormatException {
public non-sealed class UnknownFormatConversionException extends IllegalFormatException {

@java.io.Serial
private static final long serialVersionUID = 19060418L;
@@ -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
@@ -34,7 +34,7 @@
*
* @since 1.5
*/
public class UnknownFormatFlagsException extends IllegalFormatException {
public non-sealed class UnknownFormatFlagsException extends IllegalFormatException {

@java.io.Serial
private static final long serialVersionUID = 19370506L;

1 comment on commit f520b4f

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on f520b4f Mar 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.