changeset 757:311b931e5485

8174735: Update JAX-WS RI integration to latest version Reviewed-by: alanb, mchung, lancea Contributed-by: roman.grigoriadi@oracle.com
author aefimov
date Thu, 16 Feb 2017 13:14:39 +0300
parents b7e70e1e0154
children e53b32235738
files src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizable.java src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessage.java src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizer.java src/java.xml.bind/share/classes/com/sun/istack/internal/localization/NullLocalizable.java src/java.xml.bind/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package-info.java src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package.html src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package-info.java src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package.html src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package-info.java src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package.html src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package-info.java src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package.html src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package-info.java src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package.html src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package-info.java src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package.html src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package-info.java src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package.html src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package.html src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java src/java.xml.bind/share/classes/javax/xml/bind/Messages.java src/java.xml.bind/share/classes/javax/xml/bind/Messages.properties src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/package-info.java src/java.xml.bind/share/classes/javax/xml/bind/helpers/package-info.java src/java.xml.bind/share/classes/javax/xml/bind/package-info.java src/java.xml.bind/share/classes/javax/xml/bind/util/package-info.java src/java.xml.bind/share/classes/module-info.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LazyEnvelope.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementFactory.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/NodeListImpl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/SAAJUtil.java src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/message/saaj/SAAJMessageHeaders.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/pipe/ThreadHelper.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/MethodUtil.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.properties src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/BindingImpl.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.properties src/java.xml.ws/share/classes/com/sun/xml/internal/ws/developer/ContextClassloaderLocal.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/Injector.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/RuntimeModeler.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/util/MethodUtil.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/resources/ContextClassloaderLocal.properties src/java.xml.ws/share/classes/com/sun/xml/internal/ws/resources/ContextClassloaderLocalMessages.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.properties src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/MethodUtil.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.properties src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlCatalogUtil.java src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java src/java.xml.ws/share/classes/javax/xml/soap/FactoryFinder.java src/java.xml.ws/share/classes/module-info.java src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JJavaName.java src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JModuleDirective.java src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/DefaultAuthenticator.java src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/SecureLoader.java src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/package-info.java src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/package.html src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/CatalogUtil.java src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/SchemaCache.java src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/package-info.java src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/package.html src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/package-info.java src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/package.html src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package-info.java src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package.html src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/package-info.java src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/package.html src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/package-info.java src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/package.html src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package-info.java src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package.html src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/gbind/package-info.java src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/gbind/package.html src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package-info.java src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package.html src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/package-info.java src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/package.html src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package-info.java src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package.html src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/runtime/package-info.java src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/runtime/package.html src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/ElementDecl.java src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/IdentityConstraintImpl.java src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/NGCCRuntimeEx.java src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/util/Uri.java src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/ContextClassloaderLocal.properties src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/ContextClassloaderLocalMessages.java src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.java src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.properties
diffstat 199 files changed, 5117 insertions(+), 2102 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizable.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizable.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -54,9 +54,7 @@
     public Object[] getArguments();
     public String getResourceBundleName();
 
-    public default ResourceBundle getResourceBundle(Locale locale) {
-        return null;
-    }
+    public ResourceBundle getResourceBundle(Locale locale);
 
     /**
      * Special constant that represents a message that
--- a/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessage.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessage.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -31,6 +31,7 @@
 import java.util.Locale;
 import java.util.ResourceBundle;
 
+
 /**
  * @author WS Development Team
  */
@@ -42,13 +43,9 @@
     private final String _key;
     private final Object[] _args;
 
+    @Deprecated
     public LocalizableMessage(String bundlename, String key, Object... args) {
-        _bundlename = bundlename;
-        _rbSupplier = null;
-        _key = key;
-        if(args==null)
-            args = new Object[0];
-        _args = args;
+        this(bundlename, null, key, args);
     }
 
     public LocalizableMessage(String bundlename, ResourceBundleSupplier rbSupplier,
@@ -61,15 +58,17 @@
         _args = args;
     }
 
-
+    @Override
     public String getKey() {
         return _key;
     }
 
+    @Override
     public Object[] getArguments() {
         return Arrays.copyOf(_args, _args.length);
     }
 
+    @Override
     public String getResourceBundleName() {
         return _bundlename;
     }
--- a/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -36,6 +36,7 @@
     private final String _bundlename;
     private final ResourceBundleSupplier _rbSupplier;
 
+    @Deprecated
     public LocalizableMessageFactory(String bundlename) {
         _bundlename = bundlename;
         _rbSupplier = null;
@@ -58,4 +59,5 @@
          */
         ResourceBundle getResourceBundle(Locale locale);
     }
+
 }
--- a/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizer.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizer.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -25,7 +25,6 @@
 
 package com.sun.istack.internal.localization;
 
-import com.sun.istack.internal.localization.LocalizableMessageFactory.ResourceBundleSupplier;
 import java.text.MessageFormat;
 import java.util.HashMap;
 import java.util.Locale;
@@ -41,7 +40,7 @@
 public class Localizer {
 
     private final Locale _locale;
-    private final HashMap _resourceBundles;
+    private final HashMap<String, ResourceBundle> _resourceBundles;
 
     public Localizer() {
         this(Locale.getDefault());
@@ -49,7 +48,7 @@
 
     public Localizer(Locale l) {
         _locale = l;
-        _resourceBundles = new HashMap();
+        _resourceBundles = new HashMap<>();
     }
 
     public Locale getLocale() {
--- a/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/NullLocalizable.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/NullLocalizable.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -25,6 +25,9 @@
 
 package com.sun.istack.internal.localization;
 
+import java.util.Locale;
+import java.util.ResourceBundle;
+
 /**
  * {@link Localizable} that wraps a non-localizable string.
  *
@@ -39,13 +42,20 @@
         this.msg = msg;
     }
 
+    @Override
     public String getKey() {
         return Localizable.NOT_LOCALIZABLE;
     }
+    @Override
     public Object[] getArguments() {
         return new Object[]{msg};
     }
+    @Override
     public String getResourceBundleName() {
         return "";
     }
+    @Override
+    public ResourceBundle getResourceBundle(Locale locale) {
+        return null;
+    }
 }
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -533,4 +533,14 @@
      * @since 2.2.6
      */
     public static final String DISABLE_XML_SECURITY  = "com.sun.xml.internal.bind.disableXmlSecurity";
+
+    /**
+     * If true and element namespace is not specified, namespace of parent element will be used.
+     * The default value is false.
+     *
+     * Boolean
+     * @since 2.3.0
+     */
+    public static final String BACKUP_WITH_PARENT_NAMESPACE = "com.sun.xml.internal.bind.backupWithParentNamespace";
+
 }
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -112,6 +112,8 @@
                 "is not active.  Using JAXB's implementation");
         }
 
+        Boolean backupWithParentNamespace = getPropertyValue(properties, JAXBRIContext.BACKUP_WITH_PARENT_NAMESPACE, Boolean.class);
+
         RuntimeAnnotationReader ar = getPropertyValue(properties,JAXBRIContext.ANNOTATION_READER,RuntimeAnnotationReader.class);
 
         Collection<TypeReference> tr = getPropertyValue(properties, JAXBRIContext.TYPE_REFERENCES, Collection.class);
@@ -144,6 +146,7 @@
         builder.setSupressAccessorWarnings(supressAccessorWarnings);
         builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling);
         builder.setDisableSecurityProcessing(disablesecurityProcessing);
+        builder.setBackupWithParentNamespace(backupWithParentNamespace);
         return builder.build();
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package-info.java	Thu Feb 16 13:14:39 2017 +0300
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Code that deals with low level byte code manipulation.
+ */
+package com.sun.xml.internal.bind.v2.bytecode;
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package.html	Fri Feb 10 00:39:51 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, 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
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html>
-
-
-<body>
-  Code that deals with low level byte code manipulation.
-</body>
-</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package-info.java	Thu Feb 16 13:14:39 2017 +0300
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Abstraction around reading annotations, to support internal/external annotations.
+ */
+package com.sun.xml.internal.bind.v2.model.annotation;
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package.html	Fri Feb 10 00:39:51 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, 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
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html><body>
-
-
-  Abstraction around reading annotations, to support internal/external annotations.
-</body></html>
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -29,24 +29,25 @@
 
 /**
  * listen to static errors found during building a JAXB model from a set of classes.
- * Implemented by the client of {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder}.
+ * Implemented by the client of {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI}.
  *
  * <p>
  * All the static errors have to be reported while constructing a
- * model, not when a model is used (IOW, until the {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder#link} completes.
- * Internally, {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder} wraps an {@link ErrorHandler} and all the model
+ * model, not when a model is used (IOW, until the {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI} completes.
+ * Internally, {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI} wraps an {@link ErrorHandler} and all the model
  * components should report errors through it.
  *
  * <p>
  * {@link IllegalAnnotationException} is a checked exception to remind
  * the model classes to report it rather than to throw it.
  *
- * @see com.sun.xml.internal.bind.v2.model.impl.ModelBuilder
+ * @see com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI
  * @author Kohsuke Kawaguchi
  */
 public interface ErrorHandler {
     /**
      * Receives a notification for an error in the annotated code.
+     * @param e
      */
     void error( IllegalAnnotationException e );
 }
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -57,7 +57,7 @@
     public final boolean isOrdered;
 
     /**
-     * {@link com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory} benefits from having index numbers assigned to
+     * {@code com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory} benefits from having index numbers assigned to
      * {@link #ELEMENT}, {@link #REFERENCE}, and {@link #MAP} in this order.
      */
     public final int propertyIndex;
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -34,18 +34,22 @@
  *
  * <p>
  * This interface is only meant to be used as a return type from
- * {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder}.
+ * {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI}.
  *
  * @author Kohsuke Kawaguchi
