diff --git a/src/java.base/share/classes/java/io/ObjectStreamClass.java b/src/java.base/share/classes/java/io/ObjectStreamClass.java index 1a1fd7e397a..dfcb558e497 100644 --- a/src/java.base/share/classes/java/io/ObjectStreamClass.java +++ b/src/java.base/share/classes/java/io/ObjectStreamClass.java @@ -1161,6 +1161,10 @@ public class ObjectStreamClass implements Serializable { } catch (IllegalAccessException ex) { // should not occur, as access checks have been suppressed throw new InternalError(ex); + } catch (InstantiationError err) { + var ex = new InstantiationException(); + ex.initCause(err); + throw ex; } } else { throw new UnsupportedOperationException();