8282696: Add constructors taking a cause to InvalidObjectException and InvalidClassException

Reviewed-by: lancea
This commit is contained in:
Joe Darcy 2022-03-07 14:47:52 +00:00
parent 6fc73f709b
commit 104e3cb24b
7 changed files with 198 additions and 36 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 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
@ -45,7 +45,21 @@ public class InvalidObjectException extends ObjectStreamException {
*
* @see ObjectInputValidation
*/
public InvalidObjectException(String reason) {
public InvalidObjectException(String reason) {
super(reason);
}
/**
* Constructs an {@code InvalidObjectException} with the given
* reason and cause.
*
* @param reason Detailed message explaining the reason for the failure.
* @param cause the cause
*
* @see ObjectInputValidation
* @since 19
*/
public InvalidObjectException(String reason, Throwable cause) {
super(reason, cause);
}
}