+ * @param <T>
+ * @param <C>
  */
 public interface RegistryInfo<T,C> {
     /**
      * Returns all the references to other types in this registry.
+     * @return
      */
     Set<TypeInfo<T,C>> getReferences();
 
     /**
      * Returns the class with {@link XmlRegistry}.
+     * @return
      */
     C getClazz();
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package-info.java	Thu Feb 16 13:14:39 2017 +0300
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Implementation of the com.sun.xml.internal.bind.j2s.model package.
+ */
+package com.sun.xml.internal.bind.v2.model.impl;
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package.html	Fri Feb 10 00:39:51 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, 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
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html>
-
-
-<body>
-Implementation of the com.sun.xml.internal.bind.j2s.model package.
-</body>
-</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package-info.java	Thu Feb 16 13:14:39 2017 +0300
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Abstraction around the reflection library, to support various reflection models (such as java.lang.reflect and Annotation Processing).
+ */
+package com.sun.xml.internal.bind.v2.model.nav;
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package.html	Fri Feb 10 00:39:51 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, 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
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html><body>
-
-
-  Abstraction around the reflection library, to support various reflection models (such as java.lang.reflect and Annotation Processing).
-</body></html>
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -242,6 +242,16 @@
     private Set<XmlNs> xmlNsSet = null;
 
     /**
+     * If true, despite the specification, unmarshall child element with parent namespace, if child namespace is not specified.
+     * The default value is null for System {code}com.sun.xml.internal.bind.backupWithParentNamespace{code} property to be used,
+     * and false is assumed if it's not set either.
+     *
+     * Boolean
+     * @since 2.3.0
+     */
+    public Boolean backupWithParentNamespace = null;
+
+    /**
      * Returns declared XmlNs annotations (from package-level annotation XmlSchema
      *
      * @return set of all present XmlNs annotations
@@ -263,6 +273,7 @@
         this.supressAccessorWarnings = builder.supressAccessorWarnings;
         this.improvedXsiTypeHandling = builder.improvedXsiTypeHandling;
         this.disableSecurityProcessing = builder.disableSecurityProcessing;
+        this.backupWithParentNamespace = builder.backupWithParentNamespace;
 
         Collection<TypeReference> typeRefs = builder.typeRefs;
 
@@ -1024,6 +1035,7 @@
         private boolean allNillable;
         private boolean improvedXsiTypeHandling = true;
         private boolean disableSecurityProcessing = true;
+        private Boolean backupWithParentNamespace = null; // null for System property to be used
 
         public JAXBContextBuilder() {};
 
@@ -1039,6 +1051,7 @@
             this.xmlAccessorFactorySupport = baseImpl.xmlAccessorFactorySupport;
             this.allNillable = baseImpl.allNillable;
             this.disableSecurityProcessing = baseImpl.disableSecurityProcessing;
+            this.backupWithParentNamespace = baseImpl.backupWithParentNamespace;
         }
 
         public JAXBContextBuilder setRetainPropertyInfo(boolean val) {
@@ -1101,6 +1114,11 @@
             return this;
         }
 
+        public JAXBContextBuilder setBackupWithParentNamespace(Boolean backupWithParentNamespace) {
+            this.backupWithParentNamespace = backupWithParentNamespace;
+            return this;
+        }
+
         public JAXBContextImpl build() throws JAXBException {
 
             // fool-proof
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package-info.java	Thu Feb 16 13:14:39 2017 +0300
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Code that implements JAXBContext, Unmarshaller, and Marshaller.
+ */
+package com.sun.xml.internal.bind.v2.runtime;
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package.html	Fri Feb 10 00:39:51 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, 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
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html>
-
-
-<body>
-Code that implements JAXBContext, Unmarshaller, and Marshaller.
-</body>
-</html>
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -39,7 +39,7 @@
 
     private static final Logger logger = Util.getClassLogger();
 
-    protected static final boolean noOptimize = Runtime.version().major() >= 9 ||
+    protected static final boolean noOptimize =
         Util.getSystemProperty(ClassTailor.class.getName()+".noOptimize")!=null;
 
     static {
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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,11 @@
 
 import com.sun.xml.internal.bind.Util;
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+import java.lang.reflect.Field;
+import java.security.CodeSource;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.security.ProtectionDomain;
 
 /**
  * A {@link ClassLoader} used to "inject" optimized accessor classes
@@ -131,7 +136,7 @@
     /**
      * Injected classes keyed by their names.
      */
-    private final Map<String, Class> classes = new HashMap<String, Class>();
+    private final Map<String, Class> classes = new HashMap<>();
     private final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock();
     private final Lock r = rwl.readLock();
     private final Lock w = rwl.writeLock();
@@ -141,26 +146,59 @@
      * False otherwise, which happens if this classloader can't see {@link Accessor}.
      */
     private final boolean loadable;
-    private static final Method defineClass;
-    private static final Method resolveClass;
-    private static final Method findLoadedClass;
+    private static Method defineClass;
+    private static Method resolveClass;
+    private static Method findLoadedClass;
+    private static Object U;
 
     static {
-        Method[] m = AccessController.doPrivileged(
-                new PrivilegedAction<Method[]>() {
+        try {
+            Method[] m = AccessController.doPrivileged(
+                    new PrivilegedAction<Method[]>() {
+                @Override
+                public Method[] run() {
+                    return new Method[]{
+                        getMethod(ClassLoader.class, "defineClass", String.class, byte[].class, Integer.TYPE, Integer.TYPE),
+                        getMethod(ClassLoader.class, "resolveClass", Class.class),
+                        getMethod(ClassLoader.class, "findLoadedClass", String.class)
+                    };
+                }
+            }
+            );
+            defineClass = m[0];
+            resolveClass = m[1];
+            findLoadedClass = m[2];
+        } catch (Throwable t) {
+            try {
+                U = AccessController.doPrivileged(new PrivilegedExceptionAction() {
                     @Override
-                    public Method[] run() {
-                        return new Method[]{
-                                getMethod(ClassLoader.class, "defineClass", String.class, byte[].class, Integer.TYPE, Integer.TYPE),
-                                getMethod(ClassLoader.class, "resolveClass", Class.class),
-                                getMethod(ClassLoader.class, "findLoadedClass", String.class)
-                        };
+                    public Object run() throws Exception {
+                        Class u = Class.forName("sun.misc.Unsafe");
+                        Field theUnsafe = u.getDeclaredField("theUnsafe");
+                        theUnsafe.setAccessible(true);
+                        return theUnsafe.get(null);
                     }
-                }
-        );
-        defineClass = m[0];
-        resolveClass = m[1];
-        findLoadedClass = m[2];
+                });
+                defineClass = AccessController.doPrivileged(new PrivilegedExceptionAction<Method>() {
+                    @Override
+                    public Method run() throws Exception {
+                        try {
+                            return U.getClass().getMethod("defineClass",
+                                    new Class[]{String.class,
+                                        byte[].class,
+                                        Integer.TYPE,
+                                        Integer.TYPE,
+                                        ClassLoader.class,
+                                        ProtectionDomain.class});
+                        } catch (NoSuchMethodException | SecurityException ex) {
+                            throw ex;
+                        }
+                    }
+                });
+            } catch (SecurityException | PrivilegedActionException ex) {
+                Logger.getLogger(Injector.class.getName()).log(Level.SEVERE, null, ex);
+            }
+        }
     }
 
     private static Method getMethod(final Class<?> c, final String methodname, final Class<?>... params) {
@@ -210,13 +248,11 @@
             rlocked = false;
 
             //find loaded class from classloader
-            if (c == null) {
+            if (c == null && findLoadedClass != null) {
 
                 try {
                     c = (Class) findLoadedClass.invoke(parent, className.replace('/', '.'));
-                } catch (IllegalArgumentException e) {
-                    logger.log(Level.FINE, "Unable to find " + className, e);
-                } catch (IllegalAccessException e) {
+                } catch (IllegalArgumentException | IllegalAccessException e) {
                     logger.log(Level.FINE, "Unable to find " + className, e);
                 } catch (InvocationTargetException e) {
                     Throwable t = e.getTargetException();
@@ -253,9 +289,13 @@
 
                     // we need to inject a class into the
                     try {
-                        c = (Class) defineClass.invoke(parent, className.replace('/', '.'), image, 0, image.length);
-                        resolveClass.invoke(parent, c);
-                    } catch (IllegalAccessException e) {
+                        if (resolveClass != null) {
+                            c = (Class) defineClass.invoke(parent, className.replace('/', '.'), image, 0, image.length);
+                            resolveClass.invoke(parent, c);
+                        } else {
+                            c = (Class) defineClass.invoke(U, className.replace('/', '.'), image, 0, image.length, parent, Injector.class.getProtectionDomain());
+                        }
+                    } catch (IllegalAccessException  e) {
                         logger.log(Level.FINE, "Unable to inject " + className, e);
                         return null;
                     } catch (InvocationTargetException e) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package-info.java	Thu Feb 16 13:14:39 2017 +0300
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Hosts optimized
+ * {@link com.sun.xml.internal.bind.v2.runtime.reflect.Accessor},
+ * {@link com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor}, and {@link com.sun.xml.internal.bind.v2.runtime.Transducer}.
+ *
+ * <h2>How it works</h2>
+ * <p>
+ * Most of the classes in this package are "templates." At run-time, A template class file is slightly modified to match
+ * the target Java Bean, then it will be loaded into the VM.
+ */
+package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package.html	Fri Feb 10 00:39:51 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, 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
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html><body>
-
-
-Hosts optimized
-{@link com.sun.xml.internal.bind.v2.runtime.reflect.Accessor},
-{@link com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor}, and
-{@link com.sun.xml.internal.bind.v2.runtime.Transducer}.
-
-<h2>How it works</h2>
-<p>
-  Most of the classes in this package are "templates." At run-time,
-  A template class file is slightly modified to match the target Java Bean,
-  then it will be loaded into the VM.
-</body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package-info.java	Thu Feb 16 13:14:39 2017 +0300
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Abstraction around accessing data of actual objects.
+ */
+package com.sun.xml.internal.bind.v2.runtime.reflect;
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package.html	Fri Feb 10 00:39:51 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, 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
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html><body>
-
-
-  Abstraction around accessing data of actual objects.
-</body></html>
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -33,7 +33,7 @@
 import org.w3c.dom.Node;
 
 /**
- * Object that returns the current location that the {@link com.sun.xml.internal.bind.v2.runtime.unmarshaller.XmlVisitor}
+ * Object that returns the current location that the {@code com.sun.xml.internal.bind.v2.runtime.unmarshaller.XmlVisitor}
  * is parsing.
  *
  * @author Kohsuke Kawaguchi
@@ -41,6 +41,7 @@
 public interface LocatorEx extends Locator {
     /**
      * Gets the current location in a {@link ValidationEventLocator} object.
+     * @return
      */
     ValidationEventLocator getLocation();
 
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -31,7 +31,9 @@
 
 import javax.xml.namespace.QName;
 
+import com.sun.xml.internal.bind.Util;
 import com.sun.xml.internal.bind.api.AccessorException;
+import com.sun.xml.internal.bind.api.JAXBRIContext;
 import com.sun.xml.internal.bind.v2.WellKnownNamespace;
 import com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl;
 import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
@@ -231,11 +233,26 @@
     @Override
     public void childElement(UnmarshallingContext.State state, TagName arg) throws SAXException {
         ChildLoader child = childUnmarshallers.get(arg.uri,arg.local);
-        if (child == null) {
-            child = catchAll;
-            if (child==null) {
-                super.childElement(state,arg);
-                return;
+        if(child == null) {
+            Boolean backupWithParentNamespace = ((JAXBContextImpl) state.getContext().getJAXBContext()).backupWithParentNamespace;
+                        backupWithParentNamespace = backupWithParentNamespace != null
+                                        ? backupWithParentNamespace
+                                        : Boolean.parseBoolean(Util.getSystemProperty(JAXBRIContext.BACKUP_WITH_PARENT_NAMESPACE));
+            if ((beanInfo != null) && (beanInfo.getTypeNames() != null) && backupWithParentNamespace) {
+                Iterator<?> typeNamesIt = beanInfo.getTypeNames().iterator();
+                QName parentQName = null;
+                if ((typeNamesIt != null) && (typeNamesIt.hasNext()) && (catchAll == null)) {
+                    parentQName = (QName) typeNamesIt.next();
+                    String parentUri = parentQName.getNamespaceURI();
+                    child = childUnmarshallers.get(parentUri, arg.local);
+                }
+            }
+            if (child == null) {
+                child = catchAll;
+                if(child==null) {
+                    super.childElement(state,arg);
+                    return;
+                }
             }
         }
 
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -23,5 +23,8 @@
  * questions.
  */
 
+/**
+ * XML Schema writer generated by TXW.
+ */
 @com.sun.xml.internal.txw2.annotation.XmlNamespace("http://www.w3.org/2001/XMLSchema")
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
--- a/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package.html	Fri Feb 10 00:39:51 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, 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
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html>
-
-
-<body>
-XML Schema writer generated by TXW.
-</body>
-</html>
--- a/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, 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
@@ -158,7 +158,7 @@
             Class spFactory = ServiceLoaderUtil.safeLoadClass(className, PLATFORM_DEFAULT_FACTORY_CLASS, classLoader);
             return newInstance(contextPath, spFactory, classLoader, properties);
         } catch (ClassNotFoundException x) {
-            throw new JAXBException(Messages.format(Messages.PROVIDER_NOT_FOUND, className), x);
+            throw new JAXBException(Messages.format(Messages.DEFAULT_PROVIDER_NOT_FOUND), x);
 
         } catch (RuntimeException | JAXBException x) {
             // avoid wrapping RuntimeException to JAXBException,
@@ -228,7 +228,7 @@
         }
     }
 
-    private static Object instantiateProviderIfNecessary(Class<?> implClass) throws JAXBException {
+    private static Object instantiateProviderIfNecessary(final Class<?> implClass) throws JAXBException {
         try {
             if (JAXBContextFactory.class.isAssignableFrom(implClass)) {
                 return AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
@@ -254,7 +254,7 @@
         try {
             spi = ServiceLoaderUtil.safeLoadClass(className, PLATFORM_DEFAULT_FACTORY_CLASS, getContextClassLoader());
         } catch (ClassNotFoundException e) {
-            throw new JAXBException(e);
+            throw new JAXBException(Messages.format(Messages.DEFAULT_PROVIDER_NOT_FOUND), e);
         }
 
         if (logger.isLoggable(Level.FINE)) {
@@ -525,6 +525,7 @@
         } else {
             return (ClassLoader) java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction() {
+                        @Override
                         public java.lang.Object run() {
                             return Thread.currentThread().getContextClassLoader();
                         }
@@ -539,6 +540,7 @@
         } else {
             return (ClassLoader) java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction() {
+                        @Override
                         public java.lang.Object run() {
                             return c.getClassLoader();
                         }
@@ -552,6 +554,7 @@
         } else {
             return (ClassLoader) java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction() {
+                        @Override
                         public java.lang.Object run() {
                             return ClassLoader.getSystemClassLoader();
                         }
--- a/src/java.xml.bind/share/classes/javax/xml/bind/Messages.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/javax/xml/bind/Messages.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, 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
@@ -65,6 +65,9 @@
     static final String PROVIDER_NOT_FOUND = // 1 arg
         "ContextFinder.ProviderNotFound";
 
+    static final String DEFAULT_PROVIDER_NOT_FOUND = // 0 args
+        "ContextFinder.DefaultProviderNotFound";
+
     static final String COULD_NOT_INSTANTIATE = // 2 args
         "ContextFinder.CouldNotInstantiate";
 
--- a/src/java.xml.bind/share/classes/javax/xml/bind/Messages.properties	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/javax/xml/bind/Messages.properties	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2017, 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
@@ -26,6 +26,9 @@
 ContextFinder.ProviderNotFound = \
         Provider {0} not found
 
+ContextFinder.DefaultProviderNotFound = \
+        Implementation of JAXB-API has not been found on module path or classpath.
+
 ContextFinder.CouldNotInstantiate = \
         Provider {0} could not be instantiated: {1}
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/package-info.java	Thu Feb 16 13:14:39 2017 +0300
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2017, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * {@link javax.xml.bind.annotation.adapters.XmlAdapter} and its spec-defined
+ * sub-classes to allow arbitrary Java classes to be used with JAXB.
+ * <p>
+ * <h2>Package Specification</h2>
+ * <p>
+ * <ul>
+ * <li><a href="http://jcp.org/en/jsr/detail?id=222">JAXB Specification</a>
+ * </ul>
+ * <p>
+ * <h2>Related Documentation</h2>
+ * <p>
+ * For overviews, tutorials, examples, guides, and tool documentation,
+ * please see:
+ * <ul>
+ * <li>The <a href="http://jaxb.java.net">JAXB Website</a>
+ * </ul>
+ *
+ * @see <a href="http://jaxb.java.net">JAXB Website</a>
+ */
+package javax.xml.bind.annotation.adapters;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.xml.bind/share/classes/javax/xml/bind/helpers/package-info.java	Thu Feb 16 13:14:39 2017 +0300
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2017, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * <B>JAXB Provider Use Only:</b> Provides partial default implementations for
+ * some of the <code>javax.xml.bind</code> interfaces.
+ * <p>
+ * <p>
+ * JAXB Providers can extend these classes and implement the abstract
+ * methods.
+ * <p>
+ * <h2>Package Specification</h2>
+ * <p>
+ * <ul>
+ * <li><a href="https://jaxb.java.net/">JAXB Specification</a>
+ * </ul>
+ * <p>
+ * <h2>Related Documentation</h2>
+ * <p>
+ * For overviews, tutorials, examples, guides, and tool documentation,
+ * please see:
+ * <ul>
+ * <li>The <a href="https://jaxb.java.net/">JAXB Website</a>
+ * </ul>
+ *
+ * @see <a href="https://jaxb.java.net/">JAXB Website</a>
+ */
+package javax.xml.bind.helpers;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.xml.bind/share/classes/javax/xml/bind/package-info.java	Thu Feb 16 13:14:39 2017 +0300
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2017, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides a runtime binding framework for client applications including
+ * unmarshalling, marshalling, and validation capabilities.
+ * <p>
+ * <p>
+ * <code>JAXBContext</code> is the client-entry point to the runtime binding
+ * framework.
+ * <p>
+ * <p>
+ * <h2>Package Specification</h2>
+ * <p>
+ * <ul>
+ * <li><a href="https://jaxb.java.net/">JAXB Specification</a>
+ * </ul>
+ * <p>
+ * <h2>Related Documentation</h2>
+ * <p>
+ * For overviews, tutorials, examples, guides, and tool documentation,
+ * please see:
+ * <ul>
+ * <li>The <a href="https://jaxb.java.net/">JAXB Website</a>
+ * </ul>
+ *
+ * @see <a href="https://jaxb.java.net/">JAXB Website</a>
+ */
+package javax.xml.bind;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.xml.bind/share/classes/javax/xml/bind/util/package-info.java	Thu Feb 16 13:14:39 2017 +0300
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2017, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Useful client utility classes.
+ * <p>
+ * <h2>Package Specification</h2>
+ * <p>
+ * <ul>
+ * <li><a href="https://jaxb.java.net/">JAXB Specification</a>
+ * </ul>
+ * <p>
+ * <h2>Related Documentation</h2>
+ * <p>
+ * For overviews, tutorials, examples, guides, and tool documentation,
+ * please see:
+ * <ul>
+ * <li>The <a href="https://jaxb.java.net/">JAXB Website</a>
+ * </ul>
+ *
+ * @see <a href="https://jaxb.java.net/">JAXB Website</a>
+ */
+package javax.xml.bind.util;
--- a/src/java.xml.bind/share/classes/module-info.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.bind/share/classes/module-info.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, 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
@@ -34,6 +34,7 @@
     requires java.compiler;
     requires java.desktop;
     requires java.logging;
+    requires jdk.unsupported;
 
     uses javax.xml.bind.JAXBContextFactory;
 
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, 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
@@ -39,8 +39,7 @@
 public interface LazyEnvelopeSource extends javax.xml.transform.Source {
     /**
      * Retrieve payload qname without materializing its contents
-     * @return
-     * @throws SOAPException
+     * @return payload QName
      */
     public QName getPayloadQName();
     public XMLStreamReader readToBodyStarTag() throws XMLStreamException;
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -86,6 +86,7 @@
     /**
      * Constructs a <code>SOAPExceptionImpl</code> object initialized
      * with the given <code>Throwable</code> object.
+     * @param cause cause
      */
     public SOAPExceptionImpl(Throwable cause) {
         super (cause.toString());
@@ -106,6 +107,7 @@
      *         message of the embedded <code>Throwable</code> object,
      *         if there is one
      */
+    @Override
     public String getMessage() {
         String message = super.getMessage ();
         if (message == null && cause != null) {
@@ -124,6 +126,7 @@
      *         if there is none
      */
 
+    @Override
     public Throwable getCause() {
         return cause;
     }
@@ -157,6 +160,7 @@
      *         method has already been called on this <code>SOAPExceptionImpl</code>
      *         object
      */
+    @Override
     public synchronized Throwable initCause(Throwable cause)
     {
         if(this.cause != null) {
@@ -170,6 +174,7 @@
         return this;
     }
 
+    @Override
     public void printStackTrace() {
         super.printStackTrace();
         if (cause != null) {
@@ -178,6 +183,7 @@
         }
     }
 
+    @Override
     public void printStackTrace(PrintStream s) {
         super.printStackTrace(s);
         if (cause != null) {
@@ -186,6 +192,7 @@
         }
     }
 
+    @Override
     public void printStackTrace(PrintWriter s) {
         super.printStackTrace(s);
         if (cause != null) {
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -512,9 +512,13 @@
                         : httpConnection.getInputStream());
                 // If no reply message is returned,
                 // content-Length header field value is expected to be zero.
-                // InputStream#available() can't be used here - it just says no data *YET*!
+                // java SE 6 documentation says :
+                // available() : an estimate of the number of bytes that can be read
+                //(or skipped over) from this input stream without blocking
+                //or 0 when it reaches the end of the input stream.
                 if ((httpIn == null )
-                        || (httpConnection.getContentLength() == 0)) {
+                        || (httpConnection.getContentLength() == 0)
+                        || (httpIn.available() == 0)) {
                     response = null;
                     log.warning("SAAJ0014.p2p.content.zero");
                 } else {
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -69,7 +69,7 @@
      * @return          the MimeBodyPart
      * @exception       IndexOutOfBoundsException if the given index
      *                  is out of range.
-     * @exception       MessagingException
+     * @exception       MessagingException thrown in case of error
      */
     public MimeBodyPart getBodyPart(int index) throws MessagingException;
 
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -115,6 +115,8 @@
      * <code>contentType</code> field. <p>
      *
      * MimeBodyParts may be added later.
+     *
+     * @param subtype subtype.
      */
     public BMMimeMultipart(String subtype) {
         super(subtype);
@@ -142,7 +144,9 @@
      * skips the 'preamble' and reads bytes till the terminating
      * boundary and creates MimeBodyParts for each part of the stream.
      *
-     * @param   ds      DataSource, can be a MultipartDataSource
+     * @param   ds      DataSource, can be a MultipartDataSource.
+     * @param   ct      content type.
+     * @exception MessagingException in case of error.
      */
     public BMMimeMultipart(DataSource ds, ContentType ct)
         throws MessagingException {
@@ -197,6 +201,7 @@
      *
      * @since   JavaMail 1.2
      */
+    @Override
     protected  void parse() throws  MessagingException {
         if (parsed)
             return;
@@ -694,6 +699,7 @@
      * separated by a boundary.
      */
 
+    @Override
     public void writeTo(OutputStream os)
             throws IOException, MessagingException {
 
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -100,6 +100,7 @@
     /**
      * Return the specified parameter value. Returns <code>null</code>
      * if this parameter is absent.
+     * @param name parameter name.
      * @return  parameter value
      * @since           JavaMail 1.2
      */
@@ -123,7 +124,7 @@
 
     /**
      * Set the primary type. Overrides existing primary type.
-     * @param   primaryType     primary type
+     * @param   disposition disposition value
      * @since           JavaMail 1.2
      */
     public void setDisposition(String disposition) {
@@ -162,6 +163,7 @@
      * @return  RFC2045 style string
      * @since           JavaMail 1.2
      */
+    @Override
     public String toString() {
         if (disposition == null)
             return null;
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -136,6 +136,7 @@
     /**
      * Return the specified parameter value. Returns <code>null</code>
      * if this parameter is absent.
+     * @param name parameter name
      * @return  parameter value
      */
     public String getParameter(String name) {
@@ -200,6 +201,7 @@
      *
      * @return  RFC2045 style string
      */
+    @Override
     public String toString() {
         if (primaryType == null || subType == null) // need both
             return null;
@@ -218,7 +220,7 @@
     /**
      * Match with the specified ContentType object. This method
      * compares <strong>only the <code>primaryType</code> and
-     * <code>subType</code> </strong>. The parameters of both operands
+     * <code>primaryType</code> </strong>. The parameters of both operands
      * are ignored. <p>
      *
      * For example, this method will return <code>true</code> when
@@ -232,6 +234,8 @@
      * and <strong>"text/*" </strong>
      *
      * @param   cType to compare this against
+     * @return true if <code>primaryType</code> and <code>subType</code>
+     * match specified content type.
      */
     public boolean match(ContentType cType) {
         // Match primaryType
@@ -266,6 +270,10 @@
      * For example, this method will return <code>true</code> when
      * comparing the ContentType for <strong>"text/plain"</strong>
      * with <strong>"text/*" </strong>
+     *
+     * @param s content type
+     * @return true if <code>primaryType</code> and <code>subType</code>
+     * match specified content type.
      */
     public boolean match(String s) {
         try {
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -95,14 +95,15 @@
          * one of the following:
          * <ul>
          * <li><code>ATOM</code> A sequence of ASCII characters
-         *      delimited by either SPACE, CTL, "(", <"> or the
-         *      specified SPECIALS
+         *      delimited by either SPACE, CTL, "(", &lt;"&gt; or the
+         *      specified SPECIALS</li>
          * <li><code>QUOTEDSTRING</code> A sequence of ASCII characters
-         *      within quotes
+         *      within quotes</li>
          * <li><code>COMMENT</code> A sequence of ASCII characters
-         *      within "(" and ")".
-         * <li><code>EOF</code> End of header
+         *      within "(" and ")".</li>
+         * <li><code>EOF</code> End of header</li>
          * </ul>
+         * @return type
          */
         public int getType() {
             return type;
@@ -176,6 +177,7 @@
      * Constructor. The RFC822 defined delimiters - RFC822 - are
      * used to delimit ATOMS. Also comments are skipped and not
      * returned as tokens
+     * @param header The header that is tokenized.
      */
     public HeaderTokenizer(String header)  {
         this(header, RFC822);
@@ -317,7 +319,7 @@
             currentPos++; // re-position currentPos
             char ch[] = new char[1];
             ch[0] = c;
-            return new Token((int)c, new String(ch));
+            return new Token(c, new String(ch));
         }
 
         // Check for ATOM
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -48,13 +48,12 @@
  * until the blank line that indicates end of header. The input stream
  * is positioned at the start of the body. The lines are stored
  * within the object and can be extracted as either Strings or
- * {@link Header} objects. <p>
- * <p/>
+ * {@link Header} objects.
+ * <p>
  * This class is mostly intended for service providers. MimeMessage
- * and MimeBody use this class for holding their headers. <p>
- * <p/>
- * <hr> <strong>A note on RFC822 and MIME headers</strong><p>
- * <p/>
+ * and MimeBody use this class for holding their headers.
+ * <hr> <strong>A note on RFC822 and MIME headers</strong>
+ * <p>
  * RFC822 and MIME header fields <strong>must</strong> contain only
  * US-ASCII characters. If a header contains non US-ASCII characters,
  * it must be encoded as per the rules in RFC 2047. The MimeUtility
@@ -65,7 +64,7 @@
  * header fields must be folded (wrapped) before being sent if they
  * exceed the line length limitation for the transport (1000 bytes for
  * SMTP).  Received headers may have been folded.  The application is
- * responsible for folding and unfolding headers as appropriate. <p>
+ * responsible for folding and unfolding headers as appropriate.
  *
  * @author John Mani
  * @author Bill Shannon
@@ -90,12 +89,13 @@
      * Read and parse the given RFC822 message stream till the
      * blank line separating the header from the body. The input
      * stream is left positioned at the start of the body. The
-     * header lines are stored internally. <p>
-     * <p/>
+     * header lines are stored internally.
+     * <p>
      * For efficiency, wrap a BufferedInputStream around the actual
      * input stream and pass it as the parameter.
      *
      * @param   is RFC822 input stream
+     * @exception MessagingException in case of error
      */
     public InternetHeaders(InputStream is) throws MessagingException {
         load(is);
@@ -104,13 +104,14 @@
     /**
      * Read and parse the given RFC822 message stream till the
      * blank line separating the header from the body. Store the
-     * header lines inside this InternetHeaders object. <p>
-     * <p/>
+     * header lines inside this InternetHeaders object.
+     * <p>
      * Note that the header lines are added into this InternetHeaders
      * object, so any existing headers in this object will not be
      * affected.
      *
      * @param   is RFC822 input stream
+     * @exception MessagingException in case of error
      */
     public void load(InputStream is) throws MessagingException {
         // Read header lines until a blank line. It is valid
@@ -208,9 +209,9 @@
     /**
      * Change the first header line that matches name
      * to have value, adding a new header if no existing header
-     * matches. Remove all matching headers but the first. <p>
-     * <p/>
-     * Note that RFC822 headers can only contain US-ASCII characters
+     * matches. Remove all matching headers but the first.
+     * <p>
+     * Note that RFC822 headers can only contain US-ASCII characters.
      *
      * @param   name    header name
      * @param   value   header value
@@ -242,8 +243,7 @@
     }
 
     /**
-     * Add a header with the specified name and value to the header list. <p>
-     * <p/>
+     * Add a header with the specified name and value to the header list.
      * Note that RFC822 headers can only contain US-ASCII characters.
      *
      * @param   name    header name
@@ -285,15 +285,15 @@
      *
      * @return  Header objects
      */
-    public List<? extends Header> getAllHeaders() {
+    public FinalArrayList<hdr> getAllHeaders() {
         return headers; // conceptually it should be read-only, but for performance reason I'm not wrapping it here
     }
 
     /**
      * Add an RFC822 header line to the header store.
      * If the line starts with a space or tab (a continuation line),
-     * add it to the last header line in the list. <p>
-     * <p/>
+     * add it to the last header line in the list.
+     * <p>
      * Note that RFC822 headers can only contain US-ASCII characters
      *
      * @param   line    raw RFC822 header line
@@ -316,15 +316,19 @@
 
     /**
      * Return all the header lines as a collection
+     *
+     * @return list of header lines.
      */
     public List<String> getAllHeaderLines() {
         if(headerValueView==null)
             headerValueView = new AbstractList<String>() {
-                public String get(int index) {
+                @Override
+                                public String get(int index) {
                     return headers.get(index).line;
                 }
 
-                public int size() {
+                @Override
+                                public int size() {
                     return headers.size();
                 }
             };
@@ -368,6 +372,7 @@
     /*
      * Return the "name" part of the header line.
      */
+    @Override
     public String getName() {
         return name;
     }
@@ -375,6 +380,7 @@
     /*
      * Return the "value" part of the header line.
      */
+    @Override
     public String getValue() {
         int i = line.indexOf(':');
         if (i < 0)
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -32,7 +32,6 @@
 package com.sun.xml.internal.messaging.saaj.packaging.mime.internet;
 
 
-import com.sun.xml.internal.messaging.saaj.packaging.mime.Header;
 import com.sun.xml.internal.messaging.saaj.packaging.mime.MessagingException;
 import com.sun.xml.internal.messaging.saaj.packaging.mime.util.OutputUtil;
 import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
@@ -52,12 +51,12 @@
 /**
  * This class represents a MIME body part.
  * MimeBodyParts are contained in <code>MimeMultipart</code>
- * objects. <p>
+ * objects.
+ * <p>
+ * MimeBodyPart uses the <code>InternetHeaders</code> class to parse
+ * and store the headers of that body part.
  *
- * MimeBodyPart uses the <code>InternetHeaders</code> class to parse
- * and store the headers of that body part. <p>
- *
- * <hr><strong>A note on RFC 822 and MIME headers</strong><p>
+ * <hr><strong>A note on RFC 822 and MIME headers</strong>
  *
  * RFC 822 header fields <strong>must</strong> contain only
  * US-ASCII characters. MIME allows non ASCII characters to be present
@@ -70,7 +69,7 @@
  * header fields must be folded (wrapped) before being sent if they
  * exceed the line length limitation for the transport (1000 bytes for
  * SMTP).  Received headers may have been folded.  The application is
- * responsible for folding and unfolding headers as appropriate. <p>
+ * responsible for folding and unfolding headers as appropriate.
  *
  * @author John Mani
  * @author Bill Shannon
@@ -179,6 +178,8 @@
      * the delimiter strings.
      *
      * @param   is      the body part Input Stream
+     *
+     * @exception MessagingException in case of error
      */
     public MimeBodyPart(InputStream is) throws MessagingException {
         if (!(is instanceof ByteArrayInputStream) &&
@@ -216,6 +217,7 @@
      *
      * @param   headers The header of this part
      * @param   content bytes representing the body of this part.
+     * @param   len content length.
      */
     public MimeBodyPart(InternetHeaders headers, byte[] content, int len) {
         this.headers = headers;
@@ -242,6 +244,7 @@
     /**
      * Return the containing <code>MimeMultipart</code> object,
      * or <code>null</code> if not known.
+     * @return parent part.
      */
     public MimeMultipart getParent() {
         return parent;
@@ -253,6 +256,7 @@
      * <code>addBodyPart</code> method.  <code>parent</code> may be
      * <code>null</code> if the <code>MimeBodyPart</code> is being removed
      * from its containing <code>MimeMultipart</code>.
+     * @param parent parent part
      * @since   JavaMail 1.1
      */
     public void setParent(MimeMultipart parent) {
@@ -351,6 +355,9 @@
      * If the <code>subType</code> of <code>mimeType</code> is the
      * special character '*', then the subtype is ignored during the
      * comparison.
+     *
+     * @param mimeType string
+     * @return true if it is valid mime type
      */
     public boolean isMimeType(String mimeType) {
         boolean result;
@@ -375,6 +382,9 @@
      * This implementation uses <code>getHeader(name)</code>
      * to obtain the requisite header field.
      *
+     * @return content disposition
+     * @exception MessagingException in case of error
+     *
      * @see #headers
      */
     public String getDisposition() throws MessagingException {
@@ -392,6 +402,9 @@
      * If the disposition is null, any existing "Content-Disposition"
      * header field is removed.
      *
+     * @param disposition value
+     *
+     * @exception MessagingException in case of error
      * @exception       IllegalStateException if this body part is
      *                  obtained from a READ_ONLY folder.
      */
@@ -423,6 +436,9 @@
      * This implementation uses <code>getHeader(name)</code>
      * to obtain the requisite header field.
      *
+     * @return encoding
+     * @exception MessagingException in case of error
+     *
      * @see #headers
      */
     public String getEncoding() throws MessagingException {
@@ -465,6 +481,8 @@
      *
      * This implementation uses <code>getHeader(name)</code>
      * to obtain the requisite header field.
+     *
+     * @return conent id
      */
     public String getContentID() {
         return getHeader("Content-ID", null);
@@ -475,6 +493,7 @@
      * If the <code>cid</code> parameter is null, any existing
      * "Content-ID" is removed.
      *
+     * @param cid content id
      * @exception       IllegalStateException if this body part is
      *                  obtained from a READ_ONLY folder.
      * @since           JavaMail 1.3
@@ -493,6 +512,8 @@
      *
      * This implementation uses <code>getHeader(name)</code>
      * to obtain the requisite header field.
+     *
+     * @return content MD5 sum
      */
     public String getContentMD5() {
         return getHeader("Content-MD5", null);
@@ -501,6 +522,8 @@
     /**
      * Set the "Content-MD5" header field of this body part.
      *
+     * @param md5 content md5 sum
+     *
      * @exception       IllegalStateException if this body part is
      *                  obtained from a READ_ONLY folder.
      */
@@ -516,6 +539,9 @@
      *
      * This implementation uses <code>getHeader(name)</code>
      * to obtain the requisite header field.
+     *
+     * @return array of language tags
+     * @exception MessagingException in case of error
      */
     public String[] getContentLanguage() throws MessagingException {
         String s = getHeader("Content-Language", null);
@@ -663,6 +689,7 @@
      * Returns <code>null</code> if both are absent.
      *
      * @return  filename
+     * @exception MessagingException in case of error
      */
     public String getFileName() throws MessagingException {
         String filename = null;
@@ -692,6 +719,9 @@
      * Sets the "filename" parameter of the "Content-Disposition"
      * header field of this body part.
      *
+     * @param filename filename
+     *
+     * @exception MessagingException in case of error
      * @exception       IllegalStateException if this body part is
      *                  obtained from a READ_ONLY folder.
      */
@@ -769,9 +799,14 @@
      * This implementation simply calls the <code>getContentStream</code>
      * method.
      *
+     * @return input stream
+     *
+     * @exception MessagingException in case of error
+     *
      * @see     #getInputStream
      * @see     #getContentStream
      * @since   JavaMail 1.2
+     *
      */
     public InputStream getRawInputStream() throws MessagingException {
         return getContentStream();
@@ -782,24 +817,30 @@
      *
      * The implementation provided here works just like the
      * the implementation in MimeMessage.
+     *
+     * @return data handler
      */
     public DataHandler getDataHandler() {
         if (mimePart != null) {
             //return an inputstream
             return new DataHandler(new DataSource() {
 
+                @Override
                 public InputStream getInputStream() throws IOException {
                     return mimePart.read();
                 }
 
+                @Override
                 public OutputStream getOutputStream() throws IOException {
                     throw new UnsupportedOperationException("getOutputStream cannot be supported : You have enabled LazyAttachments Option");
                 }
 
+                @Override
                 public String getContentType() {
                     return mimePart.getContentType();
                 }
 
+                @Override
                 public String getName() {
                     return "MIMEPart Wrapped DataSource";
                 }
@@ -890,6 +931,8 @@
      * If the charset is already known, use the
      * setText() version that takes the charset parameter.
      *
+     * @param text string
+     *
      * @see     #setText(String text, String charset)
      */
     public void setText(String text) {
@@ -902,6 +945,9 @@
      * charset. The given Unicode string will be charset-encoded
      * using the specified charset. The charset is also used to set
      * the "charset" parameter.
+     *
+     * @param text string
+     * @param charset character set
      */
     public void setText(String text, String charset) {
         if (charset == null) {
@@ -932,7 +978,9 @@
     /**
      * Output the body part as an RFC 822 format stream.
      *
-     * @exception MessagingException
+     * @param os output stream
+     *
+     * @exception MessagingException in case of error
      * @exception IOException   if an error occurs writing to the
      *                          stream or if an error is generated
      *                          by the javax.activation layer.
@@ -1033,6 +1081,8 @@
 
     /**
      * Remove all headers with this name.
+     *
+     * @param name header name
      */
     public void removeHeader(String name) {
         headers.removeHeader(name);
@@ -1041,14 +1091,18 @@
     /**
      * Return all the headers from this Message as an Enumeration of
      * Header objects.
+     *
+     * @return all headers
      */
-    public List<? extends Header> getAllHeaders() {
+    public FinalArrayList<hdr> getAllHeaders() {
         return headers.getAllHeaders();
     }
 
 
     /**
      * Add a header line to this body part
+     *
+     * @param line header line to add
      */
     public void addHeaderLine(String line) {
         headers.addHeaderLine(line);
@@ -1075,6 +1129,8 @@
      * <br>
      * In both cases this method is typically called by the
      * <code>Message.saveChanges</code> method.
+     *
+     * @exception MessagingException in case of error.
      */
     protected void updateHeaders() throws MessagingException {
         DataHandler dh = getDataHandler();
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -133,6 +133,7 @@
      * <code>contentType</code> field. <p>
      *
      * MimeBodyParts may be added later.
+     * @param subtype subtype.
      */
     public MimeMultipart(String subtype) {
         //super();
@@ -163,6 +164,8 @@
      *      This must be the same information as {@link DataSource#getContentType()}.
      *      All the callers of this method seem to have this object handy, so
      *      for performance reason this method accepts it. Can be null.
+     *
+     * @exception MessagingException in case of error
      */
     public MimeMultipart(DataSource ds, ContentType ct) throws MessagingException {
         // 'ds' was not a MultipartDataSource, we have
@@ -189,7 +192,8 @@
     /**
      * Return the number of enclosed MimeBodyPart objects.
      *
-     * @return          number of parts
+     * @return          number of parts.
+     * @throws MessagingException in case of error.
      */
     public  int getCount() throws MessagingException {
         parse();
@@ -202,8 +206,8 @@
     /**
      * Get the specified MimeBodyPart.  BodyParts are numbered starting at 0.
      *
-     * @param index     the index of the desired MimeBodyPart
-     * @return          the MimeBodyPart
+     * @param index     the index of the desired MimeBodyPart.
+     * @return          the MimeBodyPart.
      * @exception       MessagingException if no such MimeBodyPart exists
      */
     public  MimeBodyPart getBodyPart(int index)
@@ -221,6 +225,7 @@
      *
      * @param  CID      the ContentID of the desired part
      * @return          the MimeBodyPart
+     * @exception       MessagingException if no such MimeBodyPart exists.
      */
     public  MimeBodyPart getBodyPart(String CID)
                         throws MessagingException {
@@ -256,6 +261,8 @@
      * expensive for a specific MimeMultipart subclass, then it
      * might itself want to track whether its internal state actually
      * did change, and do the header updating only if necessary.
+     *
+     * @exception       MessagingException in case of error.
      */
     protected void updateHeaders() throws MessagingException {
         for (int i = 0; i < parts.size(); i++)
@@ -265,6 +272,11 @@
     /**
      * Iterates through all the parts and outputs each Mime part
      * separated by a boundary.
+     *
+     * @param os output stream.
+     *
+     * @exception IOException if an I/O Error occurs.
+     * @exception MessagingException in case of error.
      */
     public void writeTo(OutputStream os)
             throws IOException, MessagingException {
@@ -291,6 +303,8 @@
      * method is called by all other methods that need data for
      * the body parts, to make sure the data has been parsed.
      *
+     * @exception MessagingException in case of error.
+     *
      * @since   JavaMail 1.2
      */
     protected  void parse() throws MessagingException {
@@ -490,8 +504,9 @@
      * necessary.  This implementation simply constructs and returns
      * an InternetHeaders object.
      *
-     * @param   is      the InputStream to read the headers from
-     * @exception       MessagingException
+     * @param   is      the InputStream to read the headers from.
+     * @return headers.
+     * @exception       MessagingException in case of error.
      * @since           JavaMail 1.2
      */
     protected InternetHeaders createInternetHeaders(InputStream is)
@@ -506,8 +521,10 @@
      * necessary.  This implementation simply constructs and returns
      * a MimeBodyPart object.
      *
-     * @param   headers         the headers for the body part
-     * @param   content         the content of the body part
+     * @param   headers         the headers for the body part.
+     * @param   content         the content of the body part.
+     * @param   len             the content length.
+     * @return  MimeBodyPart
      * @since                   JavaMail 1.2
      */
     protected MimeBodyPart createMimeBodyPart(InternetHeaders headers, byte[] content, int len) {
@@ -521,8 +538,9 @@
      * necessary.  This implementation simply constructs and returns
      * a MimeBodyPart object.
      *
-     * @param   is              InputStream containing the body part
-     * @exception               MessagingException
+     * @param   is              InputStream containing the body part.
+     * @return  MimeBodyPart.
+     * @exception               MessagingException in case of error.
      * @since                   JavaMail 1.2
      */
     protected MimeBodyPart createMimeBodyPart(InputStream is) throws MessagingException {
@@ -543,8 +561,8 @@
      * a specific multipart subtype.
      *
      * @param   mp      MimeMultipart datasource
+     * @exception               MessagingException in case of error.
      */
-
     protected void setMultipartDataSource(MultipartDataSource mp)
                         throws MessagingException {
         contentType = new ContentType(mp.getContentType());
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -50,6 +50,8 @@
 
     /**
      * Constructor, that constructs a DataSource from a MimeBodyPart.
+     *
+     * @param part body part
      */
     public MimePartDataSource(MimeBodyPart part) {
         this.part = part;
@@ -68,6 +70,7 @@
      *
      * @return  decoded input stream
      */
+    @Override
     public InputStream getInputStream() throws IOException {
 
         try {
@@ -88,7 +91,8 @@
      *
      * This implementation throws the UnknownServiceException.
      */
-    public OutputStream getOutputStream() throws IOException {
+    @Override
+        public OutputStream getOutputStream() throws IOException {
         throw new UnknownServiceException();
     }
 
@@ -98,6 +102,7 @@
      * This implementation just invokes the <code>getContentType</code>
      * method on the MimeBodyPart.
      */
+    @Override
     public String getContentType() {
         return part.getContentType();
     }
@@ -107,7 +112,8 @@
      *
      * This implementation just returns an empty string.
      */
-    public String getName() {
+    @Override
+        public String getName() {
         try {
                 return part.getFileName();
         } catch (MessagingException mex) {
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -65,11 +65,11 @@
  * <p>
  * Note that to get the actual bytes of a mail-safe String (say,
  * for sending over SMTP), one must do
- * <p><blockquote><pre>
+ * <blockquote><pre>
  *
  *      byte[] bytes = string.getBytes("iso-8859-1");
  *
- * </pre></blockquote><p>
+ * </pre></blockquote>
  *
  * The <code>setHeader</code> and <code>addHeader</code> methods
  * on MimeMessage and MimeBodyPart assume that the given header values
@@ -222,6 +222,10 @@
      * <code>DataHandler</code> uses a thread, a pair of pipe streams,
      * and the <code>writeTo</code> method to produce the data. <p>
      *
+     * @param dh data handler
+     *
+     * @return encoding
+     *
      * @since   JavaMail 1.2
      */
     public static String getEncoding(DataHandler dh) {
@@ -294,6 +298,7 @@
      * @param   is              input stream
      * @param   encoding        the encoding of the stream.
      * @return                  decoded input stream.
+     * @exception MessagingException in case of error
      */
     public static InputStream decode(InputStream is, String encoding)
                 throws MessagingException {
@@ -323,6 +328,7 @@
      * @param   encoding        the encoding of the stream.
      * @return                  output stream that applies the
      *                          specified encoding.
+     * @exception MessagingException in case of error
      */
     public static OutputStream encode(OutputStream os, String encoding)
                 throws MessagingException {
@@ -358,6 +364,7 @@
      *                          with uuencode)
      * @return                  output stream that applies the
      *                          specified encoding.
+     * @exception MessagingException in case of error
      * @since                   JavaMail 1.2
      */
     public static OutputStream encode(OutputStream os, String encoding,
@@ -397,7 +404,7 @@
      * "unstructured" RFC 822 headers. <p>
      *
      * Example of usage:
-     * <p><blockquote><pre>
+     * <blockquote><pre>
      *
      *  MimeBodyPart part = ...
      *  String rawvalue = "FooBar Mailer, Japanese version 1.1"
@@ -411,7 +418,7 @@
      *   // setHeader() failure
      *  }
      *
-     * </pre></blockquote><p>
+     * </pre></blockquote>
      *
      * @param   text    unicode string
      * @return  Unicode string containing only US-ASCII characters
@@ -446,6 +453,7 @@
      *          encoded are in the ASCII charset, otherwise "B" encoding
      *          is used.
      * @return  Unicode string containing only US-ASCII characters
+     * @exception UnsupportedEncodingException in case of unsupported encoding
      */
     public static String encodeText(String text, String charset,
                                     String encoding)
@@ -464,7 +472,7 @@
      * returned as-is <p>
      *
      * Example of usage:
-     * <p><blockquote><pre>
+     * <blockquote><pre>
      *
      *  MimeBodyPart part = ...
      *  String rawvalue = null;
@@ -479,9 +487,10 @@
      *
      *  return value;
      *
-     * </pre></blockquote><p>
+     * </pre></blockquote>
      *
      * @param   etext   the possibly encoded value
+     * @return decoded text
      * @exception       UnsupportedEncodingException if the charset
      *                  conversion failed.
      */
@@ -568,7 +577,7 @@
      * The InternetAddress class, for example, uses this to encode
      * it's 'phrase' component.
      *
-     * @param   text    unicode string
+     * @param   word    unicode string
      * @return  Array of Unicode strings containing only US-ASCII
      *          characters.
      * @exception UnsupportedEncodingException if the encoding fails
@@ -590,7 +599,7 @@
      * The resulting bytes are then returned as a Unicode string
      * containing only ASCII characters. <p>
      *
-     * @param   text    unicode string
+     * @param   word    unicode string
      * @param   charset the MIME charset
      * @param   encoding the encoding to be used. Currently supported
      *          values are "B" and "Q". If this parameter is null, then
@@ -720,6 +729,7 @@
      * fails, an UnsupportedEncodingException is thrown.<p>
      *
      * @param   eword   the possibly encoded value
+     * @return deocoded word
      * @exception       ParseException if the string is not an
      *                  encoded-word as per RFC 2047.
      * @exception       UnsupportedEncodingException if the charset
@@ -847,8 +857,8 @@
      * @param   word    word to be quoted
      * @param   specials the set of special characters
      * @return          the possibly quoted word
-     * @see     javax.mail.internet.HeaderTokenizer#MIME
-     * @see     javax.mail.internet.HeaderTokenizer#RFC822
+     * @see     com.sun.xml.internal.messaging.saaj.packaging.mime.internet.HeaderTokenizer#MIME
+     * @see     com.sun.xml.internal.messaging.saaj.packaging.mime.internet.HeaderTokenizer#RFC822
      */
     public static String quote(String word, String specials) {
         int len = word.length();
@@ -1111,7 +1121,8 @@
             } catch (SecurityException sex) {
 
                 class NullInputStream extends InputStream {
-                    public int read() {
+                    @Override
+                   public int read() {
                         return 0;
                     }
                 }
@@ -1277,7 +1288,7 @@
         int l = s.length();
 
         for (int i = 0; i < l; i++) {
-            if (nonascii((int)s.charAt(i))) // non-ascii
+            if (nonascii(s.charAt(i))) // non-ascii
                 non_ascii++;
             else
                 ascii++;
@@ -1444,14 +1455,17 @@
         checkEOL = encodeEolStrict && breakOnNonAscii;
     }
 
+    @Override
     public void write(int b) throws IOException {
         check(b);
     }
 
+    @Override
     public void write(byte b[]) throws IOException {
         write(b, 0, b.length);
     }
 
+    @Override
     public void write(byte b[], int off, int len) throws IOException {
         len += off;
         for (int i = off; i < len ; i++)
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -73,6 +73,9 @@
 
     /**
      * Writes the specified region to another {@link OutputStream}.
+     * @param   start   the starting position
+     * @param   end     the ending position + 1
+     * @param   out     output stream
      */
     public void writeTo(long start,long end, OutputStream out);
 }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -43,9 +43,17 @@
     /**
      * Convert the bytes within the specified range of the given byte
      * array into a signed integer in the given radix . The range extends
-     * from <code>start</code> till, but not including <code>end</code>. <p>
+     * from <code>start</code> till, but not including <code>end</code>.
      *
-     * Based on java.lang.Integer.parseInt()
+     * Based on java.lang.Integer.parseInt().
+     *
+     * @param b bytes to convert to integer.
+     * @param start start of the range.
+     * @param end end of the range (not including).
+     * @param radix radix.
+     *
+     * @return integer.
+     *
      */
     public static int parseInt(byte[] b, int start, int end, int radix)
                 throws NumberFormatException {
@@ -110,7 +118,14 @@
     /**
      * Convert the bytes within the specified range of the given byte
      * array into a String. The range extends from <code>start</code>
-     * till, but not including <code>end</code>. <p>
+     * till, but not including <code>end</code>.
+     *
+     * @param b bytes to convert to integer.
+     * @param start start of the range.
+     * @param end end of the range (not including).
+     *
+     * @return integer.
+     *
      */
     public static String toString(byte[] b, int start, int end) {
         int size = end - start;
@@ -122,6 +137,15 @@
         return new String(theChars);
     }
 
+        /**
+         * Encodes specified String into a sequence of bytes using the platform's
+         * default charset, storing the result into a new byte array.
+         *
+         * @param s string to encode into byte array.
+         *
+         * @return byte array.
+         *
+         */
     public static byte[] getBytes(String s) {
         char [] chars= s.toCharArray();
         int size = chars.length;
@@ -133,6 +157,13 @@
     }
 
     /**
+         * Converts input stream to array.
+         *
+         * @param is stream to convert to array.
+         *
+         * @return byte array.
+         *
+         * @throws IOException if an I/O error occurs.
      *
      * @deprecated
      *      this is an expensive operation that require an additional
@@ -140,6 +171,7 @@
      *      Unless you absolutely need the exact size array, don't use this.
      *      Use {@link ByteOutputStream} and {@link ByteOutputStream#write(InputStream)}.
      */
+    @Deprecated
     public static byte[] getBytes(InputStream is) throws IOException {
         ByteOutputStream bos = null;
         try {
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -70,6 +70,7 @@
      * @exception  IOException  if an I/O error occurs.
      * @see        java.io.FilterInputStream#in
      */
+    @Override
     public int read() throws IOException {
         if (index >= bufsize) {
             decode(); // Fills up buffer
@@ -94,6 +95,7 @@
      *             the stream has been reached.
      * @exception  IOException  if an I/O error occurs.
      */
+    @Override
     public int read(byte[] buf, int off, int len) throws IOException {
         int i, c;
         for (i = 0; i < len; i++) {
@@ -112,6 +114,7 @@
      * Tests if this input stream supports marks. Currently this class
      * does not support marks
      */
+    @Override
     public boolean markSupported() {
         return false; // Maybe later ..
     }
@@ -122,6 +125,7 @@
      * a close approximation in case the original encoded stream
      * contains embedded CRLFs; since the CRLFs are discarded, not decoded
      */
+    @Override
     public int available() throws IOException {
          // This is only an estimate, since in.available()
          // might include CRLFs too ..
@@ -200,6 +204,10 @@
      * in the IMAP AUTHENTICATE protocol, but not to decode the
      * entire content of a MIME part.
      *
+     * @param inbuf byte array to decode
+     *
+     * @return decoded byte array
+     *
      * NOTE: inbuf may only contain valid base64 characters.
      *       Whitespace is not ignored.
      */
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -80,6 +80,7 @@
      * @param      len   the number of bytes to write.
      * @exception  IOException  if an I/O error occurs.
      */
+    @Override
     public void write(byte[] b, int off, int len) throws IOException {
         for (int i = 0; i < len; i++)
             write(b[off + i]);
@@ -90,6 +91,7 @@
      * @param      b   the data to be written.
      * @exception  IOException  if an I/O error occurs.
      */
+    @Override
     public void write(byte[] b) throws IOException {
         write(b, 0, b.length);
     }
@@ -99,6 +101,7 @@
      * @param      c   the <code>byte</code>.
      * @exception  IOException  if an I/O error occurs.
      */
+    @Override
     public void write(int c) throws IOException {
         buffer[bufsize++] = (byte)c;
         if (bufsize == 3) { // Encoding unit = 3 bytes
@@ -112,6 +115,7 @@
      * to be encoded out to the stream.
      * @exception  IOException  if an I/O error occurs.
      */
+    @Override
     public void flush() throws IOException {
         if (bufsize > 0) { // If there's unencoded characters in the buffer ..
             encode();      // .. encode them
@@ -124,6 +128,7 @@
      * Forces any buffered output bytes to be encoded out to the stream
      * and closes this output stream
      */
+    @Override
     public void close() throws IOException {
         flush();
         out.close();
@@ -186,6 +191,10 @@
      * This method is suitable for short strings, such as those
      * in the IMAP AUTHENTICATE protocol, but not to encode the
      * entire content of a MIME part.
+     *
+     * @param inbuf byte array to encode.
+     *
+     * @return encoded byte array.
      */
     public static byte[] encode(byte[] inbuf) {
         if (inbuf.length == 0)
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -55,6 +55,10 @@
 
     /**
      * Returns the length of the encoded version of this byte array.
+     *
+     * @param b byte array.
+     *
+     * @return length of the byte array.
      */
     public static int encodedLength(byte[] b) {
         return ((b.length + 2)/3) * 4;
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -64,6 +64,10 @@
      *
      * This class is similar to the deprecated
      * <code>DataInputStream.readLine()</code>
+     *
+     * @return line.
+     *
+     * @throws IOException if an I/O error occurs.
      */
     public String readLine() throws IOException {
         InputStream in = this.in;
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -54,6 +54,11 @@
 
     /**
      * Writes a string as ASCII string.
+     *
+     * @param s string.
+     * @param out output stream.
+     *
+     * @throws IOException if an I/O error occurs.
      */
     public static void writeAsAscii(String s,OutputStream out) throws IOException {
         int len = s.length();
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -69,6 +69,7 @@
      * @param      c   the <code>byte</code>.
      * @exception  IOException  if an I/O error occurs.
      */
+    @Override
     public void write(int c) throws IOException {
         c = c & 0xff; // Turn off the MSB.
         if (c == ' ')
@@ -82,6 +83,11 @@
 
     /**
      * Returns the length of the encoded version of this byte array.
+     *
+     * @param b byte array.
+     * @param encodingWord whether use word or text specials.
+     *
+     * @return length.
      */
     public static int encodedLength(byte[] b, boolean encodingWord) {
         int len = 0;
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -83,23 +83,29 @@
     /**
      * Set up the buffer name and permission mode.
      * This method has any effect only if it is invoked before
-     * you start writing into the output stream
+     * you start writing into the output stream.
+     *
+     * @param name name to set for the buffer.
+     * @param mode permission mode.
      */
     public void setNameMode(String name, int mode) {
         this.name = name;
         this.mode = mode;
     }
 
+    @Override
     public void write(byte[] b, int off, int len) throws IOException {
         for (int i = 0; i < len; i++)
             write(b[off + i]);
     }
 
+    @Override
     public void write(byte[] data) throws IOException {
         write(data, 0, data.length);
     }
 
-    public void write(int c) throws IOException {
+    @Override
+        public void write(int c) throws IOException {
         /* buffer up characters till we get a line's worth, then encode
          * and write them out. Max number of characters allowed per
          * line is 45.
@@ -112,6 +118,7 @@
         }
     }
 
+    @Override
     public void flush() throws IOException {
         if (bufsize > 0) { // If there's unencoded characters in the buffer
             writePrefix();
@@ -121,6 +128,7 @@
         out.flush();
     }
 
+    @Override
     public void close() throws IOException {
         flush();
         out.close();
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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,16 +41,25 @@
 public interface Envelope extends SOAPEnvelope {
     /**
      * Get the content as a JAXP Source.
+     *
+     * @return source
      */
     Source getContent();
 
     /**
      * Output the content.
+     *
+     * @param out output stream.
+     * @exception IOException in case of an I/O error.
      */
     void output(OutputStream out) throws IOException;
 
     /**
      * Output the content.
+     *
+     * @param out output stream
+     * @param isFastInfoset true if it is fast infoset.
+     * @exception IOException in case of an I/O error.
      */
     void output(OutputStream out, boolean isFastInfoset) throws IOException;
 
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -47,9 +47,10 @@
     }
 
     /**
-     * return the DataFlavors for this <code>DataContentHandler</code>
+     * Return the DataFlavors for this <code>DataContentHandler</code>
      * @return The DataFlavors.
      */
+    @Override
     public DataFlavor[] getTransferDataFlavors() { // throws Exception;
         DataFlavor flavors[] = new DataFlavor[1];
         flavors[0] = new ActivationDataFlavor(
@@ -59,11 +60,13 @@
     }
 
     /**
-     * return the Transfer Data of type DataFlavor from InputStream
-     * @param df The DataFlavor.
-     * @param ins The InputStream corresponding to the data.
+     * Return the Transfer Data of type DataFlavor from InputStream
+     * @param flavor The DataFlavor.
+     * @param dataSource DataSource.
      * @return The constructed Object.
+     * @exception IOException in case of an I/O error
      */
+    @Override
     public Object getTransferData(DataFlavor flavor, DataSource dataSource)
         throws IOException
     {
@@ -81,6 +84,7 @@
         return null;
     }
 
+    @Override
     public Object getContent(DataSource dataSource) throws IOException {
         try {
             return FastInfosetReflection.FastInfosetSource_new(
@@ -92,10 +96,11 @@
     }
 
     /**
-     * construct an object from a byte stream
+     * Construct an object from a byte stream
      * (similar semantically to previous method, we are deciding
      *  which one to support)
      */
+    @Override
     public void writeTo(Object obj, String mimeType, OutputStream os)
         throws IOException
     {
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -52,6 +52,7 @@
      *
      * @return The DataFlavors
      */
+    @Override
     public DataFlavor[] getTransferDataFlavors() { // throws Exception;
         return new DataFlavor[] { getDF()};
     }
@@ -60,9 +61,11 @@
      * Return the Transfer Data of type DataFlavor from InputStream.
      *
      * @param df The DataFlavor
-     * @param ins The InputStream corresponding to the data
+     * @param ds The DataSource
      * @return String object
+     * @exception IOException in case of an I/O error
      */
+    @Override
     public Object getTransferData(DataFlavor df, DataSource ds)
         throws IOException {
         // use myDF.equals to be sure to get ActivationDataFlavor.equals,
@@ -73,6 +76,7 @@
             return null;
     }
 
+    @Override
     public Object getContent(DataSource ds) throws IOException {
         InputStream is = ds.getInputStream();
         int pos = 0;
@@ -98,7 +102,11 @@
 
     /**
      * Write the object to the output stream, using the specified MIME type.
+     * @param obj object to write
+     * @param type requested MIME type of the resulting byte stream
+     * @param os OutputStream
      */
+    @Override
     public void writeTo(Object obj, String type, OutputStream os)
                         throws IOException {
         if (obj != null && !(obj instanceof Image))
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -67,8 +67,9 @@
      *
      * @return The DataFlavors.
      */
+    @Override
     public DataFlavor[] getTransferDataFlavors() {
-        return (DataFlavor[]) Arrays.copyOf(flavor, flavor.length);
+        return Arrays.copyOf(flavor, flavor.length);
     }
 
     /**
@@ -80,6 +81,7 @@
      * @param ds The DataSource representing the data to be converted.
      * @return The constructed Object.
      */
+    @Override
     public Object getTransferData(DataFlavor df, DataSource ds)
         throws IOException {
         for (int i=0; i < flavor.length; i++) {
@@ -98,6 +100,7 @@
      * @param ds The DataSource representing the data to be converted.
      * @return The constructed Object.
      */
+    @Override
     public Object getContent(DataSource ds) throws IOException {
         return ImageIO.read(new BufferedInputStream(ds.getInputStream()));
     }
@@ -107,11 +110,11 @@
      * and write it to the output stream.
      *
      * @param obj   The object to be converted.
-     * @param mimeType  The requested MIME type of the resulting byte stream.
+     * @param type  The requested MIME type of the resulting byte stream.
      * @param os    The output stream into which to write the converted
      *          byte stream.
      */
-
+    @Override
     public void writeTo(Object obj, String type, OutputStream os)
         throws IOException {
 
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -47,9 +47,10 @@
     public static final String STR_SRC = "java.awt.Image";
 
     /**
-     * return the DataFlavors for this <code>DataContentHandler</code>
+     * Return the DataFlavors for this <code>DataContentHandler</code>
      * @return The DataFlavors.
      */
+    @Override
     public DataFlavor[] getTransferDataFlavors() { // throws Exception;
         DataFlavor flavors[] = new DataFlavor[1];
 
@@ -67,11 +68,12 @@
     }
 
     /**
-     * return the Transfer Data of type DataFlavor from InputStream
-     * @param df The DataFlavor.
-     * @param ins The InputStream corresponding to the data.
+     * Return the Transfer Data of type DataFlavor from InputStream
+     * @param df The DataFlavor
+     * @param ds The DataSource
      * @return The constructed Object.
      */
+    @Override
     public Object getTransferData(DataFlavor df, DataSource ds) {
 
         // this is sort of hacky, but will work for the
@@ -98,6 +100,7 @@
     /**
      *
      */
+    @Override
     public Object getContent(DataSource ds) { // throws Exception;
         InputStream inputStream = null;
         BufferedImage jpegLoadImage = null;
@@ -109,14 +112,18 @@
         } catch (Exception e) {
         }
 
-        return (Image) jpegLoadImage;
+        return jpegLoadImage;
     }
 
     /**
-     * construct an object from a byte stream
+     * Construct an object from a byte stream
      * (similar semantically to previous method, we are deciding
      *  which one to support)
+     * @param obj object to write
+     * @param mimeType requested MIME type of the resulting byte stream
+     * @param os OutputStream
      */
+    @Override
     public void writeTo(Object obj, String mimeType, OutputStream os)
         throws IOException {
         if (!mimeType.equals("image/jpeg"))
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LazyEnvelope.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LazyEnvelope.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, 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
@@ -38,24 +38,24 @@
 
     /**
      * Retrieve payload qname without materializing its contents
-     * @return
-     * @throws SOAPException
+     * @return QName
+     * @throws SOAPException in case of an error
      */
     public QName getPayloadQName() throws SOAPException;
 
     /**
      * Retrieve payload attribute value without materializing its contents
-     * @param localName
-     * @return
-     * @throws SOAPException
+     * @param localName local name
+     * @return payload attribute value
+     * @throws SOAPException in case of an error
      */
     public String getPayloadAttributeValue(String localName) throws SOAPException;
 
     /**
      * Retrieve payload attribute value without materializing its contents
-     * @param qName
-     * @return
-     * @throws SOAPException
+     * @param qName QName
+     * @return payload attribute value
+     * @throws SOAPException in case of an error
      */
     public String getPayloadAttributeValue(QName qName) throws SOAPException;
 }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -95,7 +95,7 @@
 
     /**
      * True if this part is encoded using Fast Infoset.
-     * MIME -> application/fastinfoset
+     * MIME -&gt; application/fastinfoset
      */
     protected boolean isFastInfoset = false;
 
@@ -202,6 +202,9 @@
     /**
       * Construct a new message. This will be invoked before message
       * sends.
+      *
+      * @param isFastInfoset whether it is fast infoset
+      * @param acceptFastInfoset whether to accept fast infoset
       */
     protected MessageImpl(boolean isFastInfoset, boolean acceptFastInfoset) {
         this.isFastInfoset = isFastInfoset;
@@ -214,6 +217,8 @@
 
     /**
      * Shallow copy.
+     *
+     * @param msg SoapMessage
      */
     protected MessageImpl(SOAPMessage msg) {
         if (!(msg instanceof MessageImpl)) {
@@ -233,14 +238,17 @@
     /**
      * @param stat
      *      the mask value obtained from {@link #identifyContentType(ContentType)}
+     * @return true if SOAP 1.1 Content
      */
     protected static boolean isSoap1_1Content(int stat) {
         return (stat & SOAP1_1_FLAG) != 0;
     }
 
     /**
+     * Check whether it is SOAP 1.2 content.
      * @param stat
      *      the mask value obtained from {@link #identifyContentType(ContentType)}
+     * @return true if it is SOAP 1.2 content
      */
     protected static boolean isSoap1_2Content(int stat) {
         return (stat & SOAP1_2_FLAG) != 0;
@@ -298,6 +306,9 @@
      * Construct a message from an input stream. When messages are
      * received, there's two parts -- the transport headers and the
      * message content in a transport specific stream.
+     * @param headers MimeHeaders
+     * @param in InputStream
+     * @exception SOAPExceptionImpl in case of I/O error
      */
     protected MessageImpl(MimeHeaders headers, final InputStream in)
         throws SOAPExceptionImpl {
@@ -332,6 +343,7 @@
      * received, there's two parts -- the transport headers and the
      * message content in a transport specific stream.
      *
+     * @param headers headers
      * @param contentType
      *      The parsed content type header from the headers variable.
      *      This is redundant parameter, but it avoids reparsing this header again.
@@ -339,6 +351,8 @@
      *      The result of {@link #identifyContentType(ContentType)} over
      *      the contentType parameter. This redundant parameter, but it avoids
      *      recomputing this information again.
+     * @param in input stream
+     * @exception SOAPExceptionImpl in case of an error
      */
     protected MessageImpl(MimeHeaders headers, final ContentType contentType, int stat, final InputStream in) throws SOAPExceptionImpl {
         init(headers, stat, contentType, in);
@@ -425,18 +439,22 @@
             } else if ((stat & MIME_MULTIPART_FLAG) != 0) {
                 final InputStream finalIn = in;
                 DataSource ds = new DataSource() {
+                    @Override
                     public InputStream getInputStream() {
                         return finalIn;
                     }
 
+                    @Override
                     public OutputStream getOutputStream() {
                         return null;
                     }
 
+                    @Override
                     public String getContentType() {
                         return contentType.toString();
                     }
 
+                    @Override
                     public String getName() {
                         return "";
                     }
@@ -591,10 +609,12 @@
             return Boolean.valueOf(lazyParsingProp.toString());
         }
     }
+    @Override
     public Object getProperty(String property) {
-        return (String) properties.get(property);
+        return properties.get(property);
     }
 
+    @Override
     public void setProperty(String property, Object value) {
         verify(property, value);
         properties.put(property, value);
@@ -722,6 +742,7 @@
             return "text/xml";
     }
 
+    @Override
     public MimeHeaders getMimeHeaders() {
         return this.headers;
     }
@@ -805,10 +826,12 @@
         saved = false;
     }
 
+    @Override
     public  boolean saveRequired() {
         return saved != true;
     }
 
+    @Override
     public String getContentDescription() {
         String[] values = headers.getHeader("Content-Description");
         if (values != null && values.length > 0)
@@ -816,13 +839,16 @@
         return null;
     }
 
+    @Override
     public void setContentDescription(String description) {
         headers.setHeader("Content-Description", description);
         needsSave();
     }
 
+    @Override
     public abstract SOAPPart getSOAPPart();
 
+    @Override
     public void removeAllAttachments() {
         try {
             initializeAllAttachments();
@@ -836,6 +862,7 @@
         }
     }
 
+    @Override
     public int countAttachments() {
         try {
             initializeAllAttachments();
@@ -847,6 +874,7 @@
         return 0;
     }
 
+    @Override
     public void addAttachmentPart(AttachmentPart attachment) {
         try {
             initializeAllAttachments();
@@ -864,6 +892,7 @@
 
     static private final Iterator nullIter = Collections.EMPTY_LIST.iterator();
 
+    @Override
     public Iterator getAttachments() {
         try {
             initializeAllAttachments();
@@ -897,12 +926,14 @@
         private MimeHeaders headers;
         private AttachmentPart nextAttachment;
 
+        @Override
         public boolean hasNext() {
             if (nextAttachment == null)
                 nextAttachment = nextMatch();
             return nextAttachment != null;
         }
 
+        @Override
         public AttachmentPart next() {
             if (nextAttachment != null) {
                 AttachmentPart ret = nextAttachment;
@@ -925,11 +956,13 @@
             return null;
         }
 
+        @Override
         public void remove() {
             iter.remove();
         }
     }
 
+    @Override
     public Iterator getAttachments(MimeHeaders headers) {
         try {
             initializeAllAttachments();
@@ -942,6 +975,7 @@
         return new MimeMatchingIterator(headers);
     }
 
+    @Override
     public void removeAttachments(MimeHeaders headers) {
         try {
             initializeAllAttachments();
@@ -966,10 +1000,12 @@
        // needsSave();
     }
 
+    @Override
     public AttachmentPart createAttachmentPart() {
         return new AttachmentPartImpl();
     }
 
+    @Override
     public  AttachmentPart getAttachment(SOAPElement element)
         throws SOAPException {
         try {
@@ -1187,6 +1223,7 @@
         }
     }
 
+    @Override
     public void saveChanges() throws SOAPException {
 
         // suck in all the data from the attachments and have it
@@ -1340,6 +1377,7 @@
 
     }
 
+    @Override
     public void writeTo(OutputStream out) throws SOAPException, IOException {
         if (saveRequired()){
             this.optimizeAttachmentProcessing = true;
@@ -1397,6 +1435,7 @@
         needsSave();
     }
 
+    @Override
     public SOAPBody getSOAPBody() throws SOAPException {
         SOAPBody body = getSOAPPart().getEnvelope().getBody();
         /*if (body == null) {
@@ -1405,6 +1444,7 @@
         return body;
     }
 
+    @Override
     public SOAPHeader getSOAPHeader() throws SOAPException {
         SOAPHeader hdr = getSOAPPart().getEnvelope().getHeader();
         /*if (hdr == null) {
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -43,6 +43,7 @@
      *
      * @return The DataFlavors
      */
+    @Override
     public DataFlavor[] getTransferDataFlavors() { // throws Exception;
         return new DataFlavor[] { myDF };
     }
@@ -51,9 +52,10 @@
      * Return the Transfer Data of type DataFlavor from InputStream.
      *
      * @param df The DataFlavor
-     * @param ins The InputStream corresponding to the data
+     * @param ds The DataSource
      * @return String object
      */
+    @Override
     public Object getTransferData(DataFlavor df, DataSource ds) {
         // use myDF.equals to be sure to get ActivationDataFlavor.equals,
         // which properly ignores Content-Type parameters in comparison
@@ -65,7 +67,11 @@
 
     /**
      * Return the content.
+     *
+     * @param ds The DataSource
+     * @return content
      */
+    @Override
     public Object getContent(DataSource ds) {
         try {
             return new MimeMultipart(
@@ -78,6 +84,7 @@
     /**
      * Write the object to the output stream, using the specific MIME type.
      */
+    @Override
     public void writeTo(Object obj, String mimeType, OutputStream os)
                         throws IOException {
         if (obj instanceof MimeMultipart) {
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java	Fri Feb 10 00:39:51 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 1997, 2013, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
-*
-* @author SAAJ RI Development Team
-*/
-package com.sun.xml.internal.messaging.saaj.soap;
-
-import com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl;
-import com.sun.org.apache.xerces.internal.dom.DocumentFragmentImpl;
-
-public class SOAPDocumentFragment extends DocumentFragmentImpl {
-
-    public SOAPDocumentFragment(CoreDocumentImpl ownerDoc) {
-        super(ownerDoc);
-    }
-
-    public SOAPDocumentFragment() {
-        super();
-    }
-
-}
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -29,16 +29,42 @@
 */
 package com.sun.xml.internal.messaging.saaj.soap;
 
+import com.sun.xml.internal.messaging.saaj.soap.impl.CDATAImpl;
+import com.sun.xml.internal.messaging.saaj.soap.impl.ElementFactory;
+import com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl;
+import com.sun.xml.internal.messaging.saaj.soap.impl.SOAPCommentImpl;
+import com.sun.xml.internal.messaging.saaj.soap.impl.SOAPTextImpl;
+import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
+import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;
+import org.w3c.dom.Attr;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.Comment;
+import org.w3c.dom.DOMConfiguration;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.Element;
+import org.w3c.dom.EntityReference;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.ProcessingInstruction;
+import org.w3c.dom.UserDataHandler;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.logging.Logger;
 
-import com.sun.org.apache.xerces.internal.dom.DocumentImpl;
-import org.w3c.dom.*;
-
-import com.sun.xml.internal.messaging.saaj.soap.impl.*;
-import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
-import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
-
-public class SOAPDocumentImpl extends DocumentImpl implements SOAPDocument {
+public class SOAPDocumentImpl implements SOAPDocument, javax.xml.soap.Node, Document {
 
     private static final String XMLNS = "xmlns".intern();
     protected static final Logger log =
@@ -47,8 +73,24 @@
 
     SOAPPartImpl enclosingSOAPPart;
 
+    private Document document;
+
+    private Map<Node, javax.xml.soap.Node> domToSoap = new HashMap<>();
+
     public SOAPDocumentImpl(SOAPPartImpl enclosingDocument) {
+        document = createDocument();
         this.enclosingSOAPPart = enclosingDocument;
+        register(this);
+    }
+
+    private Document createDocument() {
+        DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance("com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl", SAAJUtil.getSystemClassLoader());
+        try {
+            final DocumentBuilder documentBuilder = docFactory.newDocumentBuilder();
+            return documentBuilder.newDocument();
+        } catch (ParserConfigurationException e) {
+            throw new RuntimeException("Error creating xml document", e);
+        }
     }
 
     //    public SOAPDocumentImpl(boolean grammarAccess) {
@@ -81,7 +123,7 @@
     }
 
     public DOMImplementation getImplementation() {
-        return super.getImplementation();
+        return document.getImplementation();
     }
 
     public Element getDocumentElement() {
@@ -91,7 +133,7 @@
     }
 
     protected Element doGetDocumentElement() {
-        return super.getDocumentElement();
+        return document.getDocumentElement();
     }
 
     public Element createElement(String tagName) throws DOMException {
@@ -103,7 +145,7 @@
     }
 
     public DocumentFragment createDocumentFragment() {
-        return new SOAPDocumentFragment(this);
+        return document.createDocumentFragment();
     }
 
     public org.w3c.dom.Text createTextNode(String data) {
@@ -139,7 +181,7 @@
             }
         }
 
-        return super.createAttribute(name);
+        return document.createAttribute(name);
     }
 
     public EntityReference createEntityReference(String name)
@@ -149,12 +191,15 @@
     }
 
     public NodeList getElementsByTagName(String tagname) {
-        return super.getElementsByTagName(tagname);
+        return document.getElementsByTagName(tagname);
     }
 
     public org.w3c.dom.Node importNode(Node importedNode, boolean deep)
         throws DOMException {
-        return super.importNode(importedNode, deep);
+        final Node node = document.importNode(getDomNode(importedNode), deep);
+        return node instanceof Element ?
+            ElementFactory.createElement(this, (Element) node)
+                : node;
     }
 
     public Element createElementNS(String namespaceURI, String qualifiedName)
@@ -168,26 +213,386 @@
 
     public Attr createAttributeNS(String namespaceURI, String qualifiedName)
         throws DOMException {
-        return super.createAttributeNS(namespaceURI, qualifiedName);
+        return document.createAttributeNS(namespaceURI, qualifiedName);
     }
 
     public NodeList getElementsByTagNameNS(
         String namespaceURI,
         String localName) {
-        return super.getElementsByTagNameNS(namespaceURI, localName);
+        return document.getElementsByTagNameNS(namespaceURI, localName);
     }
 
     public Element getElementById(String elementId) {
-        return super.getElementById(elementId);
+        return document.getElementById(elementId);
     }
 
-    public Node cloneNode(boolean deep) {
-        SOAPPartImpl newSoapPart = getSOAPPart().doCloneNode();
-        super.cloneNode(newSoapPart.getDocument(), deep);
-        return newSoapPart;
+    @Override
+    public String getInputEncoding() {
+        return document.getInputEncoding();
     }
 
-    public void cloneNode(SOAPDocumentImpl newdoc, boolean deep) {
-        super.cloneNode(newdoc, deep);
+    @Override
+    public String getXmlEncoding() {
+        return document.getXmlEncoding();
+    }
+
+    @Override
+    public boolean getXmlStandalone() {
+        return document.getXmlStandalone();
+    }
+
+    @Override
+    public void setXmlStandalone(boolean xmlStandalone) throws DOMException {
+        document.setXmlStandalone(xmlStandalone);
+    }
+
+    @Override
+    public String getXmlVersion() {
+        return document.getXmlVersion();
+    }
+
+    @Override
+    public void setXmlVersion(String xmlVersion) throws DOMException {
+        document.setXmlVersion(xmlVersion);
+    }
+
+    @Override
+    public boolean getStrictErrorChecking() {
+        return document.getStrictErrorChecking();
+    }
+
+    @Override
+    public void setStrictErrorChecking(boolean strictErrorChecking) {
+        document.setStrictErrorChecking(strictErrorChecking);
+    }
+
+    @Override
+    public String getDocumentURI() {
+        return document.getDocumentURI();
+    }
+
+    @Override
+    public void setDocumentURI(String documentURI) {
+        document.setDocumentURI(documentURI);
+    }
+
+    @Override
+    public Node adoptNode(Node source) throws DOMException {
+        return document.adoptNode(source);
+    }
+
+    @Override
+    public DOMConfiguration getDomConfig() {
+        return document.getDomConfig();
+    }
+
+    @Override
+    public void normalizeDocument() {
+        document.normalizeDocument();
+    }
+
+    @Override
+    public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException {
+        return document.renameNode(n, namespaceURI, qualifiedName);
+    }
+
+    @Override
+    public String getNodeName() {
+        return document.getNodeName();
+    }
+
+    @Override
+    public String getNodeValue() throws DOMException {
+        return document.getNodeValue();
+    }
+
+    @Override
+    public void setNodeValue(String nodeValue) throws DOMException {
+        document.setNodeValue(nodeValue);
+    }
+
+    @Override
+    public short getNodeType() {
+        return document.getNodeType();
+    }
+
+    @Override
+    public Node getParentNode() {
+        return document.getParentNode();
+    }
+
+    @Override
+    public NodeList getChildNodes() {
+        return document.getChildNodes();
+    }
+
+    @Override
+    public Node getFirstChild() {
+        return document.getFirstChild();
+    }
+
+    @Override
+    public Node getLastChild() {
+        return document.getLastChild();
+    }
+
+    @Override
+    public Node getPreviousSibling() {
+        return document.getPreviousSibling();
+    }
+
+    @Override
+    public Node getNextSibling() {
+        return document.getNextSibling();
+    }
+
+    @Override
+    public NamedNodeMap getAttributes() {
+        return document.getAttributes();
+    }
+
+    @Override
+    public Document getOwnerDocument() {
+        return document.getOwnerDocument();
+    }
+
+    @Override
+    public Node insertBefore(Node newChild, Node refChild) throws DOMException {
+        return document.insertBefore(getDomNode(newChild), getDomNode(refChild));
+    }
+
+    @Override
+    public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
+        return document.replaceChild(getDomNode(newChild), getDomNode(oldChild));
+    }
+
+    @Override
+    public Node removeChild(Node oldChild) throws DOMException {
+        return document.removeChild(getDomNode(oldChild));
+    }
+
+    @Override
+    public Node appendChild(Node newChild) throws DOMException {
+        return document.appendChild(getDomNode(newChild));
+    }
+
+    @Override
+    public boolean hasChildNodes() {
+        return document.hasChildNodes();
+    }
+
+    @Override
+    public Node cloneNode(boolean deep) {
+        return document.cloneNode(deep);
+    }
+
+    @Override
+    public void normalize() {
+        document.normalize();
+    }
+
+    @Override
+    public boolean isSupported(String feature, String version) {
+        return document.isSupported(feature, version);
+    }
+
+    @Override
+    public String getNamespaceURI() {
+        return document.getNamespaceURI();
+    }
+
+    @Override
+    public String getPrefix() {
+        return document.getPrefix();
+    }
+
+    @Override
+    public void setPrefix(String prefix) throws DOMException {
+        document.setPrefix(prefix);
+    }
+
+    @Override
+    public String getLocalName() {
+        return document.getLocalName();
+    }
+
+    @Override
+    public boolean hasAttributes() {
+        return document.hasAttributes();
+    }
+
+    @Override
+    public String getBaseURI() {
+        return document.getBaseURI();
+    }
+
+    @Override
+    public short compareDocumentPosition(Node other) throws DOMException {
+        return document.compareDocumentPosition(other);
+    }
+
+    @Override
+    public String getTextContent() throws DOMException {
+        return document.getTextContent();
+    }
+
+    @Override
+    public void setTextContent(String textContent) throws DOMException {
+        document.setTextContent(textContent);
+    }
+
+    @Override
+    public boolean isSameNode(Node other) {
+        return document.isSameNode(other);
+    }
+
+    @Override
+    public String lookupPrefix(String namespaceURI) {
+        return document.lookupPrefix(namespaceURI);
+    }
+
+    @Override
+    public boolean isDefaultNamespace(String namespaceURI) {
+        return document.isDefaultNamespace(namespaceURI);
+    }
+
+    @Override
+    public String lookupNamespaceURI(String prefix) {
+        return document.lookupNamespaceURI(prefix);
+    }
+
+    @Override
+    public boolean isEqualNode(Node arg) {
+        return document.isEqualNode(arg);
+    }
+
+    @Override
+    public Object getFeature(String feature, String version) {
+        return document.getFeature(feature, version);
+    }
+
+    @Override
+    public Object setUserData(String key, Object data, UserDataHandler handler) {
+        return document.setUserData(key, data, handler);
+    }
+
+    @Override
+    public Object getUserData(String key) {
+        return document.getUserData(key);
+    }
+
+    public Document getDomDocument() {
+        return document;
+    }
+
+    /**
+     * Insert a mapping information for {@link org.w3c.dom.Node} - {@link javax.xml.soap.Node}.
+     *
+     * In SAAJ, elements in DOM are expected to be interfaces of SAAJ, on the other hand in JDKs Xerces,
+     * they are casted to internal impl classes. After removal of SAAJ dependency
+     * to JDKs internal classes elements in DOM can never be both of them.
+     *
+     * @param node SAAJ wrapper node for w3c DOM node
+     */
+    public void register(javax.xml.soap.Node node) {
+        final Node domElement = getDomNode(node);
+        if (domToSoap.containsKey(domElement)) {
+            throw new IllegalStateException("Element " + domElement.getNodeName()
+                    + " is already registered");
+        }
+        domToSoap.put(domElement, node);
+    }
+
+    /**
+     * Find a soap wrapper for w3c dom node.
+     *
+     * @param node w3c dom node nullable
+     * @return soap wrapper for w3c dom node
+     *
+     * @throws
+     */
+    public javax.xml.soap.Node find(Node node) {
+        return find(node, true);
+    }
+
+    private javax.xml.soap.Node find(Node node, boolean required) {
+        if (node == null) {
+            return null;
+        }
+        if (node instanceof javax.xml.soap.Node) {
+            return (javax.xml.soap.Node) node;
+        }
+        final javax.xml.soap.Node found = domToSoap.get(node);
+        if (found == null && required) {
+            throw new IllegalArgumentException(MessageFormat.format("Cannot find SOAP wrapper for element {0}", node));
+        }
+        return found;
+    }
+
+    /**
+     * If corresponding soap wrapper exists for w3c dom node it is returned,
+     * if not passed dom element is returned.
+     *
+     * @param node w3c dom node
+     * @return soap wrapper or passed w3c dom node if not found
+     */
+    public Node findIfPresent(Node node) {
+        final javax.xml.soap.Node found = find(node, false);
+        return found != null ? found : node;
+    }
+
+    /**
+     * Extracts w3c dom node from corresponding soap wrapper.
+     *
+     * @param node soap or dom nullable
+     * @return dom node
+     */
+    public Node getDomNode(Node node) {
+        if (node instanceof SOAPDocumentImpl) {
+            return ((SOAPDocumentImpl)node).getDomElement();
+        } else if (node instanceof ElementImpl) {
+            return ((ElementImpl) node).getDomElement();
+        } else if (node instanceof SOAPTextImpl) {
+            return ((SOAPTextImpl)node).getDomElement();
+        } else if (node instanceof SOAPCommentImpl) {
+            return ((SOAPCommentImpl)node).getDomElement();
+        } else if (node instanceof CDATAImpl) {
+            return ((CDATAImpl) node).getDomElement();
+        }
+        return node;
+    }
+
+    public Document getDomElement() {
+        return document;
+    }
+
+    @Override
+    public String getValue() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void setValue(String value) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void setParentElement(SOAPElement parent) throws SOAPException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public SOAPElement getParentElement() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void detachNode() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void recycleNode() {
+        throw new UnsupportedOperationException();
     }
 }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -25,29 +25,56 @@
 
 package com.sun.xml.internal.messaging.saaj.soap;
 
-import java.io.*;
-import java.util.Iterator;
-import java.util.logging.Logger;
-import java.util.logging.Level;
+import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
+import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeBodyPart;
+import com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl;
+import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl;
+import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
+import com.sun.xml.internal.messaging.saaj.util.ByteInputStream;
+import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
+import com.sun.xml.internal.messaging.saaj.util.FastInfosetReflection;
+import com.sun.xml.internal.messaging.saaj.util.JAXMStreamSource;
+import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+import com.sun.xml.internal.messaging.saaj.util.MimeHeadersUtil;
+import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;
+import com.sun.xml.internal.messaging.saaj.util.XMLDeclarationParser;
+import org.w3c.dom.Attr;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.Comment;
+import org.w3c.dom.DOMConfiguration;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.Element;
+import org.w3c.dom.EntityReference;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.ProcessingInstruction;
+import org.w3c.dom.UserDataHandler;
 
 import javax.activation.DataHandler;
 import javax.activation.DataSource;
-import javax.xml.soap.*;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPPart;
 import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-
-import org.w3c.dom.*;
-
-import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeBodyPart;
-
-import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
-import com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl;
-import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl;
-import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
-import com.sun.xml.internal.messaging.saaj.util.*;
-
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamSource;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.PushbackReader;
+import java.io.Reader;
+import java.io.UnsupportedEncodingException;
+import java.util.Iterator;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
  * SOAPPartImpl is the first attachment. This contains the XML/SOAP document.
@@ -128,20 +155,21 @@
             envelope = createEnvelopeFromSource();
         } else {
             envelope = createEmptyEnvelope(null);
-            document.insertBefore(envelope, null);
+            document.insertBefore(((EnvelopeImpl) envelope).getDomElement(), null);
         }
         return envelope;
     }
 
     protected void lookForEnvelope() throws SOAPException {
         Element envelopeChildElement = document.doGetDocumentElement();
-        if (envelopeChildElement == null || envelopeChildElement instanceof Envelope) {
-            envelope = (EnvelopeImpl) envelopeChildElement;
-        } else if (!(envelopeChildElement instanceof ElementImpl)) {
+        org.w3c.dom.Node soapEnvelope = document.findIfPresent(envelopeChildElement);
+        if (soapEnvelope == null || soapEnvelope instanceof Envelope) {
+            envelope = (EnvelopeImpl) soapEnvelope;
+        } else if (document.find(envelopeChildElement) == null) {
             log.severe("SAAJ0512.soap.incorrect.factory.used");
             throw new SOAPExceptionImpl("Unable to create envelope: incorrect factory used during tree construction");
         } else {
-            ElementImpl soapElement = (ElementImpl) envelopeChildElement;
+            ElementImpl soapElement = (ElementImpl) document.find(envelopeChildElement);
             if (soapElement.getLocalName().equalsIgnoreCase("Envelope")) {
                 String prefix = soapElement.getPrefix();
                 String uri = (prefix == null) ? soapElement.getNamespaceURI() : soapElement.getNamespaceURI(prefix);
@@ -498,7 +526,7 @@
     }
 
     public NamedNodeMap getAttributes() {
-        return document.getAttributes();
+        return document.getDomDocument().getAttributes();
     }
 
     public NodeList getChildNodes() {
@@ -517,11 +545,11 @@
     }
 
     public String getLocalName() {
-        return document.getLocalName();
+        return document.getDomDocument().getLocalName();
     }
 
     public String getNamespaceURI() {
-        return document.getNamespaceURI();
+        return document.getDomDocument().getNamespaceURI();
     }
 
     public org.w3c.dom.Node getNextSibling() {
@@ -530,11 +558,11 @@
     }
 
     public String getNodeName() {
-        return document.getNodeName();
+        return document.getDomDocument().getNodeName();
     }
 
     public short getNodeType() {
-        return document.getNodeType();
+        return document.getDomDocument().getNodeType();
     }
 
     public String getNodeValue() throws DOMException {
@@ -542,23 +570,23 @@
     }
 
     public Document getOwnerDocument() {
-        return document.getOwnerDocument();
+        return document.getDomDocument().getOwnerDocument();
     }
 
     public org.w3c.dom.Node getParentNode() {
-        return document.getParentNode();
+        return document.getDomDocument().getParentNode();
     }
 
     public String getPrefix() {
-        return document.getPrefix();
+        return document.getDomDocument().getPrefix();
     }
 
     public org.w3c.dom.Node getPreviousSibling() {
-        return document.getPreviousSibling();
+        return document.getDomDocument().getPreviousSibling();
     }
 
     public boolean hasAttributes() {
-        return document.hasAttributes();
+        return document.getDomDocument().hasAttributes();
     }
 
     public boolean hasChildNodes() {
@@ -575,7 +603,7 @@
     }
 
     public boolean isSupported(String arg0, String arg1) {
-        return document.isSupported(arg0, arg1);
+        return document.getDomDocument().isSupported(arg0, arg1);
     }
 
     public void normalize() {
@@ -686,7 +714,7 @@
     }
 
     public DOMConfiguration getDomConfig() {
-        return document.getDomConfig();
+        return document.getDomDocument().getDomConfig();
     }
 
     public org.w3c.dom.Node adoptNode(org.w3c.dom.Node source) throws DOMException {
@@ -699,7 +727,7 @@
     }
 
     public String getDocumentURI() {
-        return document.getDocumentURI();
+        return document.getDomDocument().getDocumentURI();
     }
 
     public void  setStrictErrorChecking(boolean strictErrorChecking) {
@@ -707,15 +735,15 @@
     }
 
     public String getInputEncoding() {
-        return document.getInputEncoding();
+        return document.getDomDocument().getInputEncoding();
     }
 
     public String getXmlEncoding() {
-        return document.getXmlEncoding();
+        return document.getDomDocument().getXmlEncoding();
     }
 
     public boolean getXmlStandalone() {
-        return document.getXmlStandalone();
+        return document.getDomDocument().getXmlStandalone();
     }
 
     public void setXmlStandalone(boolean xmlStandalone) throws DOMException {
@@ -723,7 +751,7 @@
     }
 
     public String getXmlVersion() {
-        return document.getXmlVersion();
+        return document.getDomDocument().getXmlVersion();
     }
 
     public void setXmlVersion(String xmlVersion) throws DOMException {
@@ -731,12 +759,12 @@
     }
 
     public boolean  getStrictErrorChecking() {
-        return document.getStrictErrorChecking();
+        return document.getDomDocument().getStrictErrorChecking();
     }
 
     // DOM L3 methods from org.w3c.dom.Node
     public String getBaseURI() {
-        return document.getBaseURI();
+        return document.getDomDocument().getBaseURI();
     }
 
     public short compareDocumentPosition(org.w3c.dom.Node other)
@@ -758,7 +786,7 @@
     }
 
     public String lookupPrefix(String namespaceURI) {
-        return document.lookupPrefix(namespaceURI);
+        return document.getDomDocument().lookupPrefix(namespaceURI);
     }
 
     public boolean isDefaultNamespace(String namespaceURI) {
@@ -770,7 +798,7 @@
     }
 
     public boolean isEqualNode(org.w3c.dom.Node arg) {
-        return document.isEqualNode(arg);
+        return document.getDomDocument().isEqualNode(arg);
     }
 
     public Object getFeature(String feature,
@@ -785,7 +813,7 @@
     }
 
     public Object getUserData(String key) {
-        return document.getUserData(key);
+        return document.getDomDocument().getUserData(key);
     }
 
     public void recycleNode() {
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -63,6 +63,9 @@
     /**
      * Constructs a <code>SOAPExceptionImpl</code> object initialized
      * with the given <code>Throwable</code> object.
+     *
+     * @param cause a <code>Throwable</code> object that is to
+     *        be embedded in this <code>SOAPExceptionImpl</code> object
      */
     public SOAPVersionMismatchException(Throwable cause) {
         super(cause);
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -33,7 +33,7 @@
 import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ContentType;
 
 /**
- * JAF data content handler for text/plain --> String
+ * JAF data content handler for text/plain --&gt; String
  *
  */
 public class StringDataContentHandler implements DataContentHandler {
@@ -51,6 +51,7 @@
      *
      * @return The DataFlavors
      */
+    @Override
     public DataFlavor[] getTransferDataFlavors() {
         return new DataFlavor[] { getDF() };
     }
@@ -62,6 +63,7 @@
      * @param ds The DataSource corresponding to the data
      * @return String object
      */
+    @Override
     public Object getTransferData(DataFlavor df, DataSource ds)
                         throws IOException {
         // use myDF.equals to be sure to get ActivationDataFlavor.equals,
@@ -72,6 +74,7 @@
             return null;
     }
 
+    @Override
     public Object getContent(DataSource ds) throws IOException {
         String enc = null;
         InputStreamReader is = null;
@@ -120,6 +123,7 @@
     /**
      * Write the object to the output stream, using the specified MIME type.
      */
+    @Override
     public void writeTo(Object obj, String type, OutputStream os)
                         throws IOException {
         if (!(obj instanceof String))
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -56,6 +56,7 @@
      * return the DataFlavors for this <code>DataContentHandler</code>
      * @return The DataFlavors.
      */
+    @Override
     public DataFlavor[] getTransferDataFlavors() { // throws Exception;
         DataFlavor flavors[] = new DataFlavor[2];
 
@@ -69,10 +70,11 @@
 
     /**
      * return the Transfer Data of type DataFlavor from InputStream
-     * @param df The DataFlavor.
-     * @param ins The InputStream corresponding to the data.
+     * @param flavor The DataFlavor.
+     * @param dataSource The DataSource.
      * @return The constructed Object.
      */
+    @Override
     public Object getTransferData(DataFlavor flavor, DataSource dataSource)
         throws IOException {
         if (flavor.getMimeType().startsWith("text/xml") ||
@@ -87,6 +89,7 @@
     /**
      *
      */
+    @Override
     public Object getContent(DataSource dataSource) throws IOException {
         return new StreamSource(dataSource.getInputStream());
     }
@@ -96,6 +99,7 @@
      * (similar semantically to previous method, we are deciding
      *  which one to support)
      */
+    @Override
     public void writeTo(Object obj, String mimeType, OutputStream os)
         throws IOException {
         if (!mimeType.startsWith("text/xml") && !mimeType.startsWith("application/xml"))
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -36,6 +36,7 @@
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 
+import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;
 import org.w3c.dom.*;
 import org.w3c.dom.Node;
 
@@ -60,6 +61,10 @@
         super(ownerDoc, bodyName);
     }
 
+    public BodyImpl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected abstract NameImpl getFaultName(String name);
     protected abstract boolean isFault(SOAPElement child);
     protected abstract SOAPBodyElement createBodyElement(Name name);
@@ -155,7 +160,7 @@
         if (hasFault()) {
             if (fault == null) {
                 //initialize fault member
-                fault = (SOAPFault) getFirstChildElement();
+                fault = (SOAPFault) getSoapDocument().find(getFirstChildElement());
             }
             return fault;
         }
@@ -259,11 +264,12 @@
     }
 
     protected SOAPElement convertToSoapElement(Element element) {
-        if ((element instanceof SOAPBodyElement) &&
+        final Node soapNode = getSoapDocument().findIfPresent(element);
+        if ((soapNode instanceof SOAPBodyElement) &&
             //this check is required because ElementImpl currently
             // implements SOAPBodyElement
-            !(element.getClass().equals(ElementImpl.class))) {
-            return (SOAPElement) element;
+            !(soapNode.getClass().equals(ElementImpl.class))) {
+            return (SOAPElement) soapNode;
         } else {
             return replaceElementWithSOAPElement(
                 element,
@@ -314,7 +320,7 @@
 
         Document document = null;
         try {
-            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance("com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl", SAAJUtil.getSystemClassLoader());
             factory.setNamespaceAware(true);
             DocumentBuilder builder = factory.newDocumentBuilder();
             document = builder.newDocument();
@@ -440,7 +446,7 @@
             //not lazy -Just get first child element and return its attribute
             Element elem = getFirstChildElement();
             if (elem != null) {
-                return elem.getAttribute(localName);
+                return elem.getAttribute(getLocalName());
             }
         }
         return null;
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -32,10 +32,17 @@
 
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+import org.w3c.dom.UserDataHandler;
 
-public class CDATAImpl
-    extends com.sun.org.apache.xerces.internal.dom.CDATASectionImpl
-    implements javax.xml.soap.Text {
+public class CDATAImpl implements CDATASection, javax.xml.soap.Text {
 
     protected static final Logger log =
         Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN,
@@ -44,8 +51,256 @@
     static final String cdataUC = "<![CDATA[";
     static final String cdataLC = "<![cdata[";
 
+    @Override
+    public Text splitText(int offset) throws DOMException {
+        return cdataSection.splitText(offset);
+    }
+
+    @Override
+    public boolean isElementContentWhitespace() {
+        return cdataSection.isElementContentWhitespace();
+    }
+
+    @Override
+    public String getWholeText() {
+        return cdataSection.getWholeText();
+    }
+
+    @Override
+    public Text replaceWholeText(String content) throws DOMException {
+        return cdataSection.replaceWholeText(content);
+    }
+
+    @Override
+    public String getData() throws DOMException {
+        return cdataSection.getData();
+    }
+
+    @Override
+    public void setData(String data) throws DOMException {
+        cdataSection.setData(data);
+    }
+
+    @Override
+    public int getLength() {
+        return cdataSection.getLength();
+    }
+
+    @Override
+    public String substringData(int offset, int count) throws DOMException {
+        return cdataSection.substringData(offset, count);
+    }
+
+    @Override
+    public void appendData(String arg) throws DOMException {
+        cdataSection.appendData(arg);
+    }
+
+    @Override
+    public void insertData(int offset, String arg) throws DOMException {
+        cdataSection.insertData(offset, arg);
+    }
+
+    @Override
+    public void deleteData(int offset, int count) throws DOMException {
+        cdataSection.deleteData(offset, count);
+    }
+
+    @Override
+    public void replaceData(int offset, int count, String arg) throws DOMException {
+        cdataSection.replaceData(offset, count, arg);
+    }
+
+    @Override
+    public String getNodeName() {
+        return cdataSection.getNodeName();
+    }
+
+    @Override
+    public String getNodeValue() throws DOMException {
+        return cdataSection.getNodeValue();
+    }
+
+    @Override
+    public void setNodeValue(String nodeValue) throws DOMException {
+        cdataSection.setNodeValue(nodeValue);
+    }
+
+    @Override
+    public short getNodeType() {
+        return cdataSection.getNodeType();
+    }
+
+    @Override
+    public Node getParentNode() {
+        return cdataSection.getParentNode();
+    }
+
+    @Override
+    public NodeList getChildNodes() {
+        return cdataSection.getChildNodes();
+    }
+
+    @Override
+    public Node getFirstChild() {
+        return cdataSection.getFirstChild();
+    }
+
+    @Override
+    public Node getLastChild() {
+        return cdataSection.getLastChild();
+    }
+
+    @Override
+    public Node getPreviousSibling() {
+        return cdataSection.getPreviousSibling();
+    }
+
+    @Override
+    public Node getNextSibling() {
+        return cdataSection.getNextSibling();
+    }
+
+    @Override
+    public NamedNodeMap getAttributes() {
+        return cdataSection.getAttributes();
+    }
+
+    @Override
+    public Document getOwnerDocument() {
+        return cdataSection.getOwnerDocument();
+    }
+
+    @Override
+    public Node insertBefore(Node newChild, Node refChild) throws DOMException {
+        return cdataSection.insertBefore(newChild, refChild);
+    }
+
+    @Override
+    public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
+        return cdataSection.replaceChild(newChild, oldChild);
+    }
+
+    @Override
+    public Node removeChild(Node oldChild) throws DOMException {
+        return cdataSection.removeChild(oldChild);
+    }
+
+    @Override
+    public Node appendChild(Node newChild) throws DOMException {
+        return cdataSection.appendChild(newChild);
+    }
+
+    @Override
+    public boolean hasChildNodes() {
+        return cdataSection.hasChildNodes();
+    }
+
+    @Override
+    public Node cloneNode(boolean deep) {
+        return cdataSection.cloneNode(deep);
+    }
+
+    @Override
+    public void normalize() {
+        cdataSection.normalize();
+    }
+
+    @Override
+    public boolean isSupported(String feature, String version) {
+        return cdataSection.isSupported(feature, version);
+    }
+
+    @Override
+    public String getNamespaceURI() {
+        return cdataSection.getNamespaceURI();
+    }
+
+    @Override
+    public String getPrefix() {
+        return cdataSection.getPrefix();
+    }
+
+    @Override
+    public void setPrefix(String prefix) throws DOMException {
+        cdataSection.setPrefix(prefix);
+    }
+
+    @Override
+    public String getLocalName() {
+        return cdataSection.getLocalName();
+    }
+
+    @Override
+    public boolean hasAttributes() {
+        return cdataSection.hasAttributes();
+    }
+
+    @Override
+    public String getBaseURI() {
+        return cdataSection.getBaseURI();
+    }
+
+    @Override
+    public short compareDocumentPosition(Node other) throws DOMException {
+        return cdataSection.compareDocumentPosition(other);
+    }
+
+    @Override
+    public String getTextContent() throws DOMException {
+        return cdataSection.getTextContent();
+    }
+
+    @Override
+    public void setTextContent(String textContent) throws DOMException {
+        cdataSection.setTextContent(textContent);
+    }
+
+    @Override
+    public boolean isSameNode(Node other) {
+        return cdataSection.isSameNode(other);
+    }
+
+    @Override
+    public String lookupPrefix(String namespaceURI) {
+        return cdataSection.lookupPrefix(namespaceURI);
+    }
+
+    @Override
+    public boolean isDefaultNamespace(String namespaceURI) {
+        return cdataSection.isDefaultNamespace(namespaceURI);
+    }
+
+    @Override
+    public String lookupNamespaceURI(String prefix) {
+        return cdataSection.lookupNamespaceURI(prefix);
+    }
+
+    @Override
+    public boolean isEqualNode(Node arg) {
+        return cdataSection.isEqualNode(arg);
+    }
+
+    @Override
+    public Object getFeature(String feature, String version) {
+        return cdataSection.getFeature(feature, version);
+    }
+
+    @Override
+    public Object setUserData(String key, Object data, UserDataHandler handler) {
+        return cdataSection.setUserData(key, data, handler);
+    }
+
+    @Override
+    public Object getUserData(String key) {
+        return cdataSection.getUserData(key);
+    }
+
+    private CDATASection cdataSection;
+
     public CDATAImpl(SOAPDocumentImpl ownerDoc, String text) {
-        super(ownerDoc, text);
+        cdataSection = ownerDoc.getDomDocument().createCDATASection(text);
+        ownerDoc.register(this);
     }
 
     public String getValue() {
@@ -87,4 +342,8 @@
     public boolean isComment() {
         return false;
     }
+
+    public CDATASection getDomElement() {
+        return cdataSection;
+    }
 }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -31,6 +31,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.soap.*;
 
+import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;
 import org.w3c.dom.Element;
 
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
@@ -41,6 +42,10 @@
         super(ownerDoc, detailName);
     }
 
+    public DetailImpl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected abstract DetailEntry createDetailEntry(Name name);
     protected abstract DetailEntry createDetailEntry(QName name);
 
@@ -65,8 +70,9 @@
     }
 
     protected SOAPElement convertToSoapElement(Element element) {
-        if (element instanceof DetailEntry) {
-            return (SOAPElement) element;
+        final javax.xml.soap.Node soapNode = getSoapDocument().find(element);
+        if (soapNode instanceof DetailEntry) {
+            return (SOAPElement) soapNode;
         } else {
             DetailEntry detailEntry =
                 createDetailEntry(NameImpl.copyElementName(element));
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementFactory.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementFactory.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -30,8 +30,22 @@
 
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
-import com.sun.xml.internal.messaging.saaj.soap.ver1_1.*;
-import com.sun.xml.internal.messaging.saaj.soap.ver1_2.*;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_1.Body1_1Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_1.Detail1_1Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_1.Envelope1_1Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_1.Fault1_1Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_1.FaultElement1_1Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_1.Header1_1Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_2.Body1_2Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_2.Detail1_2Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_2.Envelope1_2Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_2.Fault1_2Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_2.Header1_2Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_2.SOAPPart1_2Impl;
+import org.w3c.dom.Element;
+
+import java.util.Objects;
 
 
 public class ElementFactory {
@@ -54,6 +68,72 @@
             name.getNamespaceURI());
     }
 
+    /**
+     * Create element wrapper for existing DOM element.
+     *
+     * @param ownerDocument SOAP document wrapper not null
+     * @param element DOM element not null
+     * @return SOAP wrapper for DOM element
+     */
+    public static SOAPElement createElement(SOAPDocumentImpl ownerDocument, Element element) {
+        Objects.requireNonNull(ownerDocument);
+        Objects.requireNonNull(element);
+
+        String localName = element.getLocalName();
+        String namespaceUri = element.getNamespaceURI();
+        String prefix = element.getPrefix();
+
+        if ("Envelope".equalsIgnoreCase(localName)) {
+            if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
+                return new Envelope1_1Impl(ownerDocument, element);
+            } else if (NameImpl.SOAP12_NAMESPACE.equals(namespaceUri)) {
+                return new Envelope1_2Impl(ownerDocument, element);
+            }
+        }
+        if ("Body".equalsIgnoreCase(localName)) {
+            if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
+                return new Body1_1Impl(ownerDocument, element);
+            } else if (NameImpl.SOAP12_NAMESPACE.equals(namespaceUri)) {
+                return new Body1_2Impl(ownerDocument, element);
+            }
+        }
+        if ("Header".equalsIgnoreCase(localName)) {
+            if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
+                return new Header1_1Impl(ownerDocument, element);
+            } else if (NameImpl.SOAP12_NAMESPACE.equals(namespaceUri)) {
+                return new Header1_2Impl(ownerDocument, element);
+            }
+        }
+        if ("Fault".equalsIgnoreCase(localName)) {
+            if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
+                return new Fault1_1Impl(element, ownerDocument);
+            } else if (NameImpl.SOAP12_NAMESPACE.equals(namespaceUri)) {
+                return new Fault1_2Impl(element, ownerDocument);
+            }
+
+        }
+        if ("Detail".equalsIgnoreCase(localName)) {
+            if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
+                return new Detail1_1Impl(ownerDocument, element);
+            } else if (NameImpl.SOAP12_NAMESPACE.equals(namespaceUri)) {
+                return new Detail1_2Impl(ownerDocument, element);
+            }
+        }
+        if ("faultcode".equalsIgnoreCase(localName)
+                || "faultstring".equalsIgnoreCase(localName)
+                || "faultactor".equalsIgnoreCase(localName)) {
+            // SOAP 1.2 does not have fault(code/string/actor)
+            // So there is no else case required
+            if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
+                return new FaultElement1_1Impl(ownerDocument,
+                        localName,
+                        prefix);
+            }
+        }
+
+        return new ElementImpl(ownerDocument, element);
+    }
+
     public static SOAPElement createElement(
         SOAPDocumentImpl ownerDocument,
         String localName,
@@ -92,28 +172,28 @@
             prefix = NameImpl.SOAP_ENVELOPE_PREFIX;
         }
 
-        if (localName.equalsIgnoreCase("Envelope")) {
+        if ("Envelope".equalsIgnoreCase(localName)) {
             if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
                 return new Envelope1_1Impl(ownerDocument, prefix);
             } else if (NameImpl.SOAP12_NAMESPACE.equals(namespaceUri)) {
                 return new Envelope1_2Impl(ownerDocument, prefix);
             }
         }
-        if (localName.equalsIgnoreCase("Body")) {
+        if ("Body".equalsIgnoreCase(localName)) {
             if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
                 return new Body1_1Impl(ownerDocument, prefix);
             } else if (NameImpl.SOAP12_NAMESPACE.equals(namespaceUri)) {
                 return new Body1_2Impl(ownerDocument, prefix);
             }
         }
-        if (localName.equalsIgnoreCase("Header")) {
+        if ("Header".equalsIgnoreCase(localName)) {
             if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
                 return new Header1_1Impl(ownerDocument, prefix);
             } else if (NameImpl.SOAP12_NAMESPACE.equals(namespaceUri)) {
                 return new Header1_2Impl(ownerDocument, prefix);
             }
         }
-        if (localName.equalsIgnoreCase("Fault")) {
+        if ("Fault".equalsIgnoreCase(localName)) {
             SOAPFault fault = null;
             if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
                 fault = new Fault1_1Impl(ownerDocument, prefix);
@@ -139,16 +219,16 @@
             }
 
         }
-        if (localName.equalsIgnoreCase("Detail")) {
+        if ("Detail".equalsIgnoreCase(localName)) {
             if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
                 return new Detail1_1Impl(ownerDocument, prefix);
             } else if (NameImpl.SOAP12_NAMESPACE.equals(namespaceUri)) {
                 return new Detail1_2Impl(ownerDocument, prefix);
             }
         }
-        if (localName.equalsIgnoreCase("faultcode")
-            || localName.equalsIgnoreCase("faultstring")
-            || localName.equalsIgnoreCase("faultactor")) {
+        if ("faultcode".equalsIgnoreCase(localName)
+                || "faultstring".equalsIgnoreCase(localName)
+                || "faultactor".equalsIgnoreCase(localName)) {
             // SOAP 1.2 does not have fault(code/string/actor)
             // So there is no else case required
             if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -43,9 +43,7 @@
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
 import com.sun.xml.internal.messaging.saaj.util.*;
 
-public class ElementImpl
-    extends com.sun.org.apache.xerces.internal.dom.ElementNSImpl
-    implements SOAPElement, SOAPBodyElement {
+public class ElementImpl implements SOAPElement, SOAPBodyElement {
 
     public static final String DSIG_NS = "http://www.w3.org/2000/09/xmldsig#".intern();
     public static final String XENC_NS = "http://www.w3.org/2001/04/xmlenc#".intern();
@@ -55,6 +53,69 @@
 
     protected QName elementQName;
 
+    private Element element;
+
+    private SOAPDocumentImpl soapDocument;
+
+    @Override
+    public String getTagName() {
+        return element.getTagName();
+    }
+
+    @Override
+    public String getAttribute(String name) {
+        return element.getAttribute(name);
+    }
+
+    @Override
+    public void setAttribute(String name, String value) throws DOMException {
+        boolean isQualifiedName = (name.indexOf(":") > 0);
+        //this is because of BugfixTest#testCR7020991, after removal internal dependencies
+        //SOAPDocumentImpl#createAttribute is not called anymore from xerces parent
+        if (isQualifiedName) {
+            String nsUri = null;
+            String prefix = name.substring(0, name.indexOf(":"));
+            //cannot do anything to resolve the URI if prefix is not
+            //XMLNS.
+            if (XMLNS.equals(prefix)) {
+                nsUri = ElementImpl.XMLNS_URI;
+                setAttributeNS(nsUri, name, value);
+                return;
+            }
+        }
+        element.setAttribute(name, value);
+    }
+
+    @Override
+    public void removeAttribute(String name) throws DOMException {
+        element.removeAttribute(name);
+    }
+
+    @Override
+    public Attr getAttributeNode(String name) {
+        return element.getAttributeNode(name);
+    }
+
+    @Override
+    public Attr setAttributeNode(Attr newAttr) throws DOMException {
+        return element.setAttributeNode(newAttr);
+    }
+
+    @Override
+    public Attr removeAttributeNode(Attr oldAttr) throws DOMException {
+        return element.removeAttributeNode(oldAttr);
+    }
+
+    @Override
+    public NodeList getElementsByTagName(String name) {
+        return new NodeListImpl(getSoapDocument(), element.getElementsByTagName(name));
+    }
+
+    @Override
+    public String getAttributeNS(String namespaceURI, String localName) throws DOMException {
+        return element.getAttributeNS(namespaceURI, localName);
+    }
+
     protected static final Logger log =
         Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN,
                          "com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings");
@@ -72,22 +133,27 @@
      */
     public final static String XML_URI = "http://www.w3.org/XML/1998/namespace".intern();
 
+    private final static String XMLNS = "xmlns".intern();
+
     public ElementImpl(SOAPDocumentImpl ownerDoc, Name name) {
-        super(
-            ownerDoc,
-            name.getURI(),
-            name.getQualifiedName(),
-            name.getLocalName());
+        this.soapDocument = ownerDoc;
+        this.element = ownerDoc.getDomDocument().createElementNS(name.getURI(), name.getQualifiedName());
         elementQName = NameImpl.convertToQName(name);
+        getSoapDocument().register(this);
     }
 
     public ElementImpl(SOAPDocumentImpl ownerDoc, QName name) {
-        super(
-            ownerDoc,
-            name.getNamespaceURI(),
-            getQualifiedName(name),
-            name.getLocalPart());
+        this.soapDocument = ownerDoc;
+        this.element = ownerDoc.getDomDocument().createElementNS(name.getNamespaceURI(), getQualifiedName(name));
         elementQName = name;
+        getSoapDocument().register(this);
+    }
+
+    public ElementImpl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        this.element = domElement;
+        this.soapDocument = ownerDoc;
+        this.elementQName = new QName(domElement.getNamespaceURI(), domElement.getLocalName());
+        getSoapDocument().register(this);
     }
 
     public ElementImpl(
@@ -95,9 +161,11 @@
         String uri,
         String qualifiedName) {
 
-        super(ownerDoc, uri, qualifiedName);
+        this.soapDocument = ownerDoc;
+        this.element = ownerDoc.getDomDocument().createElementNS(uri, qualifiedName);
         elementQName =
             new QName(uri, getLocalPart(qualifiedName), getPrefix(qualifiedName));
+        getSoapDocument().register(this);
     }
 
     public void ensureNamespaceIsDeclared(String prefix, String uri) {
@@ -111,11 +179,132 @@
     }
 
     public Document getOwnerDocument() {
-        Document doc = super.getOwnerDocument();
-        if (doc instanceof SOAPDocument)
-            return ((SOAPDocument) doc).getDocument();
-        else
-            return doc;
+        return soapDocument;
+    }
+
+    @Override
+    public Node insertBefore(Node newChild, Node refChild) throws DOMException {
+        return element.insertBefore(getSoapDocument().getDomNode(newChild), getSoapDocument().getDomNode(refChild));
+    }
+
+    @Override
+    public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
+        return element.replaceChild(getSoapDocument().getDomNode(newChild), getSoapDocument().getDomNode(oldChild));
+    }
+
+    @Override
+    public Node removeChild(Node oldChild) throws DOMException {
+        return element.removeChild(getSoapDocument().getDomNode(oldChild));
+    }
+
+    @Override
+    public Node appendChild(Node newChild) throws DOMException {
+        return element.appendChild(getSoapDocument().getDomNode(newChild));
+    }
+
+    @Override
+    public boolean hasChildNodes() {
+        return element.hasChildNodes();
+    }
+
+    @Override
+    public Node cloneNode(boolean deep) {
+        return element.cloneNode(deep);
+    }
+
+    @Override
+    public void normalize() {
+        element.normalize();
+    }
+
+    @Override
+    public boolean isSupported(String feature, String version) {
+        return element.isSupported(feature, version);
+    }
+
+    @Override
+    public String getNamespaceURI() {
+        return element.getNamespaceURI();
+    }
+
+    @Override
+    public String getPrefix() {
+        return element.getPrefix();
+    }
+
+    @Override
+    public void setPrefix(String prefix) throws DOMException {
+        element.setPrefix(prefix);
+    }
+
+    @Override
+    public String getLocalName() {
+        return element.getLocalName();
+    }
+
+    @Override
+    public boolean hasAttributes() {
+        return element.hasAttributes();
+    }
+
+    @Override
+    public String getBaseURI() {
+        return element.getBaseURI();
+    }
+
+    @Override
+    public short compareDocumentPosition(Node other) throws DOMException {
+        return element.compareDocumentPosition(other);
+    }
+
+    @Override
+    public String getTextContent() throws DOMException {
+        return element.getTextContent();
+    }
+
+    @Override
+    public void setTextContent(String textContent) throws DOMException {
+        element.setTextContent(textContent);
+    }
+
+    @Override
+    public boolean isSameNode(Node other) {
+        return element.isSameNode(other);
+    }
+
+    @Override
+    public String lookupPrefix(String namespaceURI) {
+        return element.lookupPrefix(namespaceURI);
+    }
+
+    @Override
+    public boolean isDefaultNamespace(String namespaceURI) {
+        return element.isDefaultNamespace(namespaceURI);
+    }
+
+    @Override
+    public String lookupNamespaceURI(String prefix) {
+        return element.lookupNamespaceURI(prefix);
+    }
+
+    @Override
+    public boolean isEqualNode(Node arg) {
+        return element.isEqualNode(arg);
+    }
+
+    @Override
+    public Object getFeature(String feature, String version) {
+        return element.getFeature(feature, version);
+    }
+
+    @Override
+    public Object setUserData(String key, Object data, UserDataHandler handler) {
+        return element.setUserData(key, data, handler);
+    }
+
+    @Override
+    public Object getUserData(String key) {
+        return element.getUserData(key);
     }
 
     public SOAPElement addChildElement(Name name) throws SOAPException {
@@ -353,13 +542,16 @@
         // preserve the encodingStyle attr as it may get lost in the import
         String encodingStyle = element.getEncodingStyle();
 
-        ElementImpl importedElement = (ElementImpl) importElement(element);
+        final Element domElement = ((ElementImpl) element).getDomElement();
+        final Element importedElement = importElement(domElement);
         addNode(importedElement);
 
+        final SOAPElement converted = convertToSoapElement(importedElement);
+
         if (encodingStyle != null)
-            importedElement.setEncodingStyle(encodingStyle);
+            converted.setEncodingStyle(encodingStyle);
 
-        return convertToSoapElement(importedElement);
+        return converted;
     }
 
     protected Element importElement(Element element) {
@@ -374,7 +566,7 @@
 
     protected SOAPElement addElement(Name name) throws SOAPException {
         SOAPElement newElement = createElement(name);
-        addNode(newElement);
+        addNode(((ElementImpl) newElement).getDomElement());
         return newElement;
     }
 
@@ -411,7 +603,7 @@
     }
 
     protected void addNode(org.w3c.dom.Node newElement) throws SOAPException {
-        insertBefore(newElement, null);
+        insertBefore(getSoapDocument().getDomNode(newElement), null);
 
         if (getOwnerDocument() instanceof DocumentFragment)
             return;
@@ -431,7 +623,7 @@
         Node child = getFirstChild();
         while (child != null) {
             if (child instanceof Element) {
-                return ((Element) child);
+                return (Element) getSoapDocument().find(child);
             }
             child = child.getNextSibling();
         }
@@ -441,10 +633,12 @@
     protected SOAPElement findChild(NameImpl name) {
         Node eachChild = getFirstChild();
         while (eachChild != null) {
-            if (eachChild instanceof SOAPElement) {
-                SOAPElement eachChildSoap = (SOAPElement) eachChild;
-                if (eachChildSoap.getElementName().equals(name)) {
-                    return eachChildSoap;
+            if (eachChild instanceof Element) {
+                SOAPElement eachChildSoap = (SOAPElement) getSoapDocument().find(eachChild);
+                if (eachChildSoap != null) {
+                    if (eachChildSoap.getElementName().equals(name)) {
+                        return eachChildSoap;
+                    }
                 }
             }
             eachChild = eachChild.getNextSibling();
@@ -474,14 +668,14 @@
 
     protected SOAPElement addCDATA(String text) throws SOAPException {
         org.w3c.dom.Text cdata =
-            (org.w3c.dom.Text) getOwnerDocument().createCDATASection(text);
+                getOwnerDocument().createCDATASection(text);
         addNode(cdata);
         return this;
     }
 
     protected SOAPElement addText(String text) throws SOAPException {
         org.w3c.dom.Text textNode =
-            (org.w3c.dom.Text) getOwnerDocument().createTextNode(text);
+                getOwnerDocument().createTextNode(text);
         addNode(textNode);
         return this;
     }
@@ -684,8 +878,9 @@
     }
 
     protected SOAPElement convertToSoapElement(Element element) {
-        if (element instanceof SOAPElement) {
-            return (SOAPElement) element;
+        final Node soapNode = getSoapDocument().findIfPresent(element);
+        if (soapNode instanceof SOAPElement) {
+            return (SOAPElement) soapNode;
         } else {
             return replaceElementWithSOAPElement(
                 element,
@@ -693,7 +888,7 @@
         }
     }
 
-    protected static SOAPElement replaceElementWithSOAPElement(
+    protected SOAPElement replaceElementWithSOAPElement(
         Element element,
         ElementImpl copy) {
 
@@ -709,7 +904,7 @@
             copy.insertBefore(nextChild, null);
         }
 
-        Node parent = element.getParentNode();
+        Node parent = getSoapDocument().find(element.getParentNode());
         if (parent != null) {
             parent.replaceChild(copy, element);
         } // XXX else throw an exception?
@@ -727,8 +922,8 @@
                 if (next == null) {
                     while (eachNode.hasNext()) {
                         Node node = eachNode.next();
-                        if (node instanceof SOAPElement) {
-                            next = node;
+                        if (node instanceof Element) {
+                            next = getSoapDocument().findIfPresent(node);
                             break;
                         }
                     }
@@ -899,14 +1094,14 @@
     protected javax.xml.soap.Node getValueNode() {
         Iterator<Node> i = getChildElements();
         while (i.hasNext()) {
-            javax.xml.soap.Node n = (javax.xml.soap.Node) i.next();
+            Node n = i.next();
             if (n.getNodeType() == org.w3c.dom.Node.TEXT_NODE ||
                 n.getNodeType() == org.w3c.dom.Node.CDATA_SECTION_NODE) {
                 // TODO: Hack to fix text node split into multiple lines.
                 normalize();
                 // Should remove the normalization step when this gets fixed in
                 // DOM/Xerces.
-                return (javax.xml.soap.Node) n;
+                return getSoapDocument().find(n);
             }
         }
         return null;
@@ -948,7 +1143,7 @@
         if (parentNode instanceof SOAPDocument) {
             return null;
         }
-        return (SOAPElement) parentNode;
+        return (SOAPElement) getSoapDocument().find(parentNode);
     }
 
     protected String getSOAPNamespace() {
@@ -975,7 +1170,7 @@
     public void detachNode() {
         Node parent = getParentNode();
         if (parent != null) {
-            parent.removeChild(this);
+            parent.removeChild(element);
         }
         encodingStyleAttribute.clearNameAndValue();
         // Fix for CR: 6474641
@@ -1136,17 +1331,18 @@
         return attribute == null ? null : attribute.getValue();
     }
 
-    protected static Iterator<Node> getChildElementsFrom(final Element element) {
+    protected Iterator<Node> getChildElementsFrom(final Element element) {
         return new Iterator<Node>() {
             Node next = element.getFirstChild();
             Node nextNext = null;
             Node last = null;
+            Node soapElement = getSoapDocument().findIfPresent(element);
 
             public boolean hasNext() {
                 if (next != null) {
                     return true;
                 }
-                if (next == null && nextNext != null) {
+                if (nextNext != null) {
                     next = nextNext;
                 }
 
@@ -1158,15 +1354,15 @@
                     last = next;
                     next = null;
 
-                    if ((element instanceof ElementImpl)
-                        && (last instanceof Element)) {
+                    if ((soapElement instanceof ElementImpl)
+                            && (last instanceof Element)) {
                         last =
-                            ((ElementImpl) element).convertToSoapElement(
-                                (Element) last);
+                                ((ElementImpl) soapElement).convertToSoapElement(
+                                        (Element) last);
                     }
 
                     nextNext = last.getNextSibling();
-                    return last;
+                    return getSoapDocument().findIfPresent(last);
                 }
                 throw new NoSuchElementException();
             }
@@ -1251,7 +1447,7 @@
 //                SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(value)))
 //            return;
 
-        super.setAttributeNS(namespaceURI,qualifiedName,value);
+        element.setAttributeNS(namespaceURI,qualifiedName,value);
         //String tmpLocalName = this.getLocalName();
         String tmpURI = this.getNamespaceURI();
         boolean isIDNS = false;
@@ -1270,4 +1466,116 @@
 
     }
 
+    @Override
+    public void removeAttributeNS(String namespaceURI, String localName) throws DOMException {
+        element.removeAttributeNS(namespaceURI, localName);
+    }
+
+    @Override
+    public Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException {
+        return element.getAttributeNodeNS(namespaceURI, localName);
+    }
+
+    @Override
+    public Attr setAttributeNodeNS(Attr newAttr) throws DOMException {
+        return element.setAttributeNodeNS(newAttr);
+    }
+
+    @Override
+    public NodeList getElementsByTagNameNS(String namespaceURI, String localName) throws DOMException {
+        return new NodeListImpl(getSoapDocument(), element.getElementsByTagNameNS(namespaceURI, localName));
+    }
+
+    @Override
+    public boolean hasAttribute(String name) {
+        return element.hasAttribute(name);
+    }
+
+    @Override
+    public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException {
+        return element.hasAttributeNS(namespaceURI, localName);
+    }
+
+    @Override
+    public TypeInfo getSchemaTypeInfo() {
+        return element.getSchemaTypeInfo();
+    }
+
+    @Override
+    public void setIdAttribute(String name, boolean isId) throws DOMException {
+        element.setIdAttribute(name, isId);
+    }
+
+    @Override
+    public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException {
+        element.setIdAttributeNS(namespaceURI, localName, isId);
+    }
+
+    @Override
+    public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException {
+        element.setIdAttributeNode(idAttr, isId);
+    }
+
+    @Override
+    public String getNodeName() {
+        return element.getNodeName();
+    }
+
+    @Override
+    public String getNodeValue() throws DOMException {
+        return element.getNodeValue();
+    }
+
+    @Override
+    public void setNodeValue(String nodeValue) throws DOMException {
+        element.setNodeValue(nodeValue);
+    }
+
+    @Override
+    public short getNodeType() {
+        return element.getNodeType();
+    }
+
+    @Override
+    public Node getParentNode() {
+        return getSoapDocument().find(element.getParentNode());
+    }
+
+    @Override
+    public NodeList getChildNodes() {
+        return new NodeListImpl(getSoapDocument(), element.getChildNodes());
+    }
+
+    @Override
+    public Node getFirstChild() {
+        return getSoapDocument().findIfPresent(element.getFirstChild());
+    }
+
+    @Override
+    public Node getLastChild() {
+        return getSoapDocument().findIfPresent(element.getLastChild());
+    }
+
+    @Override
+    public Node getPreviousSibling() {
+        return getSoapDocument().findIfPresent(element.getPreviousSibling());
+    }
+
+    @Override
+    public Node getNextSibling() {
+        return getSoapDocument().findIfPresent(element.getNextSibling());
+    }
+
+    @Override
+    public NamedNodeMap getAttributes() {
+        return element.getAttributes();
+    }
+
+    public Element getDomElement() {
+        return element;
+    }
+
+    public SOAPDocumentImpl getSoapDocument() {
+        return soapDocument;
+    }
 }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -52,6 +52,7 @@
 
 import com.sun.xml.internal.org.jvnet.staxex.util.DOMStreamReader;
 import com.sun.xml.internal.org.jvnet.staxex.util.XMLStreamReaderToXMLStreamWriter;
+import org.w3c.dom.Element;
 
 /**
  * Our implementation of the SOAP envelope.
@@ -92,6 +93,10 @@
             addBody();
     }
 
+    public EnvelopeImpl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected abstract NameImpl getHeaderName(String prefix);
     protected abstract NameImpl getBodyName(String prefix);
 
@@ -122,7 +127,7 @@
         }
 
         header = (HeaderImpl) createElement(headerName);
-        insertBefore(header, firstChild);
+        insertBefore(header.getDomElement(), firstChild);
         header.ensureNamespaceIsDeclared(headerName.getPrefix(), headerName.getURI());
 
         return header;
@@ -161,7 +166,7 @@
         if (body == null) {
             NameImpl bodyName = getBodyName(prefix);
             body = (BodyImpl) createElement(bodyName);
-            insertBefore(body, null);
+            insertBefore(body.getDomElement(), null);
             body.ensureNamespaceIsDeclared(bodyName.getPrefix(), bodyName.getURI());
         } else {
             log.severe("SAAJ0122.impl.body.already.exists");
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -34,6 +34,7 @@
 
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
+import org.w3c.dom.Element;
 
 public abstract class FaultElementImpl
     extends ElementImpl
@@ -47,6 +48,10 @@
         super(ownerDoc, qname);
     }
 
+    public FaultElementImpl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected abstract boolean isStandardFaultElement();
 
     public SOAPElement setElementQName(QName newName) throws SOAPException {
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -31,6 +31,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.soap.*;
 
+import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;
 import org.w3c.dom.Element;
 
 import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
@@ -53,6 +54,9 @@
         super(ownerDoc, name);
     }
 
+    public FaultImpl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
 
     protected abstract NameImpl getDetailName();
     protected abstract NameImpl getFaultCodeName();
@@ -83,6 +87,7 @@
             (SOAPFaultElement) findAndConvertChildElement(getFaultStringName());
     }
 
+    @Override
     public void setFaultCode(String faultCode) throws SOAPException {
         setFaultCode(
             NameImpl.getLocalNameFromTagName(faultCode),
@@ -131,6 +136,7 @@
         }
     }
 
+    @Override
     public void setFaultCode(Name faultCodeQName) throws SOAPException {
         setFaultCode(
             faultCodeQName.getLocalName(),
@@ -138,6 +144,7 @@
             faultCodeQName.getURI());
     }
 
+    @Override
     public void setFaultCode(QName faultCodeQName) throws SOAPException {
         setFaultCode(
             faultCodeQName.getLocalPart(),
@@ -165,6 +172,7 @@
         detail = (Detail) findAndConvertChildElement(detailName);
     }
 
+    @Override
     public Detail getDetail() {
         if (detail == null)
             initializeDetail();
@@ -175,6 +183,7 @@
         return detail;
     }
 
+    @Override
     public Detail addDetail() throws SOAPException {
         if (detail == null)
             initializeDetail();
@@ -188,12 +197,15 @@
         }
     }
 
+    @Override
     public boolean hasDetail() {
         return (getDetail() != null);
     }
 
+    @Override
     public abstract void setFaultActor(String faultActor) throws SOAPException;
 
+    @Override
     public String getFaultActor() {
         if (this.faultActorElement == null)
             findFaultActorElement();
@@ -203,6 +215,7 @@
         return null;
     }
 
+    @Override
     public SOAPElement setElementQName(QName newName) throws SOAPException {
 
         log.log(
@@ -213,11 +226,13 @@
             "Cannot change name for " + elementQName.getLocalPart() + " to " + newName.getLocalPart());
     }
 
+    @Override
     protected SOAPElement convertToSoapElement(Element element) {
-        if (element instanceof SOAPFaultElement) {
-            return (SOAPElement) element;
-        } else if (element instanceof SOAPElement) {
-            SOAPElement soapElement = (SOAPElement) element;
+        final org.w3c.dom.Node soapNode = getSoapDocument().findIfPresent(element);
+        if (soapNode instanceof SOAPFaultElement) {
+            return (SOAPElement) soapNode;
+        } else if (soapNode instanceof SOAPElement) {
+            SOAPElement soapElement = (SOAPElement) soapNode;
             if (getDetailName().equals(soapElement.getElementName())) {
                 return replaceElementWithSOAPElement(element, createDetail());
             } else {
@@ -233,12 +248,12 @@
             Name elementName = NameImpl.copyElementName(element);
             ElementImpl newElement;
             if (getDetailName().equals(elementName)) {
-                newElement = (ElementImpl) createDetail();
+                newElement = createDetail();
             } else {
                 String localName = elementName.getLocalName();
                 if (isStandardFaultElement(localName))
                     newElement =
-                        (ElementImpl) createSOAPFaultElement(elementName);
+                        createSOAPFaultElement(elementName);
                 else
                     newElement = (ElementImpl) createElement(elementName);
             }
@@ -284,6 +299,7 @@
         }
     }
 
+    @Override
     protected SOAPElement addElement(Name name) throws SOAPException {
         if (getDetailName().equals(name)) {
             return addDetail();
@@ -297,6 +313,7 @@
         return super.addElement(name);
     }
 
+    @Override
     protected SOAPElement addElement(QName name) throws SOAPException {
         return addElement(NameImpl.convertToName(name));
     }
@@ -311,6 +328,8 @@
 
     /**
      * Convert an xml:lang attribute value into a Locale object
+     * @param xmlLang xml:lang attribute value
+     * @return Locale
      */
     protected static Locale xmlLangToLocale(String xmlLang) {
         if (xmlLang == null) {
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -31,6 +31,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.soap.*;
 
+import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;
 import org.w3c.dom.Element;
 
 import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
@@ -45,6 +46,10 @@
         super(ownerDoc, name);
     }
 
+    public HeaderImpl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected abstract SOAPHeaderElement createHeaderElement(Name name)
         throws SOAPException;
     protected abstract SOAPHeaderElement createHeaderElement(QName name)
@@ -276,8 +281,9 @@
     }
 
     protected SOAPElement convertToSoapElement(Element element) {
-        if (element instanceof SOAPHeaderElement) {
-            return (SOAPElement) element;
+        final org.w3c.dom.Node soapNode = getSoapDocument().findIfPresent(element);
+        if (soapNode instanceof SOAPHeaderElement) {
+            return (SOAPElement) soapNode;
         } else {
             SOAPHeaderElement headerElement;
             try {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/NodeListImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2017, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.xml.internal.messaging.saaj.soap.impl;
+
+import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import java.util.Objects;
+
+/**
+ * Node list wrapper, finding SOAP elements automatically when possible.
+ *
+ * @author Roman Grigoriadi
+ */
+public class NodeListImpl implements NodeList {
+
+    private final SOAPDocumentImpl soapDocument;
+
+    private final NodeList nodeList;
+
+    public NodeListImpl(SOAPDocumentImpl soapDocument, NodeList nodeList) {
+        Objects.requireNonNull(soapDocument);
+        Objects.requireNonNull(soapDocument);
+        this.soapDocument = soapDocument;
+        this.nodeList = nodeList;
+    }
+
+    @Override
+    public Node item(int index) {
+        return soapDocument.findIfPresent(nodeList.item(index));
+    }
+
+    @Override
+    public int getLength() {
+        return nodeList.getLength();
+    }
+}
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -31,14 +31,20 @@
 import javax.xml.soap.SOAPElement;
 import javax.xml.soap.SOAPException;
 
+import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;
+import org.w3c.dom.Comment;
 import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 import org.w3c.dom.Text;
 
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+import org.w3c.dom.UserDataHandler;
 
 public class SOAPCommentImpl
-    extends com.sun.org.apache.xerces.internal.dom.CommentImpl
     implements javax.xml.soap.Text, org.w3c.dom.Comment {
 
     protected static final Logger log =
@@ -47,8 +53,236 @@
     protected static ResourceBundle rb =
         log.getResourceBundle();
 
+    @Override
+    public String getData() throws DOMException {
+        return comment.getData();
+    }
+
+    @Override
+    public void setData(String data) throws DOMException {
+        comment.setData(data);
+    }
+
+    @Override
+    public int getLength() {
+        return comment.getLength();
+    }
+
+    @Override
+    public String substringData(int offset, int count) throws DOMException {
+        return comment.substringData(offset, count);
+    }
+
+    @Override
+    public void appendData(String arg) throws DOMException {
+        comment.appendData(arg);
+    }
+
+    @Override
+    public void insertData(int offset, String arg) throws DOMException {
+        comment.insertData(offset, arg);
+    }
+
+    @Override
+    public void deleteData(int offset, int count) throws DOMException {
+        comment.deleteData(offset, count);
+    }
+
+    @Override
+    public void replaceData(int offset, int count, String arg) throws DOMException {
+        comment.replaceData(offset, count, arg);
+    }
+
+    @Override
+    public String getNodeName() {
+        return comment.getNodeName();
+    }
+
+    @Override
+    public String getNodeValue() throws DOMException {
+        return comment.getNodeValue();
+    }
+
+    @Override
+    public void setNodeValue(String nodeValue) throws DOMException {
+        comment.setNodeValue(nodeValue);
+    }
+
+    @Override
+    public short getNodeType() {
+        return comment.getNodeType();
+    }
+
+    @Override
+    public Node getParentNode() {
+        return comment.getParentNode();
+    }
+
+    @Override
+    public NodeList getChildNodes() {
+        return comment.getChildNodes();
+    }
+
+    @Override
+    public Node getFirstChild() {
+        return comment.getFirstChild();
+    }
+
+    @Override
+    public Node getLastChild() {
+        return comment.getLastChild();
+    }
+
+    @Override
+    public Node getPreviousSibling() {
+        return comment.getPreviousSibling();
+    }
+
+    @Override
+    public Node getNextSibling() {
+        return comment.getNextSibling();
+    }
+
+    @Override
+    public NamedNodeMap getAttributes() {
+        return comment.getAttributes();
+    }
+
+    @Override
+    public Document getOwnerDocument() {
+        return comment.getOwnerDocument();
+    }
+
+    @Override
+    public Node insertBefore(Node newChild, Node refChild) throws DOMException {
+        return comment.insertBefore(newChild, refChild);
+    }
+
+    @Override
+    public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
+        return comment.replaceChild(newChild, oldChild);
+    }
+
+    @Override
+    public Node removeChild(Node oldChild) throws DOMException {
+        return comment.removeChild(oldChild);
+    }
+
+    @Override
+    public Node appendChild(Node newChild) throws DOMException {
+        return comment.appendChild(newChild);
+    }
+
+    @Override
+    public boolean hasChildNodes() {
+        return comment.hasChildNodes();
+    }
+
+    @Override
+    public Node cloneNode(boolean deep) {
+        return comment.cloneNode(deep);
+    }
+
+    @Override
+    public void normalize() {
+        comment.normalize();
+    }
+
+    @Override
+    public boolean isSupported(String feature, String version) {
+        return comment.isSupported(feature, version);
+    }
+
+    @Override
+    public String getNamespaceURI() {
+        return comment.getNamespaceURI();
+    }
+
+    @Override
+    public String getPrefix() {
+        return comment.getPrefix();
+    }
+
+    @Override
+    public void setPrefix(String prefix) throws DOMException {
+        comment.setPrefix(prefix);
+    }
+
+    @Override
+    public String getLocalName() {
+        return comment.getLocalName();
+    }
+
+    @Override
+    public boolean hasAttributes() {
+        return comment.hasAttributes();
+    }
+
+    @Override
+    public String getBaseURI() {
+        return comment.getBaseURI();
+    }
+
+    @Override
+    public short compareDocumentPosition(Node other) throws DOMException {
+        return comment.compareDocumentPosition(other);
+    }
+
+    @Override
+    public String getTextContent() throws DOMException {
+        return comment.getTextContent();
+    }
+
+    @Override
+    public void setTextContent(String textContent) throws DOMException {
+        comment.setTextContent(textContent);
+    }
+
+    @Override
+    public boolean isSameNode(Node other) {
+        return comment.isSameNode(other);
+    }
+
+    @Override
+    public String lookupPrefix(String namespaceURI) {
+        return comment.lookupPrefix(namespaceURI);
+    }
+
+    @Override
+    public boolean isDefaultNamespace(String namespaceURI) {
+        return comment.isDefaultNamespace(namespaceURI);
+    }
+
+    @Override
+    public String lookupNamespaceURI(String prefix) {
+        return comment.lookupNamespaceURI(prefix);
+    }
+
+    @Override
+    public boolean isEqualNode(Node arg) {
+        return comment.isEqualNode(arg);
+    }
+
+    @Override
+    public Object getFeature(String feature, String version) {
+        return comment.getFeature(feature, version);
+    }
+
+    @Override
+    public Object setUserData(String key, Object data, UserDataHandler handler) {
+        return comment.setUserData(key, data, handler);
+    }
+
+    @Override
+    public Object getUserData(String key) {
+        return comment.getUserData(key);
+    }
+
+    private Comment comment;
+
     public SOAPCommentImpl(SOAPDocumentImpl ownerDoc, String text) {
-        super(ownerDoc, text);
+        comment = ownerDoc.getDomDocument().createComment(text);
+        ownerDoc.register(this);
     }
 
     public String getValue() {
@@ -111,4 +345,7 @@
         throw new UnsupportedOperationException("Not Supported");
     }
 
+    public Comment getDomElement() {
+        return comment;
+    }
 }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -32,17 +32,271 @@
 
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+import org.w3c.dom.UserDataHandler;
 
 public class SOAPTextImpl
-    extends com.sun.org.apache.xerces.internal.dom.TextImpl
     implements javax.xml.soap.Text, org.w3c.dom.Text {
 
+    @Override
+    public Text splitText(int offset) throws DOMException {
+        return textNode.splitText(offset);
+    }
+
+    @Override
+    public boolean isElementContentWhitespace() {
+        return textNode.isElementContentWhitespace();
+    }
+
+    @Override
+    public String getWholeText() {
+        return textNode.getWholeText();
+    }
+
+    @Override
+    public Text replaceWholeText(String content) throws DOMException {
+        return textNode.replaceWholeText(content);
+    }
+
+    @Override
+    public String getData() throws DOMException {
+        return textNode.getData();
+    }
+
+    @Override
+    public void setData(String data) throws DOMException {
+        textNode.setData(data);
+    }
+
+    @Override
+    public int getLength() {
+        return textNode.getLength();
+    }
+
+    @Override
+    public String substringData(int offset, int count) throws DOMException {
+        return textNode.substringData(offset, count);
+    }
+
+    @Override
+    public void appendData(String arg) throws DOMException {
+        textNode.appendData(arg);
+    }
+
+    @Override
+    public void insertData(int offset, String arg) throws DOMException {
+        textNode.insertData(offset, arg);
+    }
+
+    @Override
+    public void deleteData(int offset, int count) throws DOMException {
+        textNode.deleteData(offset, count);
+    }
+
+    @Override
+    public void replaceData(int offset, int count, String arg) throws DOMException {
+        textNode.replaceData(offset, count, arg);
+    }
+
+    @Override
+    public String getNodeName() {
+        return textNode.getNodeName();
+    }
+
+    @Override
+    public String getNodeValue() throws DOMException {
+        return textNode.getNodeValue();
+    }
+
+    @Override
+    public void setNodeValue(String nodeValue) throws DOMException {
+        textNode.setNodeValue(nodeValue);
+    }
+
+    @Override
+    public short getNodeType() {
+        return textNode.getNodeType();
+    }
+
+    @Override
+    public Node getParentNode() {
+        return textNode.getParentNode();
+    }
+
+    @Override
+    public NodeList getChildNodes() {
+        return textNode.getChildNodes();
+    }
+
+    @Override
+    public Node getFirstChild() {
+        return textNode.getFirstChild();
+    }
+
+    @Override
+    public Node getLastChild() {
+        return textNode.getLastChild();
+    }
+
+    @Override
+    public Node getPreviousSibling() {
+        return textNode.getPreviousSibling();
+    }
+
+    @Override
+    public Node getNextSibling() {
+        return textNode.getNextSibling();
+    }
+
+    @Override
+    public NamedNodeMap getAttributes() {
+        return textNode.getAttributes();
+    }
+
+    @Override
+    public Document getOwnerDocument() {
+        return textNode.getOwnerDocument();
+    }
+
+    @Override
+    public Node insertBefore(Node newChild, Node refChild) throws DOMException {
+        return textNode.insertBefore(newChild, refChild);
+    }
+
+    @Override
+    public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
+        return textNode.replaceChild(newChild, oldChild);
+    }
+
+    @Override
+    public Node removeChild(Node oldChild) throws DOMException {
+        return textNode.removeChild(oldChild);
+    }
+
+    @Override
+    public Node appendChild(Node newChild) throws DOMException {
+        return textNode.appendChild(newChild);
+    }
+
+    @Override
+    public boolean hasChildNodes() {
+        return textNode.hasChildNodes();
+    }
+
+    @Override
+    public Node cloneNode(boolean deep) {
+        return textNode.cloneNode(deep);
+    }
+
+    @Override
+    public void normalize() {
+        textNode.normalize();
+    }
+
+    @Override
+    public boolean isSupported(String feature, String version) {
+        return textNode.isSupported(feature, version);
+    }
+
+    @Override
+    public String getNamespaceURI() {
+        return textNode.getNamespaceURI();
+    }
+
+    @Override
+    public String getPrefix() {
+        return textNode.getPrefix();
+    }
+
+    @Override
+    public void setPrefix(String prefix) throws DOMException {
+        textNode.setPrefix(prefix);
+    }
+
+    @Override
+    public String getLocalName() {
+        return textNode.getLocalName();
+    }
+
+    @Override
+    public boolean hasAttributes() {
+        return textNode.hasAttributes();
+    }
+
+    @Override
+    public String getBaseURI() {
+        return textNode.getBaseURI();
+    }
+
+    @Override
+    public short compareDocumentPosition(Node other) throws DOMException {
+        return textNode.compareDocumentPosition(other);
+    }
+
+    @Override
+    public String getTextContent() throws DOMException {
+        return textNode.getTextContent();
+    }
+
+    @Override
+    public void setTextContent(String textContent) throws DOMException {
+        textNode.setTextContent(textContent);
+    }
+
+    @Override
+    public boolean isSameNode(Node other) {
+        return textNode.isSameNode(other);
+    }
+
+    @Override
+    public String lookupPrefix(String namespaceURI) {
+        return textNode.lookupPrefix(namespaceURI);
+    }
+
+    @Override
+    public boolean isDefaultNamespace(String namespaceURI) {
+        return textNode.isDefaultNamespace(namespaceURI);
+    }
+
+    @Override
+    public String lookupNamespaceURI(String prefix) {
+        return textNode.lookupNamespaceURI(prefix);
+    }
+
+    @Override
+    public boolean isEqualNode(Node arg) {
+        return textNode.isEqualNode(arg);
+    }
+
+    @Override
+    public Object getFeature(String feature, String version) {
+        return textNode.getFeature(feature, version);
+    }
+
+    @Override
+    public Object setUserData(String key, Object data, UserDataHandler handler) {
+        return textNode.setUserData(key, data, handler);
+    }
+
+    @Override
+    public Object getUserData(String key) {
+        return textNode.getUserData(key);
+    }
+
     protected static final Logger log =
         Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN,
                          "com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings");
 
+    private Text textNode;
+
     public SOAPTextImpl(SOAPDocumentImpl ownerDoc, String text) {
-        super(ownerDoc, text);
+        textNode = ownerDoc.getDomDocument().createTextNode(text);
+        ownerDoc.register(this);
     }
 
     public String getValue() {
@@ -70,7 +324,7 @@
     public void detachNode() {
         org.w3c.dom.Node parent = getParentNode();
         if (parent != null) {
-            parent.removeChild(this);
+            parent.removeChild(getDomElement());
         }
     }
 
@@ -88,4 +342,8 @@
         }
         return txt.startsWith("<!--") && txt.endsWith("-->");
     }
+
+    public Text getDomElement() {
+        return textNode;
+    }
 }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -218,6 +218,7 @@
         return prefix + ":" + localName;
     }
 
+    @Override
     public boolean equals(Object obj) {
         if (!(obj instanceof Name)) {
             return false;
@@ -236,6 +237,7 @@
         return true;
     }
 
+    @Override
     public int hashCode() {
         return localName.hashCode();
     }
@@ -245,6 +247,7 @@
      *
      * @return a string for the local name.
      */
+    @Override
     public String getLocalName() {
         return localName;
     }
@@ -256,6 +259,7 @@
      *
      * @return the prefix as a string.
      */
+    @Override
     public String getPrefix() {
         return prefix;
     }
@@ -265,6 +269,7 @@
      *
      * @return the uri as a string.
      */
+    @Override
     public String getURI() {
         return uri;
     }
@@ -272,6 +277,7 @@
     /**
      * Returns a String version of the name suitable for use in an XML document.
      */
+    @Override
     public String getQualifiedName() {
         if (qualifiedName == null) {
             if (prefix != null && prefix.length() > 0) {
@@ -285,6 +291,9 @@
 
     /**
      * Create a name object for a SOAP1.1 Envelope.
+     *
+     * @param prefix prefix
+     * @return Envelope Name
      */
     public static NameImpl createEnvelope1_1Name(String prefix) {
         return new Envelope1_1Name(prefix);
@@ -292,6 +301,9 @@
 
     /**
      * Create a name object for a SOAP1.2 Envelope.
+     *
+     * @param prefix prefix
+     * @return Envelope Name
      */
     public static NameImpl createEnvelope1_2Name(String prefix) {
         return new Envelope1_2Name(prefix);
@@ -299,6 +311,9 @@
 
     /**
      * Create a name object for a SOAP1.1 Header.
+     *
+     * @param prefix prefix
+     * @return Header Name
      */
     public static NameImpl createHeader1_1Name(String prefix) {
         return new Header1_1Name(prefix);
@@ -306,6 +321,9 @@
 
     /**
      * Create a name object for a SOAP1.2 Header.
+     *
+     * @param prefix prefix
+     * @return Header Name
      */
     public static NameImpl createHeader1_2Name(String prefix) {
         return new Header1_2Name(prefix);
@@ -313,6 +331,9 @@
 
     /**
      * Create a name object for a SOAP1.1 Body.
+     *
+     * @param prefix prefix
+     * @return Body Name
      */
     public static NameImpl createBody1_1Name(String prefix) {
         return new Body1_1Name(prefix);
@@ -320,6 +341,9 @@
 
     /**
      * Create a name object for a SOAP1.2 Body.
+     *
+     * @param prefix prefix
+     * @return Body Name
      */
     public static NameImpl createBody1_2Name(String prefix) {
         return new Body1_2Name(prefix);
@@ -327,20 +351,29 @@
 
     /**
      * Create a name object for a SOAP1.1 Fault.
+     *
+     * @param prefix prefix
+     * @return Fault Name
      */
     public static NameImpl createFault1_1Name(String prefix) {
         return new Fault1_1Name(prefix);
     }
 
     /**
-      * Create a name object for a SOAP1.2 NotUnderstood element.
-      */
+     * Create a name object for a SOAP1.2 NotUnderstood element.
+     *
+     * @param prefix prefix
+     * @return NotUnderstood Name
+     */
     public static NameImpl createNotUnderstood1_2Name(String prefix) {
         return new NotUnderstood1_2Name(prefix);
     }
 
     /**
      * Create a name object for a SOAP1.2 Upgrade element.
+     *
+     * @param prefix prefix
+     * @return Upgrade Name
      */
     public static NameImpl createUpgrade1_2Name(String prefix) {
         return new Upgrade1_2Name(prefix);
@@ -348,6 +381,9 @@
 
     /**
      * Create a name object for a SOAP1.2 SupportedEnvelope Upgrade element.
+     *
+     * @param prefix prefix
+     * @return Supported Envelope Name
      */
     public static NameImpl createSupportedEnvelope1_2Name(String prefix) {
         return new SupportedEnvelope1_2Name(prefix);
@@ -358,6 +394,8 @@
      * Fault, Reason or Detail.
      *
      * @param localName Local Name of element
+     * @param prefix prefix
+     * @return Fault Name
      */
     public static NameImpl createFault1_2Name(
         String localName,
@@ -369,6 +407,8 @@
      * Create a name object for a SOAP1.2 Fault/Code or Subcode.
      *
      * @param localName Either "Code" or "Subcode"
+     * @param prefix prefix
+     * @return CodeSubcode Name
      */
     public static NameImpl createCodeSubcode1_2Name(
         String prefix,
@@ -378,6 +418,8 @@
 
     /**
      * Create a name object for a SOAP1.1 Fault Detail.
+     *
+     * @return Detail Name
      */
     public static NameImpl createDetail1_1Name() {
         return new Detail1_1Name();
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -38,12 +38,17 @@
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.soap.impl.BodyImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
+import org.w3c.dom.Element;
 
 public class Body1_1Impl extends BodyImpl {
     public Body1_1Impl(SOAPDocumentImpl ownerDocument, String prefix) {
             super(ownerDocument, NameImpl.createBody1_1Name(prefix));
     }
 
+    public Body1_1Impl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     public SOAPFault addSOAP12Fault(QName faultCode, String faultReason, Locale locale) {
         // log message here
         throw new UnsupportedOperationException("Not supported in SOAP 1.1");
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -36,6 +36,7 @@
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.soap.impl.DetailImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
+import org.w3c.dom.Element;
 
 public class Detail1_1Impl extends DetailImpl {
 
@@ -45,6 +46,11 @@
     public Detail1_1Impl(SOAPDocumentImpl ownerDoc) {
         super(ownerDoc, NameImpl.createDetail1_1Name());
     }
+
+    public Detail1_1Impl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected DetailEntry createDetailEntry(Name name) {
         return new DetailEntry1_1Impl(
             (SOAPDocumentImpl) getOwnerDocument(),
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -34,6 +34,7 @@
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
+import org.w3c.dom.Element;
 
 public class Envelope1_1Impl extends EnvelopeImpl {
 
@@ -52,6 +53,11 @@
             createHeader,
             createBody);
     }
+
+    public Envelope1_1Impl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected NameImpl getBodyName(String prefix) {
         return NameImpl.createBody1_1Name(prefix);
     }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -46,6 +46,7 @@
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
 import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
+import org.w3c.dom.Element;
 
 
 public class Fault1_1Impl extends FaultImpl {
@@ -59,6 +60,10 @@
        super(ownerDocument, NameImpl.createFault1_1Name(prefix));
     }
 
+    public Fault1_1Impl(Element domElement, SOAPDocumentImpl ownerDoc) {
+        super(ownerDoc, domElement);
+    }
+
     protected NameImpl getDetailName() {
         return NameImpl.createDetail1_1Name();
     }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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 @@
 import com.sun.xml.internal.messaging.saaj.soap.impl.HeaderImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+import org.w3c.dom.Element;
 
 public class Header1_1Impl extends HeaderImpl {
 
@@ -51,6 +52,10 @@
             super(ownerDocument, NameImpl.createHeader1_1Name(prefix));
     }
 
+    public Header1_1Impl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected NameImpl getNotUnderstoodName() {
         log.log(
             Level.SEVERE,
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -34,6 +34,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.soap.*;
 
+import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
 import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
@@ -52,6 +53,10 @@
             super(ownerDocument, NameImpl.createBody1_2Name(prefix));
     }
 
+    public Body1_2Impl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected NameImpl getFaultName(String name) {
         return NameImpl.createFault1_2Name(name, null);
     }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -39,6 +39,7 @@
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.soap.impl.DetailImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
+import org.w3c.dom.Element;
 
 public class Detail1_2Impl extends DetailImpl {
 
@@ -54,6 +55,10 @@
         super(ownerDocument, NameImpl.createSOAP12Name("Detail"));
     }
 
+    public Detail1_2Impl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected DetailEntry createDetailEntry(Name name) {
         return new DetailEntry1_2Impl(
             ((SOAPDocument) getOwnerDocument()).getDocument(),
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -39,6 +39,7 @@
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
+import org.w3c.dom.Element;
 
 public class Envelope1_2Impl extends EnvelopeImpl {
 
@@ -50,6 +51,10 @@
         super(ownerDoc, NameImpl.createEnvelope1_2Name(prefix));
     }
 
+    public Envelope1_2Impl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     public Envelope1_2Impl(
         SOAPDocumentImpl ownerDoc,
         String prefix,
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -42,6 +42,7 @@
 import com.sun.xml.internal.messaging.saaj.soap.impl.*;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+import org.w3c.dom.Element;
 
 
 public class Fault1_2Impl extends FaultImpl {
@@ -68,6 +69,10 @@
         super(ownerDocument, NameImpl.createFault1_2Name(null, prefix));
     }
 
+    public Fault1_2Impl(Element domElement, SOAPDocumentImpl ownerDoc) {
+        super(ownerDoc, domElement);
+    }
+
     protected NameImpl getDetailName() {
         return NameImpl.createSOAP12Name("Detail", getPrefix());
     }
@@ -521,7 +526,7 @@
             }
         }
         if (element instanceof Detail1_2Impl) {
-            ElementImpl importedElement = (ElementImpl) importElement(element);
+            Element importedElement = importElement(element);
             addNode(importedElement);
             return convertToSoapElement(importedElement);
         } else
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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 @@
 import com.sun.xml.internal.messaging.saaj.soap.impl.HeaderImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+import org.w3c.dom.Element;
 
 
 public class Header1_2Impl extends HeaderImpl {
@@ -54,6 +55,10 @@
         super(ownerDocument, NameImpl.createHeader1_2Name(prefix));
     }
 
+    public Header1_2Impl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected NameImpl getNotUnderstoodName() {
         return NameImpl.createNotUnderstood1_2Name(null);
     }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -37,7 +37,6 @@
  * This class is used by XML Schema binary format validation
  *
  * @author Jeffrey Rodriguez
- * @version
  */
 public final class Base64 {
 
@@ -173,7 +172,7 @@
     /**
      * Decodes Base64 data into octects
      *
-     * @param binaryData Byte array containing Base64 data
+     * @param base64Data Byte array containing Base64 data
      * @return Array containind decoded data.
      */
     public byte[] decode( byte[] base64Data ) {
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -42,6 +42,7 @@
  * <li>doesn't do synchronization
  * <li>allows access to the raw buffer
  * <li>almost no parameter check
+ * </ol>
  */
 public final class ByteOutputStream extends OutputStream {
     /**
@@ -64,6 +65,9 @@
 
     /**
      * Copies all the bytes from this input into this buffer.
+     *
+     * @param in input stream.
+     * @exception IOException in case of an I/O error.
      */
     public void write(InputStream in) throws IOException {
         if (in instanceof ByteArrayInputStream) {
@@ -84,6 +88,7 @@
         }
     }
 
+    @Override
     public void write(int b) {
         ensureCapacity(1);
         buf[count] = (byte) b;
@@ -102,18 +107,22 @@
         }
     }
 
+    @Override
     public void write(byte[] b, int off, int len) {
         ensureCapacity(len);
         System.arraycopy(b, off, buf, count, len);
         count += len;
     }
 
+    @Override
     public void write(byte[] b) {
         write(b, 0, b.length);
     }
 
     /**
      * Writes a string as ASCII string.
+     *
+     * @param s string to write.
      */
     public void writeAsAscii(String s) {
         int len = s.length();
@@ -138,9 +147,12 @@
      * Evil buffer reallocation method.
      * Don't use it unless you absolutely have to.
      *
+     * @return byte array
+     *
      * @deprecated
      *      because this is evil!
      */
+    @Deprecated
     public byte toByteArray()[] {
         byte[] newbuf = new byte[count];
         System.arraycopy(buf, 0, newbuf, 0, count);
@@ -162,10 +174,12 @@
      * @return String translated from the buffer's contents.
      * @since JDK1.1
      */
+    @Override
     public String toString() {
         return new String(buf, 0, count);
     }
 
+    @Override
     public void close() {
     }
 
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -39,8 +39,9 @@
 * string and fragment) that may constitute a URI.
 * <p>
 * Parsing of a URI specification is done according to the URI
-* syntax described in <a href="http://www.ietf.org/rfc/rfc2396.txt?number=2396">RFC 2396</a>.
-* Every URI consists of a scheme, followed by a colon (':'), followed by a scheme-specific
+* syntax described in <a href="http://www.ietf.org/rfc/rfc2396.txt?number=2396">
+* RFC 2396</a>. Every URI consists
+* of a scheme, followed by a colon (':'), followed by a scheme-specific
 * part. For URIs that follow the "generic URI" syntax, the scheme-
 * specific part begins with two slashes ("//") and may be followed
 * by an authority segment (comprised of user information, host, and
@@ -60,8 +61,6 @@
 * default port for a specific scheme). Rather, it only knows the
 * grammar and basic set of operations that can be applied to a URI.
 *
-* @version
-*
 **********************************************************************/
  public class JaxmURI implements Serializable {
 
@@ -1106,6 +1105,7 @@
   * @return true if p_test is a URI with all values equal to this
   *         URI, false otherwise
   */
+  @Override
   public boolean equals(Object p_test) {
     if (p_test instanceof JaxmURI) {
       JaxmURI testURI = (JaxmURI) p_test;
@@ -1134,6 +1134,7 @@
     return false;
   }
 
+  @Override
   public int hashCode() {
           // No members safe to use, just default to a constant.
           return 153214;
@@ -1144,6 +1145,7 @@
   *
   * @return the URI string specification
   */
+  @Override
   public String toString() {
     StringBuilder uriSpecString = new StringBuilder();
 
@@ -1173,6 +1175,8 @@
   * A scheme is conformant if it starts with an alphanumeric, and
   * contains only alphanumerics, '+','-' and '.'.
   *
+  * @param p_scheme scheme name
+  *
   * @return true if the scheme is conformant, false otherwise
   */
   public static boolean isConformantSchemeName(String p_scheme) {
@@ -1202,7 +1206,9 @@
   * IPv4 address consists of four decimal digit groups separated by a
   * '.'. A hostname consists of domain labels (each of which must
   * begin and end with an alphanumeric but may contain '-') separated
-  & by a '.'. See RFC 2396 Section 3.2.2.
+  * by a '.'. See RFC 2396 Section 3.2.2.
+  *
+  * @param p_address address
   *
   * @return true if the string is a syntactically valid IPv4 address
   *              or hostname
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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,10 @@
      * Returns a new String constructed from the specified String by replacing
      * the URL escape sequences and UTF8 encoding with the characters they
      * represent.
+     *
+     * @param s string
+     *
+     * @return decoded string
      */
     public static String decode(String s) {
         StringBuilder sb = new StringBuilder();
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -45,8 +45,7 @@
 
     public ParserPool(int capacity) {
         queue = new ArrayBlockingQueue<SAXParser>(capacity);
-        //factory = SAXParserFactory.newInstance();
-        factory = new com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl();
+        factory = SAXParserFactory.newInstance("com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl", SAAJUtil.getSystemClassLoader());
         factory.setNamespaceAware(true);
         for (int i = 0; i < capacity; i++) {
            try {
@@ -79,30 +78,7 @@
 
     public void returnParser(SAXParser saxParser) {
         saxParser.reset();
-        resetSaxParser(saxParser);
         put(saxParser);
     }
 
-
-    /**
-     * SAAJ Issue 46 :https://saaj.dev.java.net/issues/show_bug.cgi?id=46
-     * Xerces does not provide a way to reset the SymbolTable
-     * So we are trying to reset it using the proprietary code below.
-     * Temporary Until the bug : https://jaxp.dev.java.net/issues/show_bug.cgi?id=59
-     * is fixed.
-     * @param parser the parser from the pool whose Symbol Table needs to be reset.
-     */
-     private void resetSaxParser(SAXParser parser) {
-        try {
-            //Object obj = parser.getProperty("http://apache.org/xml/properties/internal/symbol-table");
-            com.sun.org.apache.xerces.internal.util.SymbolTable table = new com.sun.org.apache.xerces.internal.util.SymbolTable();
-            parser.setProperty("http://apache.org/xml/properties/internal/symbol-table", table);
-            //obj = parser.getProperty("http://apache.org/xml/properties/internal/symbol-table");
-        } catch (SAXNotRecognizedException ex) {
-            //nothing to do
-        } catch (SAXNotSupportedException ex) {
-            //nothing to do
-        }
-    }
-
 }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/SAAJUtil.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/SAAJUtil.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, 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
@@ -26,6 +26,8 @@
 package com.sun.xml.internal.messaging.saaj.util;
 
 import java.security.AccessControlException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 /**
  *
@@ -48,4 +50,13 @@
             return null;
         }
     }
+
+    public static ClassLoader getSystemClassLoader() {
+        return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+            @Override
+            public ClassLoader run() {
+                return ClassLoader.getSystemClassLoader();
+            }
+        });
+    }
 }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -107,11 +107,13 @@
         }
     }
 
+    @Override
     public void clearParameters() {
         if (m_realTransformer != null)
             m_realTransformer.clearParameters();
     }
 
+    @Override
     public javax.xml.transform.ErrorListener getErrorListener() {
         try {
             materialize();
@@ -122,6 +124,7 @@
         return null;
     }
 
+    @Override
     public java.util.Properties getOutputProperties() {
         try {
             materialize();
@@ -132,6 +135,7 @@
         return null;
     }
 
+    @Override
     public String getOutputProperty(String str)
         throws java.lang.IllegalArgumentException {
         try {
@@ -143,6 +147,7 @@
         return null;
     }
 
+    @Override
     public Object getParameter(String str) {
         try {
             materialize();
@@ -153,6 +158,7 @@
         return null;
     }
 
+    @Override
     public javax.xml.transform.URIResolver getURIResolver() {
         try {
             materialize();
@@ -163,6 +169,7 @@
         return null;
     }
 
+    @Override
     public void setErrorListener(
         javax.xml.transform.ErrorListener errorListener)
         throws java.lang.IllegalArgumentException {
@@ -174,6 +181,7 @@
         }
     }
 
+    @Override
     public void setOutputProperties(java.util.Properties properties)
         throws java.lang.IllegalArgumentException {
         try {
@@ -184,6 +192,7 @@
         }
     }
 
+    @Override
     public void setOutputProperty(String str, String str1)
         throws java.lang.IllegalArgumentException {
         try {
@@ -194,6 +203,7 @@
         }
     }
 
+    @Override
     public void setParameter(String str, Object obj) {
         try {
             materialize();
@@ -203,6 +213,7 @@
         }
     }
 
+    @Override
     public void setURIResolver(javax.xml.transform.URIResolver uRIResolver) {
         try {
             materialize();
@@ -272,6 +283,7 @@
 
     //------------------------------------------------------------------------
 
+    @Override
     public void transform(
         javax.xml.transform.Source source,
         javax.xml.transform.Result result)
@@ -409,6 +421,8 @@
      * Return Transformer instance for this thread, allocating a new one if
      * necessary. Note that this method does not clear global parameters,
      * properties or any other data set on a previously used transformer.
+     *
+     * @return Transformer instance
      */
     public static Transformer newTransformer() {
         //CR : 6813167
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/message/saaj/SAAJMessageHeaders.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/message/saaj/SAAJMessageHeaders.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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,8 @@
 import javax.xml.soap.SOAPHeaderElement;
 import javax.xml.soap.SOAPMessage;
 
+import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
+import com.sun.xml.internal.messaging.saaj.soap.impl.HeaderImpl;
 import com.sun.xml.internal.ws.api.SOAPVersion;
 import com.sun.xml.internal.ws.api.WSBinding;
 import com.sun.xml.internal.ws.api.message.Header;
@@ -234,11 +236,12 @@
         if (soapHeader == null) {
             return null;
         }
+        SOAPDocumentImpl soapDocument = ((HeaderImpl)soapHeader).getSoapDocument();
         SOAPHeaderElement headerElem = find(nsUri, localName);
         if (headerElem == null) {
             return null;
         }
-        headerElem = (SOAPHeaderElement) soapHeader.removeChild(headerElem);
+        headerElem = (SOAPHeaderElement) soapDocument.find(soapHeader.removeChild(headerElem));
 
         //it might have been a nonSAAJHeader - remove from that map
         removeNonSAAJHeader(headerElem);
@@ -330,7 +333,7 @@
 
     private void addNonSAAJHeader(SOAPHeaderElement headerElem, Header header) {
         if (nonSAAJHeaders == null) {
-            nonSAAJHeaders = new HashMap<SOAPHeaderElement, Header>();
+            nonSAAJHeaders = new HashMap<>();
         }
         nonSAAJHeaders.put(headerElem, header);
     }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/pipe/ThreadHelper.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/pipe/ThreadHelper.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -68,9 +68,7 @@
                             Class<?> cls = Class.forName(SAFE_THREAD_NAME);
                             Constructor<?> ctr = cls.getConstructor(Runnable.class);
                             return new SunMiscThreadFactory(ctr);
-                        } catch (ClassNotFoundException ignored) {
-                        } catch (NoSuchMethodException ignored) {
-                        }
+                        } catch (ClassNotFoundException | NoSuchMethodException ignored) {}
                         return new LegacyThreadFactory();
                     }
                 }
@@ -90,7 +88,9 @@
             try {
                 return ctr.newInstance(null, r, "toBeReplaced", 0, false);
             } catch (ReflectiveOperationException x) {
-                throw new InternalError(x);
+                InternalError ie = new InternalError(x.getMessage());
+                ie.initCause(ie);
+                throw ie;
             }
         }
     }
@@ -99,7 +99,7 @@
     private static class SunMiscThreadFactory implements ThreadFactory {
         final Constructor<?> ctr;
         SunMiscThreadFactory(Constructor<?> ctr) { this.ctr = ctr; }
-        @Override public Thread newThread(Runnable r) {
+        @Override public Thread newThread(final Runnable r) {
             return AccessController.doPrivileged(
                     new PrivilegedAction<Thread>() {
                         @Override
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/MethodUtil.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/MethodUtil.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, 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
@@ -31,7 +31,7 @@
 import java.util.logging.Logger;
 
 /**
- * Utility class to invoke sun.reflect.misc.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks
+ * Utility class to invoke com.sun.xml.internal.ws.util.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks
  * to java.lang,reflect.Method.invoke()
  *
  * Be careful, copy of this class exists in several packages, iny modification must be done to other copies too!
@@ -39,43 +39,17 @@
 class MethodUtil {
 
     private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName());
-    private static final Method INVOKE_METHOD;
-
-    static {
-        Method method;
-        try {
-            Class<?> clazz = Class.forName("sun.reflect.misc.MethodUtil");
-            method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class);
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods.");
-            }
-        } catch (Throwable t) {
-            method = null;
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM");
-            }
-        }
-        INVOKE_METHOD = method;
-    }
 
     static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException {
-        if (INVOKE_METHOD != null) {
-            // sun.reflect.misc.MethodUtil.invoke(method, owner, args)
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil");
-            }
-            try {
-                return INVOKE_METHOD.invoke(null, method, target, args);
-            } catch (InvocationTargetException ite) {
-                // unwrap invocation exception added by reflection code ...
-                throw unwrapException(ite);
-            }
-        } else {
-            // other then Oracle JDK ...
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM");
-            }
-            return method.invoke(target, args);
+        // com.sun.xml.internal.ws.util.MethodUtil.invoke(method, owner, args)
+        if (LOGGER.isLoggable(Level.FINE)) {
+            LOGGER.log(Level.FINE, "Invoking method using com.sun.xml.internal.ws.util.MethodUtil");
+        }
+        try {
+            return com.sun.xml.internal.ws.util.MethodUtil.invoke(method, target, args);
+        } catch (InvocationTargetException ite) {
+            // unwrap invocation exception added by reflection code ...
+            throw unwrapException(ite);
         }
     }
 
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -26,9 +26,9 @@
 package com.sun.xml.internal.ws.api.server;
 
 import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
 import com.sun.xml.internal.ws.server.ServerRtException;
 import com.sun.xml.internal.ws.streaming.TidyXMLStreamReader;
-import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
 
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
@@ -42,7 +42,7 @@
  * SPI that provides the source of {@link SDDocument}.
  *
  * <p>
- * This abstract class could be implemented by appliations, or one of the
+ * This abstract class could be implemented by applications, or one of the
  * {@link #create} methods can be used.
  *
  * @author Kohsuke Kawaguchi
@@ -85,28 +85,38 @@
 
     /**
      * System ID of this document.
+     * @return
      */
     public abstract URL getSystemId();
 
+    public static SDDocumentSource create(final Class<?> implClass, final String url) {
+        return create(url, implClass);
+    }
+
     /**
      * Creates {@link SDDocumentSource} from an URL.
+     * @param url
+     * @return
      */
     public static SDDocumentSource create(final URL url) {
         return new SDDocumentSource() {
             private final URL systemId = url;
 
+            @Override
             public XMLStreamReader read(XMLInputFactory xif) throws IOException, XMLStreamException {
                 InputStream is = url.openStream();
                 return new TidyXMLStreamReader(
                     xif.createXMLStreamReader(systemId.toExternalForm(),is), is);
             }
 
+            @Override
             public XMLStreamReader read() throws IOException, XMLStreamException {
                 InputStream is = url.openStream();
                 return new TidyXMLStreamReader(
                    XMLStreamReaderFactory.create(systemId.toExternalForm(),is,false), is);
             }
 
+            @Override
             public URL getSystemId() {
                 return systemId;
             }
@@ -120,19 +130,22 @@
      * @param resolvingClass class used to read resource
      * @param path resource path
      */
-    public static SDDocumentSource create(final Class resolvingClass, final String path) {
+    private static SDDocumentSource create(final String path, final Class<?> resolvingClass) {
         return new SDDocumentSource() {
 
+            @Override
             public XMLStreamReader read(XMLInputFactory xif) throws IOException, XMLStreamException {
                 InputStream is = inputStream();
                 return new TidyXMLStreamReader(xif.createXMLStreamReader(path,is), is);
             }
 
+            @Override
             public XMLStreamReader read() throws IOException, XMLStreamException {
                 InputStream is = inputStream();
                 return new TidyXMLStreamReader(XMLStreamReaderFactory.create(path,is,false), is);
             }
 
+            @Override
             public URL getSystemId() {
                 try {
                     return new URL("file://" + path);
@@ -157,17 +170,23 @@
 
     /**
      * Creates a {@link SDDocumentSource} from {@link XMLStreamBuffer}.
+     * @param systemId
+     * @param xsb
+     * @return
      */
     public static SDDocumentSource create(final URL systemId, final XMLStreamBuffer xsb) {
         return new SDDocumentSource() {
+            @Override
             public XMLStreamReader read(XMLInputFactory xif) throws XMLStreamException {
                 return xsb.readAsXMLStreamReader();
             }
 
+            @Override
             public XMLStreamReader read() throws XMLStreamException {
                 return xsb.readAsXMLStreamReader();
             }
 
+            @Override
             public URL getSystemId() {
                 return systemId;
             }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, 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
@@ -25,10 +25,10 @@
 
 package com.sun.xml.internal.ws.api.streaming;
 
+import com.sun.xml.internal.ws.resources.ContextClassloaderLocalMessages;
+
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.text.MessageFormat;
-import java.util.ResourceBundle;
 import java.util.WeakHashMap;
 
 /**
@@ -36,9 +36,7 @@
  */
 abstract class ContextClassloaderLocal<V> {
 
-    private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE";
-
-    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<ClassLoader, V>();
+    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<>();
 
     public V get() throws Error {
         ClassLoader tccl = getContextClassLoader();
@@ -60,26 +58,21 @@
         try {
             return initialValue();
         } catch (Exception e) {
-            throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e);
+            throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e);
         }
     }
 
-    private static String format(String property, Object... args) {
-        String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property);
-        return MessageFormat.format(text, args);
-    }
-
     private static ClassLoader getContextClassLoader() {
-        return (ClassLoader)
-                AccessController.doPrivileged(new PrivilegedAction() {
-                    public Object run() {
-                        ClassLoader cl = null;
-                        try {
-                            cl = Thread.currentThread().getContextClassLoader();
-                        } catch (SecurityException ex) {
-                        }
-                        return cl;
-                    }
-                });
+        return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+            @Override
+            public ClassLoader run() {
+                ClassLoader cl = null;
+                try {
+                    cl = Thread.currentThread().getContextClassLoader();
+                } catch (SecurityException ex) {
+                }
+                return cl;
+            }
+        });
     }
 }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.properties	Fri Feb 10 00:39:51 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-#
-# Copyright (c) 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
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0}
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/BindingImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/BindingImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -75,7 +75,7 @@
     //This is reset when ever Binding.setHandlerChain() or SOAPBinding.setRoles() is called.
     private HandlerConfiguration handlerConfig;
     private final Set<QName> addedHeaders = new HashSet<QName>();
-    private final Set<QName> knownHeaders = new HashSet<QName>();
+    private final Set<QName> knownHeaders = Collections.synchronizedSet(new HashSet<QName>());
     private final Set<QName> unmodKnownHeaders = Collections.unmodifiableSet(knownHeaders);
     private final BindingID bindingId;
     // Features that are set(enabled/disabled) on the binding
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -42,6 +42,8 @@
 import javax.xml.ws.soap.MTOMFeature;
 import javax.xml.ws.soap.SOAPBinding;
 import java.util.*;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
 
 /**
  * @author WS Development Team
@@ -57,6 +59,7 @@
 
     private Set<QName> portKnownHeaders = Collections.emptySet();
     private Set<QName> bindingUnderstoodHeaders = new HashSet<QName>();
+    private final Lock lock = new ReentrantLock();
 
     /**
      * Use {@link BindingImpl#create(BindingID)} to create this.
@@ -95,7 +98,13 @@
      * @param headers SOAP header names
      */
     public void setPortKnownHeaders(@NotNull Set<QName> headers) {
-        this.portKnownHeaders = headers;
+
+        try{
+          lock.lock();
+          this.portKnownHeaders = headers;
+                } finally {
+                lock.unlock();
+        }
     }
 
     /**
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, 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
@@ -31,7 +31,7 @@
 import java.util.logging.Logger;
 
 /**
- * Utility class to invoke sun.reflect.misc.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks
+ * Utility class to invoke com.sun.xml.internal.ws.util.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks
  * to java.lang,reflect.Method.invoke()
  * <p/>
  * Be careful, copy of this class exists in several packages, iny modification must be done to other copies too!
@@ -39,43 +39,17 @@
 class MethodUtil {
 
     private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName());
-    private static final Method INVOKE_METHOD;
-
-    static {
-        Method method;
-        try {
-            Class<?> clazz = Class.forName("sun.reflect.misc.MethodUtil");
-            method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class);
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods.");
-            }
-        } catch (Throwable t) {
-            method = null;
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM");
-            }
-        }
-        INVOKE_METHOD = method;
-    }
 
     static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException {
-        if (INVOKE_METHOD != null) {
-            // sun.reflect.misc.MethodUtil.invoke(method, owner, args)
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil");
-            }
-            try {
-                return INVOKE_METHOD.invoke(null, method, target, args);
-            } catch (InvocationTargetException ite) {
-                // unwrap invocation exception added by reflection code ...
-                throw unwrapException(ite);
-            }
-        } else {
-            // other then Oracle JDK ...
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM");
-            }
-            return method.invoke(target, args);
+        // com.sun.xml.internal.ws.util.MethodUtil.invoke(method, owner, args)
+        if (LOGGER.isLoggable(Level.FINE)) {
+            LOGGER.log(Level.FINE, "Invoking method using com.sun.xml.internal.ws.util.MethodUtil");
+        }
+        try {
+            return com.sun.xml.internal.ws.util.MethodUtil.invoke(method, target, args);
+        } catch (InvocationTargetException ite) {
+            // unwrap invocation exception added by reflection code ...
+            throw unwrapException(ite);
         }
     }
 
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, 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
@@ -25,10 +25,10 @@
 
 package com.sun.xml.internal.ws.commons.xmlutil;
 
+import com.sun.xml.internal.ws.resources.ContextClassloaderLocalMessages;
+
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.text.MessageFormat;
-import java.util.ResourceBundle;
 import java.util.WeakHashMap;
 
 /**
@@ -36,9 +36,7 @@
  */
 abstract class ContextClassloaderLocal<V> {
 
-    private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE";
-
-    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<ClassLoader, V>();
+    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<>();
 
     public V get() throws Error {
         ClassLoader tccl = getContextClassLoader();
@@ -60,26 +58,21 @@
         try {
             return initialValue();
         } catch (Exception e) {
-            throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e);
+            throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e);
         }
     }
 
-    private static String format(String property, Object... args) {
-        String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property);
-        return MessageFormat.format(text, args);
-    }
-
     private static ClassLoader getContextClassLoader() {
-        return (ClassLoader)
-                AccessController.doPrivileged(new PrivilegedAction() {
-                    public Object run() {
-                        ClassLoader cl = null;
-                        try {
-                            cl = Thread.currentThread().getContextClassLoader();
-                        } catch (SecurityException ex) {
-                        }
-                        return cl;
-                    }
-                });
+        return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+            @Override
+            public ClassLoader run() {
+                ClassLoader cl = null;
+                try {
+                    cl = Thread.currentThread().getContextClassLoader();
+                } catch (SecurityException ex) {
+                }
+                return cl;
+            }
+        });
     }
 }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.properties	Fri Feb 10 00:39:51 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-#
-# Copyright (c) 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
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0}
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/developer/ContextClassloaderLocal.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/developer/ContextClassloaderLocal.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, 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
@@ -25,10 +25,10 @@
 
 package com.sun.xml.internal.ws.developer;
 
+import com.sun.xml.internal.ws.resources.ContextClassloaderLocalMessages;
+
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.text.MessageFormat;
-import java.util.ResourceBundle;
 import java.util.WeakHashMap;
 
 /**
@@ -36,9 +36,7 @@
  */
 abstract class ContextClassloaderLocal<V> {
 
-    private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE";
-
-    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<ClassLoader, V>();
+    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<>();
 
     public V get() throws Error {
         ClassLoader tccl = getContextClassLoader();
@@ -60,26 +58,21 @@
         try {
             return initialValue();
         } catch (Exception e) {
-            throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e);
+            throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e);
         }
     }
 
-    private static String format(String property, Object... args) {
-        String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property);
-        return MessageFormat.format(text, args);
-    }
-
     private static ClassLoader getContextClassLoader() {
-        return (ClassLoader)
-                AccessController.doPrivileged(new PrivilegedAction() {
-                    public Object run() {
-                        ClassLoader cl = null;
-                        try {
-                            cl = Thread.currentThread().getContextClassLoader();
-                        } catch (SecurityException ex) {
-                        }
-                        return cl;
-                    }
-                });
+        return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+            @Override
+            public ClassLoader run() {
+                ClassLoader cl = null;
+                try {
+                    cl = Thread.currentThread().getContextClassLoader();
+                } catch (SecurityException ex) {
+                }
+                return cl;
+            }
+        });
     }
 }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/Injector.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/Injector.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, 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
@@ -25,12 +25,16 @@
 
 package com.sun.xml.internal.ws.model;
 
+import java.lang.reflect.Field;
 import javax.xml.ws.WebServiceException;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.net.URL;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.security.ProtectionDomain;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -44,31 +48,68 @@
 
     private static final Logger LOGGER = Logger.getLogger(Injector.class.getName());
 
-    private static final Method defineClass;
-    private static final Method resolveClass;
-    private static final Method getPackage;
-    private static final Method definePackage;
+    private static Method defineClass;
+    private static Method resolveClass;
+    private static Method getPackage;
+    private static Method definePackage;
+    private static Object U;
 
     static {
-        Method[] m = AccessController.doPrivileged(
-                new PrivilegedAction<Method[]>() {
+        try {
+            Method[] m = AccessController.doPrivileged(
+                    new PrivilegedAction<Method[]>() {
+                @Override
+                public Method[] run() {
+                    return new Method[]{
+                        getMethod(ClassLoader.class, "defineClass", String.class, byte[].class, Integer.TYPE, Integer.TYPE),
+                        getMethod(ClassLoader.class, "resolveClass", Class.class),
+                        getMethod(ClassLoader.class, "getPackage", String.class),
+                        getMethod(ClassLoader.class, "definePackage",
+                            String.class, String.class, String.class, String.class,
+                            String.class, String.class, String.class, URL.class)
+                    };
+                }
+            }
+            );
+            defineClass = m[0];
+            resolveClass = m[1];
+            getPackage = m[2];
+            definePackage = m[3];
+
+        } catch (Throwable t) {
+            try {
+                U = AccessController.doPrivileged(new PrivilegedExceptionAction() {
                     @Override
-                    public Method[] run() {
-                        return new Method[]{
-                                getMethod(ClassLoader.class, "defineClass", String.class, byte[].class, Integer.TYPE, Integer.TYPE),
-                                getMethod(ClassLoader.class, "resolveClass", Class.class),
-                                getMethod(ClassLoader.class, "getPackage", String.class),
-                                getMethod(ClassLoader.class, "definePackage",
-                                        String.class, String.class, String.class, String.class,
-                                        String.class, String.class, String.class, URL.class)
-                        };
+                    public Object run() throws Exception {
+                        Class u = Class.forName("sun.misc.Unsafe");
+                        Field theUnsafe = u.getDeclaredField("theUnsafe");
+                        theUnsafe.setAccessible(true);
+                        return theUnsafe.get(null);
                     }
-                }
-        );
-        defineClass = m[0];
-        resolveClass = m[1];
-        getPackage = m[2];
-        definePackage = m[3];
+                });
+                defineClass = AccessController.doPrivileged(new PrivilegedExceptionAction<Method>() {
+                    @Override
+                    public Method run() throws Exception {
+                        try {
+                            return U.getClass().getMethod("defineClass",
+                                    new Class[]{String.class,
+                                        byte[].class,
+                                        Integer.TYPE,
+                                        Integer.TYPE,
+                                        ClassLoader.class,
+                                        ProtectionDomain.class});
+                        } catch (NoSuchMethodException | SecurityException ex) {
+                            throw ex;
+                        }
+                    }
+                });
+            } catch (SecurityException | PrivilegedActionException ex) {
+                Logger.getLogger(Injector.class.getName()).log(Level.SEVERE, null, ex);
+                WebServiceException we = new WebServiceException(ex);
+                we.addSuppressed(t);
+                throw we;
+            }
+        }
     }
 
     private static Method getMethod(final Class<?> c, final String methodname, final Class<?>... params) {
@@ -91,24 +132,26 @@
             // nothing to do
         }
         try {
+            if (definePackage == null) {
+                return (Class) defineClass.invoke(U, className.replace('/', '.'), image, 0, image.length, cl, Injector.class.getProtectionDomain());
+            }
             int packIndex = className.lastIndexOf('.');
             if (packIndex != -1) {
                 String pkgname = className.substring(0, packIndex);
                 // Check if package already loaded.
-                Package pkg = (Package)getPackage.invoke(cl, pkgname);
+                Package pkg = (Package) getPackage.invoke(cl, pkgname);
                 if (pkg == null) {
                     definePackage.invoke(cl, pkgname, null, null, null, null, null, null, null);
                 }
             }
 
-            Class c = (Class)defineClass.invoke(cl,className.replace('/','.'),image,0,image.length);
+            Class c = (Class) defineClass.invoke(cl, className.replace('/', '.'), image, 0, image.length);
             resolveClass.invoke(cl, c);
             return c;
-        } catch (IllegalAccessException e) {
-            LOGGER.log(Level.FINE,"Unable to inject "+className,e);
-            throw new WebServiceException(e);
-        } catch (InvocationTargetException e) {
-            LOGGER.log(Level.FINE,"Unable to inject "+className,e);
+        } catch (IllegalAccessException | InvocationTargetException e) {
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Unable to inject " + className, e);
+            }
             throw new WebServiceException(e);
         }
     }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/RuntimeModeler.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/RuntimeModeler.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -346,7 +346,6 @@
     }
 
     private boolean noWrapperGen() {
-        if (Runtime.version().major() >= 9) return true;
         Object o = config.properties().get(SuppressDocLitWrapperGeneration);
         return (o!= null && o instanceof Boolean) ? ((Boolean) o) : false;
     }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -33,6 +33,8 @@
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
 
 /**
  * Creates SOAP specific RuntimeModel
@@ -41,6 +43,8 @@
  */
 public class SOAPSEIModel extends AbstractSEIModelImpl {
 
+        private final Lock lock = new ReentrantLock();
+
     public SOAPSEIModel(WebServiceFeatureList features) {
         super(features);
     }
@@ -72,15 +76,22 @@
 
     public Set<QName> getKnownHeaders() {
         Set<QName> headers = new HashSet<QName>();
-        for (JavaMethodImpl method : getJavaMethods()) {
-            // fill in request headers
-            Iterator<ParameterImpl> params = method.getRequestParameters().iterator();
-            fillHeaders(params, headers, Mode.IN);
+
+        try{
+                lock.lock();
+            for (JavaMethodImpl method : getJavaMethods()) {
+             // fill in request headers
+             Iterator<ParameterImpl> params = method.getRequestParameters().iterator();
+             fillHeaders(params, headers, Mode.IN);
 
             // fill in response headers
-            params = method.getResponseParameters().iterator();
-            fillHeaders(params, headers, Mode.OUT);
-        }
+             params = method.getResponseParameters().iterator();
+             fillHeaders(params, headers, Mode.OUT);
+                          }
+        }finally
+        {
+                lock.unlock();
+         }
         return headers;
     }
 
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, 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
@@ -31,49 +31,22 @@
 import java.util.logging.Logger;
 
 /**
- * Utility class to invoke sun.reflect.misc.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks
+ * Utility class to invoke com.sun.xml.internal.ws.policy.util.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks
  * to java.lang,reflect.Method.invoke()
  */
 class MethodUtil {
 
     private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName());
-    private static final Method INVOKE_METHOD;
-
-    static {
-        Method method;
-        try {
-            Class<?> clazz = Class.forName("sun.reflect.misc.MethodUtil");
-            method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class);
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods.");
-            }
-        } catch (Throwable t) {
-            method = null;
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM");
-            }
-        }
-        INVOKE_METHOD = method;
-    }
 
     static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException {
-        if (INVOKE_METHOD != null) {
-            // sun.reflect.misc.MethodUtil.invoke(method, owner, args)
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil");
-            }
-            try {
-                return INVOKE_METHOD.invoke(null, method, target, args);
-            } catch (InvocationTargetException ite) {
-                // unwrap invocation exception added by reflection code ...
-                throw unwrapException(ite);
-            }
-        } else {
-            // other then Oracle JDK ...
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM");
-            }
-            return method.invoke(target, args);
+        if (LOGGER.isLoggable(Level.FINE)) {
+            LOGGER.log(Level.FINE, "Invoking method using com.sun.xml.internal.ws.policy.util.MethodUtil");
+        }
+        try {
+            return com.sun.xml.internal.ws.policy.util.MethodUtil.invoke(method, target, args);
+        } catch (InvocationTargetException ite) {
+            // unwrap invocation exception added by reflection code ...
+            throw unwrapException(ite);
         }
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/util/MethodUtil.java	Thu Feb 16 13:14:39 2017 +0300
@@ -0,0 +1,293 @@
+/*
+ * Copyright (c) 2017, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.xml.internal.ws.policy.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.security.AccessController;
+import java.security.AllPermission;
+import java.security.CodeSource;
+import java.security.PermissionCollection;
+import java.security.PrivilegedExceptionAction;
+import java.security.SecureClassLoader;
+import java.util.Arrays;
+
+/*
+ * This copies from sun.reflect.misc.MethodUtil to implement the trampoline
+ * code such that when a Method is invoked, it will be called through
+ * the trampoline that is defined by this MethodUtil class loader.
+ */
+class Trampoline {
+    static {
+        if (Trampoline.class.getClassLoader() == null) {
+            throw new Error(
+                    "Trampoline must not be defined by the bootstrap classloader");
+        }
+    }
+
+    private static void ensureInvocableMethod(Method m)
+            throws InvocationTargetException {
+        Class<?> clazz = m.getDeclaringClass();
+        if (clazz.equals(AccessController.class) ||
+                clazz.equals(Method.class) ||
+                clazz.getName().startsWith("java.lang.invoke."))
+            throw new InvocationTargetException(
+                    new UnsupportedOperationException("invocation not supported"));
+    }
+
+    private static Object invoke(Method m, Object obj, Object[] params)
+            throws InvocationTargetException, IllegalAccessException {
+        ensureInvocableMethod(m);
+        return m.invoke(obj, params);
+    }
+}
+
+/*
+ * Create a trampoline class.
+ */
+public final class MethodUtil extends SecureClassLoader {
+    private static final String WS_UTIL_POLICY_PKG = "com.sun.xml.internal.ws.policy.util.";
+    private static final String TRAMPOLINE = WS_UTIL_POLICY_PKG + "Trampoline";
+    private static final Method bounce = getTrampoline();
+    private static final int DEFAULT_BUFFER_SIZE = 8192;
+    private static final int MAX_BUFFER_SIZE = Integer.MAX_VALUE - 8;
+
+
+    private MethodUtil() {
+        super();
+    }
+
+    /*
+     * Bounce through the trampoline.
+     */
+    public static Object invoke(Method m, Object obj, Object[] params)
+            throws InvocationTargetException, IllegalAccessException {
+        try {
+            return bounce.invoke(null, m, obj, params);
+        } catch (InvocationTargetException ie) {
+            Throwable t = ie.getCause();
+
+            if (t instanceof InvocationTargetException) {
+                throw (InvocationTargetException) t;
+            } else if (t instanceof IllegalAccessException) {
+                throw (IllegalAccessException) t;
+            } else if (t instanceof RuntimeException) {
+                throw (RuntimeException) t;
+            } else if (t instanceof Error) {
+                throw (Error) t;
+            } else {
+                throw new Error("Unexpected invocation error", t);
+            }
+        } catch (IllegalAccessException iae) {
+            // this can't happen
+            throw new Error("Unexpected invocation error", iae);
+        }
+    }
+
+    private static Method getTrampoline() {
+        try {
+            return AccessController.doPrivileged(
+                    new PrivilegedExceptionAction<Method>() {
+                        public Method run() throws Exception {
+                            Class<?> t = getTrampolineClass();
+                            Method b = t.getDeclaredMethod("invoke",
+                                    Method.class, Object.class, Object[].class);
+                            b.setAccessible(true);
+                            return b;
+                        }
+                    });
+        } catch (Exception e) {
+            throw new InternalError("bouncer cannot be found", e);
+        }
+    }
+
+
+    protected synchronized Class<?> loadClass(String name, boolean resolve)
+            throws ClassNotFoundException {
+        // First, check if the class has already been loaded
+        checkPackageAccess(name);
+        Class<?> c = findLoadedClass(name);
+        if (c == null) {
+            try {
+                c = findClass(name);
+            } catch (ClassNotFoundException e) {
+                // Fall through ...
+            }
+            if (c == null) {
+                c = getParent().loadClass(name);
+            }
+        }
+        if (resolve) {
+            resolveClass(c);
+        }
+        return c;
+    }
+
+
+    protected Class<?> findClass(final String name)
+            throws ClassNotFoundException {
+        if (!name.startsWith(WS_UTIL_POLICY_PKG)) {
+            throw new ClassNotFoundException(name);
+        }
+        String path = "/".concat(name.replace('.', '/').concat(".class"));
+        try (InputStream in = MethodUtil.class.getResourceAsStream(path)) {
+            byte[] b = readAllBytes(in);
+            return defineClass(name, b);
+        } catch (IOException e) {
+            throw new ClassNotFoundException(name, e);
+        }
+    }
+
+    /**
+     * JDK9 {@link InputStream#readAllBytes()} substitution.
+     */
+    private byte[] readAllBytes(InputStream in) throws IOException {
+        byte[] buf = new byte[DEFAULT_BUFFER_SIZE];
+        int capacity = buf.length;
+        int nread = 0;
+        int n;
+        for (; ; ) {
+            // read to EOF which may read more or less than initial buffer size
+            while ((n = in.read(buf, nread, capacity - nread)) > 0)
+                nread += n;
+
+            // if the last call to read returned -1, then we're done
+            if (n < 0)
+                break;
+
+            // need to allocate a larger buffer
+            if (capacity <= MAX_BUFFER_SIZE - capacity) {
+                capacity = capacity << 1;
+            } else {
+                if (capacity == MAX_BUFFER_SIZE)
+                    throw new OutOfMemoryError("Required array size too large");
+                capacity = MAX_BUFFER_SIZE;
+            }
+            buf = Arrays.copyOf(buf, capacity);
+        }
+        return (capacity == nread) ? buf : Arrays.copyOf(buf, nread);
+    }
+
+
+    /*
+     * Define the proxy classes
+     */
+    private Class<?> defineClass(String name, byte[] b) throws IOException {
+        CodeSource cs = new CodeSource(null, (java.security.cert.Certificate[]) null);
+        if (!name.equals(TRAMPOLINE)) {
+            throw new IOException("MethodUtil: bad name " + name);
+        }
+        return defineClass(name, b, 0, b.length, cs);
+    }
+
+    protected PermissionCollection getPermissions(CodeSource codesource) {
+        PermissionCollection perms = super.getPermissions(codesource);
+        perms.add(new AllPermission());
+        return perms;
+    }
+
+    private static Class<?> getTrampolineClass() {
+        try {
+            return Class.forName(TRAMPOLINE, true, new MethodUtil());
+        } catch (ClassNotFoundException e) {
+        }
+        return null;
+    }
+
+    /**
+     * Checks package access on the given classname.
+     * This method is typically called when the Class instance is not
+     * available and the caller attempts to load a class on behalf
+     * the true caller (application).
+     */
+    private static void checkPackageAccess(String name) {
+        SecurityManager s = System.getSecurityManager();
+        if (s != null) {
+            String cname = name.replace('/', '.');
+            if (cname.startsWith("[")) {
+                int b = cname.lastIndexOf('[') + 2;
+                if (b > 1 && b < cname.length()) {
+                    cname = cname.substring(b);
+                }
+            }
+            int i = cname.lastIndexOf('.');
+            if (i != -1) {
+                s.checkPackageAccess(cname.substring(0, i));
+            }
+        }
+    }
+
+    /**
+     * Checks package access on the given class.
+     * <p>
+     * If it is a {@link Proxy#isProxyClass(Class)} that implements
+     * a non-public interface (i.e. may be in a non-restricted package),
+     * also check the package access on the proxy interfaces.
+     */
+    private static void checkPackageAccess(Class<?> clazz) {
+        checkPackageAccess(clazz.getName());
+        if (isNonPublicProxyClass(clazz)) {
+            checkProxyPackageAccess(clazz);
+        }
+    }
+
+    // Note that bytecode instrumentation tools may exclude 'sun.*'
+    // classes but not generated proxy classes and so keep it in com.sun.*
+    private static final String PROXY_PACKAGE = "com.sun.proxy";
+
+    /**
+     * Test if the given class is a proxy class that implements
+     * non-public interface.  Such proxy class may be in a non-restricted
+     * package that bypasses checkPackageAccess.
+     */
+    private static boolean isNonPublicProxyClass(Class<?> cls) {
+        String name = cls.getName();
+        int i = name.lastIndexOf('.');
+        String pkg = (i != -1) ? name.substring(0, i) : "";
+        return Proxy.isProxyClass(cls) && !pkg.startsWith(PROXY_PACKAGE);
+    }
+
+    /**
+     * Check package access on the proxy interfaces that the given proxy class
+     * implements.
+     *
+     * @param clazz Proxy class object
+     */
+    private static void checkProxyPackageAccess(Class<?> clazz) {
+        SecurityManager s = System.getSecurityManager();
+        if (s != null) {
+            // check proxy interfaces if the given class is a proxy class
+            if (Proxy.isProxyClass(clazz)) {
+                for (Class<?> intf : clazz.getInterfaces()) {
+                    checkPackageAccess(intf);
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/resources/ContextClassloaderLocal.properties	Thu Feb 16 13:14:39 2017 +0300
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2017, 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
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/resources/ContextClassloaderLocalMessages.java	Thu Feb 16 13:14:39 2017 +0300
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2017, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.xml.internal.ws.resources;
+
+import java.util.Locale;
+import java.util.ResourceBundle;
+import javax.annotation.Generated;
+import com.sun.istack.internal.localization.Localizable;
+import com.sun.istack.internal.localization.LocalizableMessageFactory;
+import com.sun.istack.internal.localization.LocalizableMessageFactory.ResourceBundleSupplier;
+import com.sun.istack.internal.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+@Generated("com.sun.istack.internal.maven.ResourceGenMojo")
+public final class ContextClassloaderLocalMessages {
+
+    private final static String BUNDLE_NAME = "com.sun.xml.internal.ws.resources.ContextClassloaderLocal";
+    private final static LocalizableMessageFactory MESSAGE_FACTORY = new LocalizableMessageFactory(BUNDLE_NAME, new ContextClassloaderLocalMessages.BundleSupplier());
+    private final static Localizer LOCALIZER = new Localizer();
+
+    public static Localizable localizableFAILED_TO_CREATE_NEW_INSTANCE(Object arg0) {
+        return MESSAGE_FACTORY.getMessage("FAILED_TO_CREATE_NEW_INSTANCE", arg0);
+    }
+
+    /**
+     * Failed to create new instance of {0}
+     *
+     */
+    public static String FAILED_TO_CREATE_NEW_INSTANCE(Object arg0) {
+        return LOCALIZER.localize(localizableFAILED_TO_CREATE_NEW_INSTANCE(arg0));
+    }
+
+    private static class BundleSupplier
+        implements ResourceBundleSupplier
+    {
+
+
+        public ResourceBundle getResourceBundle(Locale locale) {
+            return ResourceBundle.getBundle(BUNDLE_NAME, locale);
+        }
+
+    }
+
+}
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, 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
@@ -25,10 +25,10 @@
 
 package com.sun.xml.internal.ws.spi;
 
+import com.sun.xml.internal.ws.resources.ContextClassloaderLocalMessages;
+
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.text.MessageFormat;
-import java.util.ResourceBundle;
 import java.util.WeakHashMap;
 
 /**
@@ -36,9 +36,7 @@
  */
 abstract class ContextClassloaderLocal<V> {
 
-    private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE";
-
-    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<ClassLoader, V>();
+    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<>();
 
     public V get() throws Error {
         ClassLoader tccl = getContextClassLoader();
@@ -60,26 +58,21 @@
         try {
             return initialValue();
         } catch (Exception e) {
-            throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e);
+            throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e);
         }
     }
 
-    private static String format(String property, Object... args) {
-        String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property);
-        return MessageFormat.format(text, args);
-    }
-
     private static ClassLoader getContextClassLoader() {
-        return (ClassLoader)
-                AccessController.doPrivileged(new PrivilegedAction() {
-                    public Object run() {
-                        ClassLoader cl = null;
-                        try {
-                            cl = Thread.currentThread().getContextClassLoader();
-                        } catch (SecurityException ex) {
-                        }
-                        return cl;
-                    }
-                });
+        return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+            @Override
+            public ClassLoader run() {
+                ClassLoader cl = null;
+                try {
+                    cl = Thread.currentThread().getContextClassLoader();
+                } catch (SecurityException ex) {
+                }
+                return cl;
+            }
+        });
     }
 }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.properties	Fri Feb 10 00:39:51 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-#
-# Copyright (c) 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
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0}
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -69,13 +69,11 @@
 
 /**
  * Implements {@link Endpoint}.
- * <p/>
- * <p/>
+ *
  * This class accumulates the information necessary to create
  * {@link WSEndpoint}, and then when {@link #publish} method
  * is called it will be created.
- * <p/>
- * <p/>
+ *
  * This object also allows accumulated information to be retrieved.
  *
  * @author Jitendra Kotamraju
@@ -205,14 +203,17 @@
         invoker = null;
     }
 
+    @Override
     public Binding getBinding() {
         return binding;
     }
 
+    @Override
     public Object getImplementor() {
         return implementor;
     }
 
+    @Override
     public void publish(String address) {
         canPublish();
         URL url;
@@ -232,6 +233,7 @@
         ((HttpEndpoint) actualEndpoint).publish(address);
     }
 
+    @Override
     public void publish(Object serverContext) {
         canPublish();
         if (!com.sun.net.httpserver.HttpContext.class.isAssignableFrom(serverContext.getClass())) {
@@ -241,12 +243,14 @@
         ((HttpEndpoint) actualEndpoint).publish(serverContext);
     }
 
+    @Override
     public void publish(HttpContext serverContext) {
         canPublish();
         createEndpoint(serverContext.getPath());
         ((HttpEndpoint) actualEndpoint).publish(serverContext);
     }
 
+    @Override
     public void stop() {
         if (isPublished()) {
             ((HttpEndpoint) actualEndpoint).stop();
@@ -255,14 +259,17 @@
         }
     }
 
+    @Override
     public boolean isPublished() {
         return actualEndpoint != null;
     }
 
+    @Override
     public List<Source> getMetadata() {
         return metadata;
     }
 
+    @Override
     public void setMetadata(java.util.List<Source> metadata) {
         if (isPublished()) {
             throw new IllegalStateException("Cannot set Metadata. Endpoint is already published");
@@ -270,20 +277,24 @@
         this.metadata = metadata;
     }
 
+    @Override
     public Executor getExecutor() {
         return executor;
     }
 
+    @Override
     public void setExecutor(Executor executor) {
         this.executor = executor;
     }
 
+    @Override
     public Map<String, Object> getProperties() {
-        return new HashMap<String, Object>(properties);
+        return new HashMap<>(properties);
     }
 
+    @Override
     public void setProperties(Map<String, Object> map) {
-        this.properties = new HashMap<String, Object>(map);
+        this.properties = new HashMap<>(map);
     }
 
     /*
@@ -335,7 +346,7 @@
      * reuse the Source object multiple times.
      */
     private List<SDDocumentSource> buildDocList() {
-        List<SDDocumentSource> r = new ArrayList<SDDocumentSource>();
+        List<SDDocumentSource> r = new ArrayList<>();
 
         if (metadata != null) {
             for (Source source : metadata) {
@@ -344,14 +355,8 @@
                     String systemId = source.getSystemId();
 
                     r.add(SDDocumentSource.create(new URL(systemId), xsbr.getXMLStreamBuffer()));
-                } catch (TransformerException te) {
+                } catch (TransformerException | IOException | SAXException | ParserConfigurationException te) {
                     throw new ServerRtException("server.rt.err", te);
-                } catch (IOException te) {
-                    throw new ServerRtException("server.rt.err", te);
-                } catch (SAXException e) {
-                    throw new ServerRtException("server.rt.err", e);
-                } catch (ParserConfigurationException e) {
-                    throw new ServerRtException("server.rt.err", e);
                 }
             }
         }
@@ -367,11 +372,6 @@
         EndpointFactory.verifyImplementorClass(implClass, metadataReader);
         String wsdlLocation = EndpointFactory.getWsdlLocation(implClass, metadataReader);
         if (wsdlLocation != null) {
-            ClassLoader cl = implClass.getClassLoader();
-            URL url = cl.getResource(wsdlLocation);
-            if (url != null) {
-                return SDDocumentSource.create(url);
-            }
             return SDDocumentSource.create(implClass, wsdlLocation);
         }
         return null;
@@ -388,10 +388,12 @@
         }
     }
 
+    @Override
     public EndpointReference getEndpointReference(Element...referenceParameters) {
         return getEndpointReference(W3CEndpointReference.class, referenceParameters);
     }
 
+    @Override
     public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element...referenceParameters) {
         if (!isPublished()) {
             throw new WebServiceException("Endpoint is not published yet");
@@ -458,13 +460,12 @@
         public void start(@NotNull WSWebServiceContext wsc, @NotNull WSEndpoint endpoint) {
             try {
                 spiInvoker.inject(wsc);
-            } catch (IllegalAccessException e) {
-                throw new WebServiceException(e);
-            } catch (InvocationTargetException e) {
+            } catch (IllegalAccessException | InvocationTargetException e) {
                 throw new WebServiceException(e);
             }
         }
 
+        @Override
         public Object invoke(@NotNull Packet p, @NotNull Method m, @NotNull Object... args) throws InvocationTargetException, IllegalAccessException {
             return spiInvoker.invoke(m, args);
         }
--- a/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -37,8 +37,8 @@
 import java.util.Set;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.logging.Level;
 import java.util.logging.Logger;
-import java.util.Optional;
 
 
 /**
@@ -49,10 +49,10 @@
 final class ServerMgr {
 
     private static final ServerMgr serverMgr = new ServerMgr();
-    private static final Logger logger =
+    private static final Logger LOGGER =
         Logger.getLogger(
             com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.http");
-    private final Map<InetSocketAddress,ServerState> servers = new HashMap<InetSocketAddress,ServerState>();
+    private final Map<InetSocketAddress,ServerState> servers = new HashMap<>();
 
     private ServerMgr() {}
 
@@ -83,25 +83,26 @@
             synchronized(servers) {
                 state = servers.get(inetAddress);
                 if (state == null) {
-                    final int finalPortNum = port;
-                    Optional<ServerState> stateOpt =
-                               servers.values()
-                                       .stream()
-                                       .filter(s -> s.getServer()
-                                                     .getAddress()
-                                                     .getPort() == finalPortNum)
-                                       .findAny();
-
-                    if (inetAddress.getAddress().isAnyLocalAddress() &&
-                        stateOpt.isPresent()) {
-                        state = stateOpt.get();
+                    ServerState free = null;
+                    for (ServerState ss : servers.values()) {
+                        if (port == ss.getServer().getAddress().getPort()) {
+                            free = ss;
+                            break;
+                        }
+                    }
+                    if (inetAddress.getAddress().isAnyLocalAddress() && free != null) {
+                        state = free;
                     } else {
-                        logger.fine("Creating new HTTP Server at "+inetAddress);
+                        if (LOGGER.isLoggable(Level.FINE)) {
+                            LOGGER.fine("Creating new HTTP Server at "+inetAddress);
+                        }
                         // Creates server with default socket backlog
                         server = HttpServer.create(inetAddress, 0);
                         server.setExecutor(Executors.newCachedThreadPool());
                         String path = url.toURI().getPath();
-                        logger.fine("Creating HTTP Context at = "+path);
+                        if (LOGGER.isLoggable(Level.FINE)) {
+                            LOGGER.fine("Creating HTTP Context at = "+path);
+                        }
                         HttpContext context = server.createContext(path);
                         server.start();
 
@@ -110,7 +111,9 @@
                         // or IP: 0.0.0.0 - which is used to monitor network traffic from any valid IP address
                         inetAddress = server.getAddress();
 
-                        logger.fine("HTTP server started = "+inetAddress);
+                        if (LOGGER.isLoggable(Level.FINE)) {
+                            LOGGER.fine("HTTP server started = "+inetAddress);
+                        }
                         state = new ServerState(server, path);
                         servers.put(inetAddress, state);
                         return context;
@@ -121,11 +124,15 @@
 
             if (state.getPaths().contains(url.getPath())) {
               String err = "Context with URL path "+url.getPath()+ " already exists on the server "+server.getAddress();
-              logger.fine(err);
+              if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.fine(err);
+              }
               throw new IllegalArgumentException(err);
             }
 
-            logger.fine("Creating HTTP Context at = "+url.getPath());
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.fine("Creating HTTP Context at = "+url.getPath());
+            }
             HttpContext context = server.createContext(url.getPath());
             state.oneMoreContext(url.getPath());
             return context;
@@ -157,7 +164,7 @@
     private static final class ServerState {
         private final HttpServer server;
         private int instances;
-        private Set<String> paths = new HashSet<String>();
+        private final Set<String> paths = new HashSet<>();
 
         ServerState(HttpServer server, String path) {
             this.server = server;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/MethodUtil.java	Thu Feb 16 13:14:39 2017 +0300
@@ -0,0 +1,293 @@
+/*
+ * Copyright (c) 2017, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.xml.internal.ws.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.security.AccessController;
+import java.security.AllPermission;
+import java.security.CodeSource;
+import java.security.PermissionCollection;
+import java.security.PrivilegedExceptionAction;
+import java.security.SecureClassLoader;
+import java.util.Arrays;
+
+/*
+ * This copies from sun.reflect.misc.MethodUtil to implement the trampoline
+ * code such that when a Method is invoked, it will be called through
+ * the trampoline that is defined by this MethodUtil class loader.
+ */
+class Trampoline {
+    static {
+        if (Trampoline.class.getClassLoader() == null) {
+            throw new Error(
+                    "Trampoline must not be defined by the bootstrap classloader");
+        }
+    }
+
+    private static void ensureInvocableMethod(Method m)
+            throws InvocationTargetException {
+        Class<?> clazz = m.getDeclaringClass();
+        if (clazz.equals(AccessController.class) ||
+                clazz.equals(Method.class) ||
+                clazz.getName().startsWith("java.lang.invoke."))
+            throw new InvocationTargetException(
+                    new UnsupportedOperationException("invocation not supported"));
+    }
+
+    private static Object invoke(Method m, Object obj, Object[] params)
+            throws InvocationTargetException, IllegalAccessException {
+        ensureInvocableMethod(m);
+        return m.invoke(obj, params);
+    }
+}
+
+/*
+ * Create a trampoline class.
+ */
+public final class MethodUtil extends SecureClassLoader {
+    private static final String WS_UTIL_PKG = "com.sun.xml.internal.ws.util.";
+    private static final String TRAMPOLINE = WS_UTIL_PKG + "Trampoline";
+    private static final Method bounce = getTrampoline();
+    private static final int DEFAULT_BUFFER_SIZE = 8192;
+    private static final int MAX_BUFFER_SIZE = Integer.MAX_VALUE - 8;
+
+
+    private MethodUtil() {
+        super();
+    }
+
+    /*
+     * Bounce through the trampoline.
+     */
+    public static Object invoke(Method m, Object obj, Object[] params)
+            throws InvocationTargetException, IllegalAccessException {
+        try {
+            return bounce.invoke(null, m, obj, params);
+        } catch (InvocationTargetException ie) {
+            Throwable t = ie.getCause();
+
+            if (t instanceof InvocationTargetException) {
+                throw (InvocationTargetException) t;
+            } else if (t instanceof IllegalAccessException) {
+                throw (IllegalAccessException) t;
+            } else if (t instanceof RuntimeException) {
+                throw (RuntimeException) t;
+            } else if (t instanceof Error) {
+                throw (Error) t;
+            } else {
+                throw new Error("Unexpected invocation error", t);
+            }
+        } catch (IllegalAccessException iae) {
+            // this can't happen
+            throw new Error("Unexpected invocation error", iae);
+        }
+    }
+
+    private static Method getTrampoline() {
+        try {
+            return AccessController.doPrivileged(
+                    new PrivilegedExceptionAction<Method>() {
+                        public Method run() throws Exception {
+                            Class<?> t = getTrampolineClass();
+                            Method b = t.getDeclaredMethod("invoke",
+                                    Method.class, Object.class, Object[].class);
+                            b.setAccessible(true);
+                            return b;
+                        }
+                    });
+        } catch (Exception e) {
+            throw new InternalError("bouncer cannot be found", e);
+        }
+    }
+
+
+    protected synchronized Class<?> loadClass(String name, boolean resolve)
+            throws ClassNotFoundException {
+        // First, check if the class has already been loaded
+        checkPackageAccess(name);
+        Class<?> c = findLoadedClass(name);
+        if (c == null) {
+            try {
+                c = findClass(name);
+            } catch (ClassNotFoundException e) {
+                // Fall through ...
+            }
+            if (c == null) {
+                c = getParent().loadClass(name);
+            }
+        }
+        if (resolve) {
+            resolveClass(c);
+        }
+        return c;
+    }
+
+
+    protected Class<?> findClass(final String name)
+            throws ClassNotFoundException {
+        if (!name.startsWith(WS_UTIL_PKG)) {
+            throw new ClassNotFoundException(name);
+        }
+        String path = "/".concat(name.replace('.', '/').concat(".class"));
+        try (InputStream in = MethodUtil.class.getResourceAsStream(path)) {
+            byte[] b = readAllBytes(in);
+            return defineClass(name, b);
+        } catch (IOException e) {
+            throw new ClassNotFoundException(name, e);
+        }
+    }
+
+    /**
+     * JDK9 {@link InputStream#readAllBytes()} substitution.
+     */
+    private byte[] readAllBytes(InputStream in) throws IOException {
+        byte[] buf = new byte[DEFAULT_BUFFER_SIZE];
+        int capacity = buf.length;
+        int nread = 0;
+        int n;
+        for (; ; ) {
+            // read to EOF which may read more or less than initial buffer size
+            while ((n = in.read(buf, nread, capacity - nread)) > 0)
+                nread += n;
+
+            // if the last call to read returned -1, then we're done
+            if (n < 0)
+                break;
+
+            // need to allocate a larger buffer
+            if (capacity <= MAX_BUFFER_SIZE - capacity) {
+                capacity = capacity << 1;
+            } else {