< prev index next >

src/java.xml/share/classes/javax/xml/namespace/QName.java

Print this page

        

@@ -68,61 +68,12 @@
  *   Namespaces in XML Errata</a>
  * @since 1.5
  */
 
 public class QName implements Serializable {
-
-    /**
-     * <p>Stream Unique Identifier.</p>
-     *
-     * <p>Due to a historical defect, QName was released with multiple
-     * serialVersionUID values even though its serialization was the
-     * same.</p>
-     *
-     * <p>To workaround this issue, serialVersionUID is set with either
-     * a default value or a compatibility value.  To use the
-     * compatibility value, set the system property:</p>
-     *
-     * <code>com.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0</code>
-     *
-     * <p>This workaround was inspired by classes in the javax.management
-     * package, e.g. ObjectName, etc.
-     * See CR6267224 for original defect report.</p>
-     */
-    private static final long serialVersionUID;
-    /**
-     * <p>Default <code>serialVersionUID</code> value.</p>
-     */
-    private static final long defaultSerialVersionUID = -9120448754896609940L;
-    /**
-     * <p>Compatibility <code>serialVersionUID</code> value.</p>
-     */
-    private static final long compatibleSerialVersionUID = 4418622981026545151L;
-    /**
-     * <p>Flag to use default or campatible serialVersionUID.</p>
-     */
-    private static boolean useDefaultSerialVersionUID = true;
-    static {
-        try {
-            // use a privileged block as reading a system property
-            String valueUseCompatibleSerialVersionUID = SecuritySupport.getSystemProperty(
-                    "com.sun.xml.namespace.QName.useCompatibleSerialVersionUID");
-
-            useDefaultSerialVersionUID = (valueUseCompatibleSerialVersionUID != null
-                    && valueUseCompatibleSerialVersionUID.equals("1.0")) ? false : true;
-        } catch (Exception exception) {
-            // use default if any Exceptions
-            useDefaultSerialVersionUID = true;
-        }
-
-        // set serialVersionUID to desired value
-        if (useDefaultSerialVersionUID) {
-            serialVersionUID = defaultSerialVersionUID;
-        } else {
-            serialVersionUID = compatibleSerialVersionUID;
-        }
-    }
+    // tests show that the ID is the same from JDK 1.5 through JDK 9
+    private static final long serialVersionUID = -9120448754896609940L;
 
     /**
      * <p>Namespace URI of this <code>QName</code>.</p>
      */
     private final String namespaceURI;
< prev index next >