JDK-7082727 : VirtualMachineError should declare its serialVersionUID
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-08-24
  • Updated: 2012-05-17
  • Resolved: 2012-05-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b04Fixed
Related Reports
Relates :  
Description
7080020 adds new constructors to InternalError and VirtualMachineError but as VirtualMachineError doesn't specify its serialVersionUID then it is changed by the addition of these constructors:

JDK7 and older:
java.lang.VirtualMachineError:    static final long serialVersionUID = 4161983926571568670L;

jdk8/tl:
java.lang.VirtualMachineError:    static final long serialVersionUID = -8070910810128390498L;

As most of the errors that extend VirtualMachineError always do not declare a serialVersionUID then their value changes too.

Comments
PUBLIC COMMENTS See http://hg.openjdk.java.net/jdk8/tl/jdk/rev/624cc18a6cf9
26-08-2011

SUGGESTED FIX # HG changeset patch # User darcy # Date 1314290570 25200 # Node ID 624cc18a6cf982a04aebf2cb65c0e13141367cc3 # Parent c9e78769c0daa9f6c3e931683edab7598d43461b 7082727: VirtualMachineError should declare its serialVersionUID Reviewed-by: alanb --- a/src/share/classes/java/lang/VirtualMachineError.java Thu Aug 25 16:08:31 2011 +0100 +++ b/src/share/classes/java/lang/VirtualMachineError.java Thu Aug 25 09:42:50 2011 -0700 @@ -34,6 +34,8 @@ package java.lang; * @since JDK1.0 */ abstract public class VirtualMachineError extends Error { + private static final long serialVersionUID = 4161983926571568670L; + /** * Constructs a <code>VirtualMachineError</code> with no detail message. */
26-08-2011

EVALUATION An oversight that highlights to need to build the entire JDK with -Xlint:serial.
24-08-2011