Details

    • Subcomponent:
    • Compatibility Risk:
      minimal
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Add missing serialVersionUID fields in java.awt.

      Problem

      Various serializable classes in java.awt neglect to define serialVerionUID fields; fields with the appropriate values should be added.

      Solution

      Add the serialVerionUID fields set to the values from old releases. The values listed below in the specification section have been checked as matching the values from both JDK 6 and JDK 8.

      Specification

      --- old/src/share/classes/java/awt/color/CMMException.java  2014-02-03 21:21:08.000000000 -0800
      +++ new/src/share/classes/java/awt/color/CMMException.java  2014-02-03 21:21:08.000000000 -0800
      @@ -47,6 +47,7 @@
        */
      
       public class CMMException extends java.lang.RuntimeException {
      +    private static final long serialVersionUID = 5775558044142994965L;
      
           /**
            *  Constructs a CMMException with the specified detail message.
      --- old/src/share/classes/java/awt/color/ProfileDataException.java  2014-02-03 21:21:09.000000000 -0800
      +++ new/src/share/classes/java/awt/color/ProfileDataException.java  
      @@ -31,6 +31,7 @@
        */
      
       public class ProfileDataException extends java.lang.RuntimeException {
      +    private static final long serialVersionUID = 7286140888240322498L;
      
           /**
            *  Constructs a ProfileDataException with the specified detail message.
      --- old/src/share/classes/java/awt/datatransfer/FlavorEvent.java    2014-02-03 21:21:10.000000000 -0800
      +++ new/src/share/classes/java/awt/datatransfer/FlavorEvent.java    2014-02-03 21:21:10.000000000 -0800
      @@ -38,6 +38,8 @@
        * @since 1.5
        */
       public class FlavorEvent extends EventObject {
      +    private static final long serialVersionUID = -5842664112252414548L;
      +
           /**
            * Constructs a <code>FlavorEvent</code> object.
            *
      --- old/src/share/classes/java/awt/geom/IllegalPathStateException.java  2014-02-03 21:21:11.000000000 -0800
      +++ new/src/share/classes/java/awt/geom/IllegalPathStateException.java  
      @@ -35,6 +35,8 @@
        */
      
       public class IllegalPathStateException extends RuntimeException {
      +    private static final long serialVersionUID = -5158084205220481094L;
      +
           /**
            * Constructs an <code>IllegalPathStateException</code> with no
            * detail message.
      --- old/src/share/classes/java/awt/geom/NoninvertibleTransformException.java    2014-02-03 21:21:11.000000000 -0800
      +++ new/src/share/classes/java/awt/geom/NoninvertibleTransformException.java    
        */
      
       public class NoninvertibleTransformException extends java.lang.Exception {
      +    private static final long serialVersionUID = 6137225240503990466L;
      +
           /**
            * Constructs an instance of
            * <code>NoninvertibleTransformException</code>
      --- old/src/share/classes/java/awt/image/ImagingOpException.java    2014-02-03 21:21:12.000000000 -0800
      +++ new/src/share/classes/java/awt/image/ImagingOpException.java    
      @@ -32,6 +32,7 @@
        * process the image.
        */
       public class ImagingOpException extends java.lang.RuntimeException {
      +    private static final long serialVersionUID = 8026288481846276658L;
      
           /**
            * Constructs an <code>ImagingOpException</code> object with the
      --- old/src/share/classes/java/awt/image/RasterFormatException.java 2014-02-03 21:21:13.000000000 -0800
      +++ new/src/share/classes/java/awt/image/RasterFormatException.java 2014-02-03 21:21:13.000000000 -0800
      
      @@ -31,6 +31,7 @@
        * invalid layout information in the {@link Raster}.
        */
       public class RasterFormatException extends java.lang.RuntimeException {
      +    private static final long serialVersionUID = 96598996116164315L;
      
           /**
            * Constructs a new <code>RasterFormatException</code> with the
      --- old/src/share/classes/java/awt/image/renderable/ParameterBlock.java 2014-02-03 21:21:13.000000000 -0800
      +++ new/src/share/classes/java/awt/image/renderable/ParameterBlock.java 2014-02-03 21:21:13.000000000 -0800
      @@ -93,6 +93,8 @@
        * </pre>
        * */
       public class ParameterBlock implements Cloneable, Serializable {
      +    private static final long serialVersionUID = -7577115551785240750L;
      +
           /** A Vector of sources, stored as arbitrary Objects. */
           protected Vector<Object> sources = new Vector<Object>();
      
      --- old/src/share/classes/java/awt/print/PrinterAbortException.java 2014-02-03 21:21:14.000000000 -0800
      +++ new/src/share/classes/java/awt/print/PrinterAbortException.java 2014-02-03 21:21:14.000000000 -0800
      @@ -33,6 +33,7 @@
        */
      
       public class PrinterAbortException extends PrinterException {
      +    private static final long serialVersionUID = 4725169026278854136L;
      
           /**
            * Constructs a new <code>PrinterAbortException</code> with no
      --- old/src/share/classes/java/awt/print/PrinterException.java  2014-02-03 21:21:15.000000000 -0800
      +++ new/src/share/classes/java/awt/print/PrinterException.java  2014-02-03 21:21:15.000000000 -0800g
      @@ -32,6 +32,7 @@
        */
      
       public class PrinterException extends Exception {
      +    private static final long serialVersionUID = -3757589981158265819L;
      
           /**
            * Constructs a new <code>PrinterException</code> object

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                darcy Joe Darcy
                Reporter:
                darcy Joe Darcy
                Reviewed By:
                Henry Jen
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: