JDK 12 RFR of JDK-8209024: Use SuppressWarnings -- now RFR for 8209304: Deprecate serialVersionUID fields in interfaces

joe darcy joe.darcy at oracle.com
Thu Aug 9 18:36:21 UTC 2018


Hi Alan,

On 8/6/2018 11:12 PM, Alan Bateman wrote:
>
>
> On 06/08/2018 20:11, joe darcy wrote:
>> Hello,
>>
>> Various interfaces in the JDK extend Serializable and declare 
>> serialVersionUID fields. Such fields are ineffectual and 
>> @SuppressWarnings("serial") should be applied to such fields to 
>> suppress future planned serial lint checks (JDK-8202056).
>>
>> Most of the affected files are in the security-libs area with a 
>> handful in RMI and JNDI:
>>
>>     http://cr.openjdk.java.net/~darcy/8209024.0/
>>
>> Patch below. I'll fix-up the copyright years before any push.
> Is there a follow-on patch coming to deprecate these fields?
>
>

Filed 8209304: Deprecate serialVersionUID fields in interfaces; webrev 
for review:

     http://cr.openjdk.java.net/~darcy/8209304.0/

Security libs team, for

src/java.base/share/classes/sun/security/internal/interfaces/TlsMasterSecret.java

I added a separate @Deprecated annotation for the serialVersionUID field 
even though the interface itself is already deprecated. That interface's 
javadoc states:

   41  * @deprecated Sun JDK internal use only --- WILL BE REMOVED in a 
future
   42  * release.

If you like, as part of this changeset I can upgrade (downgrade?) the 
@Deprecated annotation for this class to forRemoval=true.

Once that detail is sorted out, I'll create the corresponding CSR. 
(Since the java.lang.Deprecated annotation type is @Documented, adding, 
removing, or changing @Deprecated annotations is an interface change.)

Thanks,

-Joe



More information about the core-libs-dev mailing list