RFR: 8028027: serialver should emit declaration with the 'private' modifier
Chris Hegarty
chris.hegarty at oracle.com
Fri Nov 8 11:20:35 UTC 2013
Looks good to me. It should have been this way from day one.
-Chris.
On 08/11/2013 03:02, 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