src/java.xml/share/classes/javax/xml/namespace/QName.java
changeset 47359 e1a6c0168741
parent 47216 71c04702a3d5
child 47443 711ef438b6ad
equal deleted inserted replaced
47358:d07d5f7cab35 47359:e1a6c0168741
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    24  */
    24  */
    25 
    25 
    26 package javax.xml.namespace;
    26 package javax.xml.namespace;
    27 
    27 
    28 import java.io.Serializable;
    28 import java.io.Serializable;
    29 import java.security.AccessController;
       
    30 import java.security.PrivilegedAction;
       
    31 
       
    32 import javax.xml.XMLConstants;
    29 import javax.xml.XMLConstants;
       
    30 import jdk.xml.internal.SecuritySupport;
    33 
    31 
    34 /**
    32 /**
    35  * <p><code>QName</code> represents a <strong>qualified name</strong>
    33  * <p><code>QName</code> represents a <strong>qualified name</strong>
    36  * as defined in the XML specifications: <a
    34  * as defined in the XML specifications: <a
    37  * href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part2:
    35  * href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part2:
   104      */
   102      */
   105     private static boolean useDefaultSerialVersionUID = true;
   103     private static boolean useDefaultSerialVersionUID = true;
   106     static {
   104     static {
   107         try {
   105         try {
   108             // use a privileged block as reading a system property
   106             // use a privileged block as reading a system property
   109             String valueUseCompatibleSerialVersionUID = (String) AccessController.doPrivileged(
   107             String valueUseCompatibleSerialVersionUID = SecuritySupport.getSystemProperty(
   110                     new PrivilegedAction() {
   108                     "com.sun.xml.namespace.QName.useCompatibleSerialVersionUID");
   111                         public Object run() {
   109 
   112                             return System.getProperty("com.sun.xml.namespace.QName.useCompatibleSerialVersionUID");
   110             useDefaultSerialVersionUID = (valueUseCompatibleSerialVersionUID != null
   113                         }
   111                     && valueUseCompatibleSerialVersionUID.equals("1.0")) ? false : true;
   114                     }
       
   115             );
       
   116             useDefaultSerialVersionUID = (valueUseCompatibleSerialVersionUID != null && valueUseCompatibleSerialVersionUID.equals("1.0")) ? false : true;
       
   117         } catch (Exception exception) {
   112         } catch (Exception exception) {
   118             // use default if any Exceptions
   113             // use default if any Exceptions
   119             useDefaultSerialVersionUID = true;
   114             useDefaultSerialVersionUID = true;
   120         }
   115         }
   121 
   116