RFR: 8333796: Add missing serialization functionality to sun.reflect.ReflectionFactory [v9]

Roger Riggs rriggs at openjdk.org
Wed Nov 13 16:05:51 UTC 2024


On Wed, 13 Nov 2024 15:57:28 GMT, David M. Lloyd <duke at openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java line 44:
>> 
>>> 42: import java.lang.reflect.Modifier;
>>> 43: import java.lang.reflect.Proxy;
>>> 44: import java.security.PrivilegedAction;
>> 
>> Unneeded import.
>
> This is used down below on line 423:
> 
> 
>     private static boolean hasDefaultOrNoSerialization(Class<?> cl) {
>         return ! Serializable.class.isAssignableFrom(cl)
>             || cl.isInterface()
>             || cl.isArray()
>             || Proxy.isProxyClass(cl) // <=== right here
>             || Externalizable.class.isAssignableFrom(cl)
>             || cl.isEnum()
>             || cl.isRecord()
>             || cl.isHidden()
>             || nonSerializableLeafClasses.contains(cl);
>     }

Sorry, I meant to flag PrivilegedAction.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19702#discussion_r1840694107


More information about the core-libs-dev mailing list