Hello,

Please review this simple patch to add serialVersionUID fields to several serializable types in javax.imageio.

    JDK-8033616 : Fix serial lint warnings in javax.imageio.*
    http://cr.openjdk.java.net/~darcy/8033616.0/

I've verified the serialVersionUID values have been stable across JDK 6 and JDK 8.

Full patch below.

Thanks,

-Joe

--- old/src/share/classes/javax/imageio/IIOException.java 2014-02-04 16:24:18.000000000 -0800 +++ new/src/share/classes/javax/imageio/IIOException.java 2014-02-04 16:24:18.000000000 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,7 @@
  *
  */
 public class IIOException extends IOException {
+    private static final long serialVersionUID = -3216210718638985251L;

     /**
      * Constructs an <code>IIOException</code> with a given message
--- old/src/share/classes/javax/imageio/metadata/IIOInvalidTreeException.java 2014-02-04 16:24:19.000000000 -0800 +++ new/src/share/classes/javax/imageio/metadata/IIOInvalidTreeException.java 2014-02-04 16:24:19.000000000 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,6 +44,7 @@
  *
  */
 public class IIOInvalidTreeException extends IIOException {
+    private static final long serialVersionUID = -1314083172544132777L;

     /**
      * The <code>Node</code> that led to the parsing error, or
--- old/src/share/classes/javax/imageio/metadata/IIOMetadataNode.java 2014-02-04 16:24:19.000000000 -0800 +++ new/src/share/classes/javax/imageio/metadata/IIOMetadataNode.java 2014-02-04 16:24:19.000000000 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,6 +41,7 @@


 class IIODOMException extends DOMException {
+    private static final long serialVersionUID = -4369510142067447468L;

     public IIODOMException(short code, String message) {
         super(code, message);
--- old/src/share/classes/javax/imageio/spi/DigraphNode.java 2014-02-04 16:24:20.000000000 -0800 +++ new/src/share/classes/javax/imageio/spi/DigraphNode.java 2014-02-04 16:24:20.000000000 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,7 @@
  *
  */
 class DigraphNode implements Cloneable, Serializable {
+    private static final long serialVersionUID = 5308261378582246841L;

     /** The data associated with this node. */
     protected Object data;

Reply via email to