RFR: 8191637: Interface with defaults invalid compiler warning for Serializable

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

RFR: 8191637: Interface with defaults invalid compiler warning for Serializable

Jonathan Gibbons
Please review this fix for JDK-8191637, which modifies an earlier fix
for JDK-6356530.

Prior to the fix for JDK-6356530, all abstract classes (including
interfaces) were excluded from the check for serialVersionUID.  The fix
for JDK-6356530 modified the check, but focussed on concrete methods
(including default methods for interfaces) instead of serializable fields.

This fix updates the check so that interfaces are never checked, and
abstract classes are only checked if they have serializable (non-static,
non-transient) fields.

JBS 1: https://bugs.openjdk.java.net/browse/JDK-8191637
JBS 2: https://bugs.openjdk.java.net/browse/JDK-6356530
Webrev: http://cr.openjdk.java.net/~jjg/8191637/webrev.00/

-- Jon
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8191637: Interface with defaults invalid compiler warning for Serializable

Vicente Romero-2
looks good,
Vicente

On 01/04/2018 07:54 PM, Jonathan Gibbons wrote:

> Please review this fix for JDK-8191637, which modifies an earlier fix
> for JDK-6356530.
>
> Prior to the fix for JDK-6356530, all abstract classes (including
> interfaces) were excluded from the check for serialVersionUID. The fix
> for JDK-6356530 modified the check, but focussed on concrete methods
> (including default methods for interfaces) instead of serializable
> fields.
>
> This fix updates the check so that interfaces are never checked, and
> abstract classes are only checked if they have serializable
> (non-static, non-transient) fields.
>
> JBS 1: https://bugs.openjdk.java.net/browse/JDK-8191637
> JBS 2: https://bugs.openjdk.java.net/browse/JDK-6356530
> Webrev: http://cr.openjdk.java.net/~jjg/8191637/webrev.00/
>
> -- Jon

Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8191637: Interface with defaults invalid compiler warning for Serializable

Jonathan Gibbons
In reply to this post by Jonathan Gibbons
Updated webrev, based on feedback from serialization folk.

Interfaces need never have a serialVersionIUID.
All serializable classes (i.e. either concrete or abstract) are
candidates to be checked for the presence of a serialVersionUID

Webrev: http://cr.openjdk.java.net/~jjg/8191637/webrev.01/

-- Jon

On 01/04/2018 04:54 PM, Jonathan Gibbons wrote:

> Please review this fix for JDK-8191637, which modifies an earlier fix
> for JDK-6356530.
>
> Prior to the fix for JDK-6356530, all abstract classes (including
> interfaces) were excluded from the check for serialVersionUID. The fix
> for JDK-6356530 modified the check, but focussed on concrete methods
> (including default methods for interfaces) instead of serializable
> fields.
>
> This fix updates the check so that interfaces are never checked, and
> abstract classes are only checked if they have serializable
> (non-static, non-transient) fields.
>
> JBS 1: https://bugs.openjdk.java.net/browse/JDK-8191637
> JBS 2: https://bugs.openjdk.java.net/browse/JDK-6356530
> Webrev: http://cr.openjdk.java.net/~jjg/8191637/webrev.00/
>
> -- Jon

Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8191637: Interface with defaults invalid compiler warning for Serializable

Vicente Romero-2
this one looks even better ;)

Vicente

On 01/05/2018 02:33 PM, Jonathan Gibbons wrote:

> Updated webrev, based on feedback from serialization folk.
>
> Interfaces need never have a serialVersionIUID.
> All serializable classes (i.e. either concrete or abstract) are
> candidates to be checked for the presence of a serialVersionUID
>
> Webrev: http://cr.openjdk.java.net/~jjg/8191637/webrev.01/
>
> -- Jon
>
> On 01/04/2018 04:54 PM, Jonathan Gibbons wrote:
>> Please review this fix for JDK-8191637, which modifies an earlier fix
>> for JDK-6356530.
>>
>> Prior to the fix for JDK-6356530, all abstract classes (including
>> interfaces) were excluded from the check for serialVersionUID. The
>> fix for JDK-6356530 modified the check, but focussed on concrete
>> methods (including default methods for interfaces) instead of
>> serializable fields.
>>
>> This fix updates the check so that interfaces are never checked, and
>> abstract classes are only checked if they have serializable
>> (non-static, non-transient) fields.
>>
>> JBS 1: https://bugs.openjdk.java.net/browse/JDK-8191637
>> JBS 2: https://bugs.openjdk.java.net/browse/JDK-6356530
>> Webrev: http://cr.openjdk.java.net/~jjg/8191637/webrev.00/
>>
>> -- Jon
>