RFR: 8188858: Caching latestUserDefinedLoader() results in ObjectInputStream.readObject()

Alan Bateman Alan.Bateman at oracle.com
Mon Oct 9 11:24:20 UTC 2017

On 06/10/2017 11:34, Kazunori Ogata wrote:
> Hi all,
> Please review a change for JDK-8188858.
> Bug report: https://bugs.openjdk.java.net/browse/JDK-8188858
> Webrev: http://cr.openjdk.java.net/~horii/8188858/webrev.00/
> This change caches the result of latestUserDefinedLoader() when objects
> are deserialized, so the decerializer can avoid redundant stack walking to
> resolve classes of deserializing objects.
Some of the bugs/abuses of OIS come about from calling it on different 
threads with different contexts. So I think this optimization can only 
work if to confine it to the thread calling readUnshared, meaning 
readResolve cannot skip latestUserDefinedLoader() when called on other 


More information about the core-libs-dev mailing list