changeset 58888:8aefdf781cda lworld

8238895: [lworld] Serial Version UID to ignore IdentityClass interface
author rriggs
date Tue, 11 Feb 2020 13:14:39 -0500
parents fdad06b6aba4
children 3a51926f7196
files src/java.base/share/classes/java/io/ObjectStreamClass.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/io/ObjectStreamClass.java	Tue Feb 11 15:32:18 2020 +0530
+++ b/src/java.base/share/classes/java/io/ObjectStreamClass.java	Tue Feb 11 13:14:39 2020 -0500
@@ -1804,8 +1804,10 @@
                     ifaceNames[i] = interfaces[i].getName();
                 }
                 Arrays.sort(ifaceNames);
+                // Skip IdentityObject to keep the computed SVUID the same.
                 for (int i = 0; i < ifaceNames.length; i++) {
-                    dout.writeUTF(ifaceNames[i]);
+                    if (!"java.lang.IdentityObject".equals(ifaceNames[i]))
+                        dout.writeUTF(ifaceNames[i]);
                 }
             }