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

David M. Lloyd duke at openjdk.org
Wed Nov 13 16:00:34 UTC 2024


On Wed, 13 Nov 2024 15:49:55 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> David M. Lloyd has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 37 commits:
>> 
>>  - Merge remote-tracking branch 'upstream-jdk/master' into serialization
>>  - Round out the documentation of the new methods to explain the supported and unsupported cases
>>  - Move `serialPersistentFields` for a degree of method order consistency
>>  - Address review feedback
>>  - Test fixes and finish renaming
>>  - Address review feedback
>>  - Address review comment
>>  - Eliminate cache
>>  - Rework using facilities found in ObjectStreamClass
>>    
>>    This variation has the disadvantage of requiring a couple temporary arrays to be allocated each time the method handles are used.
>>  - More tests
>>  - ... and 27 more: https://git.openjdk.org/jdk/compare/133f8f31...d57c4346
>
> 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);
    }

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

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


More information about the core-libs-dev mailing list