RFR: 8028027: serialver should emit declaration with the 'private' modifier

Mandy Chung mandy.chung at oracle.com
Fri Nov 8 03:14:26 UTC 2013


Looks good.
Mandy

On 11/7/2013 7:02 PM, Stuart Marks wrote:
> Hi all,
>
> Please review this quick one-liner to change the serialver tool so 
> that it emits a serialVersionUID declaration with the 'private' 
> modifier, which comports with the recommendation in the 
> java.io.Serializable page.
>
> Bug:
>
>     https://bugs.openjdk.java.net/browse/JDK-8028027
>
> Patch appended below.
>
> Thanks,
>
> s'marks
>
>
> ----------
>
>
> # HG changeset patch
> # User smarks
> # Date 1383868023 28800
> # Node ID 1e1088bfea50d7d3cc7cfdce2b0085b7adc6a180
> # Parent  f18b60bd22a1be988d329960c46d504f4b75000f
> 8028027: serialver should emit declaration with the 'private' modifier
> Reviewed-by: XXX
>
> diff -r f18b60bd22a1 -r 1e1088bfea50 
> src/share/classes/sun/tools/serialver/SerialVer.java
> --- a/src/share/classes/sun/tools/serialver/SerialVer.java    Thu Nov 
> 07 15:45:21 2013 -0800
> +++ b/src/share/classes/sun/tools/serialver/SerialVer.java    Thu Nov 
> 07 15:47:03 2013 -0800
> @@ -211,7 +211,7 @@
>          Class<?> cl = Class.forName(classname, false, loader);
>          ObjectStreamClass desc = ObjectStreamClass.lookup(cl);
>          if (desc != null) {
> -            return "    static final long serialVersionUID = " +
> +            return "    private static final long serialVersionUID = " +
>                  desc.getSerialVersionUID() + "L;";
>          } else {
>              return null;




More information about the core-libs-dev mailing list