OpenJDK / jdk / jdk10
changeset 42440:ec843594bcc6
8169653: Restore ObjectInputStream::resolveClass call stack default search order
Reviewed-by: dfuchs, mchung
author | chegar |
---|---|
date | Wed, 07 Dec 2016 09:32:32 +0000 |
parents | ccef74161219 |
children | 03cf95ffd04e |
files | jdk/src/java.base/share/classes/java/io/ObjectInputStream.java |
diffstat | 1 files changed, 14 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java Wed Dec 07 09:48:31 2016 +0100 +++ b/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java Wed Dec 07 09:32:32 2016 +0000 @@ -657,13 +657,11 @@ * <pre> * Class.forName(desc.getName(), false, loader) * </pre> - * where <code>loader</code> is determined as follows: if there is a - * method on the current thread's stack whose declaring class is not a - * <a href="../lang/ClassLoader.html#builtinLoaders"> - * <em>platform class</em></a>, then <code>loader</code> is - * the class loader of such class; otherwise, <code>loader</code> - * is the {@linkplain ClassLoader#getPlatformClassLoader() - * platform class loader}. If this call results in a + * where <code>loader</code> is the first class loader on the current + * thread's stack (starting from the currently executing method) that is + * neither the {@linkplain ClassLoader#getPlatformClassLoader() platform + * class loader} nor its ancestor; otherwise, <code>loader</code> is the + * <em>platform class loader</em>. If this call results in a * <code>ClassNotFoundException</code> and the name of the passed * <code>ObjectStreamClass</code> instance is the Java language keyword * for a primitive type or void, then the <code>Class</code> object @@ -721,13 +719,11 @@ * <pre> * Class.forName(i, false, loader) * </pre> - * where <code>loader</code> is determined as follows: if there is a - * method on the current thread's stack whose declaring class is not a - * <a href="../lang/ClassLoader.html#builtinLoaders"> - * <em>platform class</em></a>, then <code>loader</code> is - * the class loader of such class; otherwise, <code>loader</code> - * is the {@linkplain ClassLoader#getPlatformClassLoader() - * platform class loader}. + * where <code>loader</code> is the first class loader on the current + * thread's stack (starting from the currently executing method) that is + * neither the {@linkplain ClassLoader#getPlatformClassLoader() platform + * class loader} nor its ancestor; otherwise, <code>loader</code> is the + * <em>platform class loader</em>. * Unless any of the resolved interfaces are non-public, this same value * of <code>loader</code> is also the class loader passed to * <code>Proxy.getProxyClass</code>; if non-public interfaces are present, @@ -2370,16 +2366,10 @@ int ndoubles); /** - * Returns the first non-null and non-platform class loader - * (not counting class loaders of generated reflection implementation classes) - * up the execution stack, or null if only code from the bootstrap and - * platform class loader is on the stack. - * This method is also called via reflection by the following RMI-IIOP class: - * - * com.sun.corba.se.internal.util.JDKClassLoader - * - * This method should not be removed or its signature changed without - * corresponding modifications to the above class. + * Returns the first non-null and non-platform class loader (not counting + * class loaders of generated reflection implementation classes) up the + * execution stack, or the platform class loader if only code from the + * bootstrap and platform class loader is on the stack. */ private static ClassLoader latestUserDefinedLoader() { return jdk.internal.misc.VM.latestUserDefinedLoader();