JDK-8011368 : Regression: Calculation of default serialVersionUID changed in JDK8-b82
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io:serialization
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2013-04-03
  • Updated: 2013-04-10
  • Resolved: 2013-04-07
Related Reports
Duplicate :  
Description
$ cat SerialComparator.java 
class SerialComparator implements java.util.Comparator,java.io.Serializable {
    public int compare(Object o1,Object o2) {
        return 7;
    }

    public boolean equals(Object o) {
        return true;
    }
}

$ /set/java/re/jdk/7/promoted/fcs/b147/binaries/solaris-sparc/bin/javac -g:none SerialComparator.java 

$ /set/java/re/jdk/7/promoted/fcs/b147/binaries/solaris-sparc/bin/serialver SerialComparator      
SerialComparator:    static final long serialVersionUID = 2879724379937955927L;

$ /set/java/re/jdk/8/promoted/ea/b81/binaries/solaris-sparc/bin/serialver SerialComparator
SerialComparator:    static final long serialVersionUID = 2879724379937955927L;

$ /set/java/re/jdk/8/promoted/ea/b82/binaries/solaris-sparc/bin/serialver SerialComparator
SerialComparator:    static final long serialVersionUID = -2781454083125382737L;

Comments
This issue is resolved by JDK-8010017 (the default SUID is a hash that includes the signature of the declared methods).
07-04-2013

The following JCK8-b21 test failed under JDK8-b82 due to this issue: api/java_util/TreeSet/serial/index.html#InputTests
03-04-2013