8210721: Replace legacy serial exception field with Throwable::cause

Reviewed-by: dfuchs, lancea
This commit is contained in:
Mandy Chung 2018-09-17 15:22:46 -07:00
parent b27f471bdd
commit b72ab42e49
9 changed files with 486 additions and 108 deletions

View file

@ -466,6 +466,16 @@ public class Throwable implements Serializable {
return this;
}
/*
* This is called by readObject of a few exceptions such as
* ClassNotFoundException and ExceptionInInitializerError to deserialize
* a stream output from an older runtime version where the cause may
* have set to null.
*/
final void setCause(Throwable t) {
this.cause = t;
}
/**
* Returns a short description of this throwable.
* The result is the concatenation of: