changeset 1615:3f0a3aea44b4 icedtea-3.7.0 icedtea-3.8.0pre00

Merge jdk8u161-b12
author andrew
date Tue, 06 Feb 2018 18:20:55 +0000
parents 588793656d7c (current diff) 225db8a29b5f (diff)
children 0febcbbee5f4
files .hgtags
diffstat 17 files changed, 322 insertions(+), 169 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu Jan 18 04:46:16 2018 +0000
+++ b/.hgtags	Tue Feb 06 18:20:55 2018 +0000
@@ -685,6 +685,8 @@
 d82dd7a24a496e26987caa328d1fb4fc794a4770 jdk8u112-b16
 b97cf465bf9f4b4b9f7c19fabeaa7e54f248451f icedtea-3.3.0pre01
 021da5d50285a523d4622a727ea1a7019f2b52e4 jdk8u112-b31
+4d1398900b3745c3181450e981ed45696a1c97fc jdk8u112-b32
+424b6ee9ade3f63228867933fe8a995880379b97 jdk8u112-b33
 452662a83e5bc6dc7e9425ddd10f6c8fc98d50d8 jdk8u121-b00
 9cd16be39ca6f2c8f7cc99ad07a77bb9d0696c75 jdk8u121-b01
 f092b9a890ceeca4a2f4d55cf7d6f3f113cdb462 jdk8u121-b02
@@ -702,6 +704,12 @@
 5f5237104669ce0a726ffc6769fa29a55b0174a8 icedtea-3.3.0
 30f2a833a54f3c2e8791890ad88a84a581c620d9 icedtea-3.4.0pre01
 5b8834cc3bb9e24153319c766e04e194945a61b9 jdk8u121-b13
+33c7a7def0d76bf508fe4d0a5261027d60bc272f jdk8u121-b31
+c946a5cc042f78c054943783d94cdb403c470e8f jdk8u121-b32
+159698a1ab4171fc9aa11dc43068390a7938c8dd jdk8u121-b33
+69fb2260636bf93b9d47c1699e899cd6e4e62bde jdk8u121-b34
+55de76c196f3efa65b86d4daae842837c9c86d4e jdk8u121-b35
+9e1b967463b26fb48a72fdb016f781d7b607d863 jdk8u121-b36
 2359a73f36ca99ba30aef88a38936f6f4e18e65c jdk8u131-b00
 bc5500cde753aed78c92e7301548fa1450c9b104 jdk8u131-b01
 c146d8a61d677fd4d07778d0295b4e88e16a7dd3 jdk8u131-b02
@@ -716,6 +724,10 @@
 c1bfc2395c57e2ceae8658883356f437ec5ed7c5 icedtea-3.4.0
 18b3704bc51d5b4f7d31faf8e8aebb2f6c69b014 icedtea-3.5.0pre01
 7817f0d2519573e42405ef96a7c7ff1d768f92ec jdk8u131-b11
+a432391b6d676847cf83ddacc1d6e42fc6435ac4 jdk8u131-b31
+cede0cc0bbe9641d70171e062d6b1ed9e52f2ebb jdk8u131-b32
+46788dc162ad09e11da8c4368d3371b06fb7ec63 jdk8u131-b33
+d5c5a205d7fb0a0b906d23e4aaf9dcdbb9ecfe7c jdk8u131-b34
 74aa403ef03d56469e9364cc45c2ec18c6e50e33 jdk8u141-b00
 b1138396b99b1f8ebdb7d28c7143c96eb5b4f991 jdk8u141-b01
 a7b9281956f9616eab0498386b9605853db7b408 jdk8u141-b02
@@ -739,6 +751,14 @@
 4fb91927293516e83de8047c99a71aceeea452e9 icedtea-3.6.0pre01
 768279d73ebb3a96825e365eb6999abaa991c64a icedtea-3.6.0pre02
 d2226ba553ca545f9bf9ffa66254478faca378a2 jdk8u144-b01
+c5788159081fc767d8c73fefde96bc0ad99eee65 jdk8u141-b31
+e6c85f5c962a5039101cd045b5251f2e92312a5f jdk8u141-b32
+c57e086660a37470793e38b94d7abedb79489ce3 jdk8u144-b00
+d2226ba553ca545f9bf9ffa66254478faca378a2 jdk8u144-b01
+3daeca3e0cc20f90e1141038d990778956e2e149 jdk8u144-b31
+1eca5369bc47eecb908e1e818633699b59d12560 jdk8u144-b32
+db9bcdd55081c332f0ec464749e26f501f426b9f jdk8u144-b33
+9c7a086265429c23e4f49f0329eb4f65698492e3 jdk8u144-b34
 eb09a34966f43c62cb286c78c10dc722fd12d884 jdk8u151-b00
 c59814f445e808150326012d911b5b4d8caa025b jdk8u151-b01
 d3dec37780f84151b08c03a6a8cba7d68bde0f80 jdk8u151-b02
@@ -780,3 +800,44 @@
 ef939329cecb82b62d75d76debc5d67246333edd jdk8u152-b14
 199f7d9827f96ee2393f947405473b68372c0757 jdk8u152-b15
 184d3d9543efa5f8a2fc44d7b202e071cae5e980 icedtea-3.7.0pre01
+04128156e506e8375c1c97eafea773317e5719bc jdk8u152-b16
+eb09a34966f43c62cb286c78c10dc722fd12d884 jdk8u151-b00
+c59814f445e808150326012d911b5b4d8caa025b jdk8u151-b01
+d3dec37780f84151b08c03a6a8cba7d68bde0f80 jdk8u151-b02
+32a01bf45f0f32783a5c98e5f68feb9a6e1ffd16 jdk8u161-b00
+4c06ef2757dedeffa5f61acad42c36cbb3496e69 jdk8u151-b03
+04a80aaab394ef20a3cdfcd04f1498349f691738 jdk8u151-b04
+730acb5d508e3cb852c2dae222717aa4593e6bb9 jdk8u151-b05
+2abea38c7ccedf1eabe9245ca9619cd006484a07 jdk8u151-b06
+ea4b3e983ee708f9323d228044176e52526e9e13 jdk8u122-b00
+2e7f62568785adfe695e0c06f2e88c9d369c3b2c jdk8u122-b01
+b97e1b7f3c92b3e9f75e6aa590e0884c3c3ed33f jdk8u122-b02
+30b5b545a78c0c4fee837664f9c70ef6a2b4f0c1 jdk8u122-b03
+30b5b545a78c0c4fee837664f9c70ef6a2b4f0c1 jdk8u122-b03
+0000000000000000000000000000000000000000 jdk8u122-b03
+0000000000000000000000000000000000000000 jdk8u122-b03
+a127c3268266ba1402343d94c7b19355c2dd1bd7 jdk8u122-b03
+c48501ec74b9b03870b473e5bde656fce230fc36 jdk8u122-b04
+f3b3163dda3c6da9339dba99a2ee74645ad2edc6 jdk8u132-b00
+55cb39946f2f163085ca80413b8cd3b3e196e533 jdk8u152-b00
+cf960a33b0e3093abcb48bfe304d471e3b092dc4 jdk8u152-b01
+0b4a7ce47e597b8d33e590857384a478c69a9e6f jdk8u152-b02
+98c698b1b09b6a31d5090a25aff8b7a6edb8d6ba jdk8u152-b03
+bcf7fc55388e4c9d771cd2ad38351a66bfcf27d9 jdk8u152-b04
+388cd26b19dbf7d3102653dd82c27027cd722066 jdk8u152-b05
+199a8d03dde0da505f04c87ff72aabdd7022eec5 jdk8u152-b06
+488a01f4ba30dc2eb7205a2800a37ade74cc3ad1 jdk8u152-b07
+86c8e64c0df3e7f18cc98e820b08dde3b67ffabb jdk8u152-b08
+bedae7043858b1e2cdef09d5dd68f4585320b5df jdk8u152-b09
+32a01bf45f0f32783a5c98e5f68feb9a6e1ffd16 jdk8u161-b00
+d69b55e7aee8c5c9f3a4f73a0bb89943f6dca4fa jdk8u161-b01
+b43391a4015f0c890c90ab33fe03b941876d2ee6 jdk8u161-b02
+d9877e4e1f2b84201aa431e82fce648e69f02e65 jdk8u161-b03
+df10b5ca4d33be24ac11ab2be1810c0368d9eba7 jdk8u161-b04
+1e4379566867606b9b24d4b3708c50f814515c21 jdk8u161-b05
+789b5e487e9c7d16e4fb1117d78dddeda52c8556 jdk8u161-b06
+956306dd4697b96ee33a5e2c6c21956a9a42619f jdk8u161-b07
+b0cea01f48182c91a5851c4c26819ce61a217688 jdk8u161-b08
+0e66110407e3da3297c4526bd849181c6d7ba758 jdk8u161-b09
+d26c2b6db981746f7870e7c246200fb8c70f4c91 jdk8u161-b10
+4c61299e4daf6727d736e23f03ecb2947b3e9609 jdk8u161-b11
--- a/THIRD_PARTY_README	Thu Jan 18 04:46:16 2018 +0000
+++ b/THIRD_PARTY_README	Tue Feb 06 18:20:55 2018 +0000
@@ -7,7 +7,7 @@
 
 --- begin of LICENSE ---
 
-Copyright (c) 2000-2011 France Télécom
+Copyright (c) 2000-2011 France T??l??com
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -849,7 +849,7 @@
 --- begin of LICENSE ---
 
 Copyright notice
-Copyright © 2011 Ecma International
+Copyright ?? 2011 Ecma International
 Ecma International
 Rue du Rhone 114
 CH-1204 Geneva
@@ -916,7 +916,7 @@
 
 --- begin of LICENSE ---
 
-Copyright © 2001,2003 Keith Packard
+Copyright ?? 2001,2003 Keith Packard
 
 Permission to use, copy, modify, distribute, and sell this software and its
 documentation for any purpose is hereby granted without fee, provided that the
@@ -2212,16 +2212,16 @@
 Unicode Terms of Use
 
 For the general privacy policy governing access to this site, see the Unicode
-Privacy Policy. For trademark usage, see the Unicode® Consortium Name and
+Privacy Policy. For trademark usage, see the Unicode?? Consortium Name and
 Trademark Usage Policy.
 
 A. Unicode Copyright.
-   1. Copyright © 1991-2013 Unicode, Inc. All rights reserved.
+   1. Copyright ?? 1991-2013 Unicode, Inc. All rights reserved.
 
    2. Certain documents and files on this website contain a legend indicating
       that "Modification is permitted." Any person is hereby authorized,
       without fee, to modify such documents and files to create derivative
-      works conforming to the Unicode® Standard, subject to Terms and
+      works conforming to the Unicode?? Standard, subject to Terms and
       Conditions herein.
 
     3. Any person is hereby authorized, without fee, to view, use, reproduce,
@@ -2287,14 +2287,14 @@
 
 E.Trademarks & Logos.
    1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode,
-      Inc.  “The Unicode Consortium” and “Unicode, Inc.” are trade names of
+      Inc.  ???The Unicode Consortium??? and ???Unicode, Inc.??? are trade names of
       Unicode, Inc.  Use of the information and materials found on this
-      website indicates your acknowledgement of Unicode, Inc.’s exclusive
+      website indicates your acknowledgement of Unicode, Inc.???s exclusive
       worldwide rights in the Unicode Word Mark, the Unicode Logo, and the
       Unicode trade names.
 
-   2. The Unicode Consortium Name and Trademark Usage Policy (“Trademark
-      Policy”) are incorporated herein by reference and you agree to abide by
+   2. The Unicode Consortium Name and Trademark Usage Policy (???Trademark
+      Policy???) are incorporated herein by reference and you agree to abide by
       the provisions of the Trademark Policy, which may be changed from time
       to time in the sole discretion of Unicode, Inc.
 
@@ -2317,12 +2317,12 @@
 
    2. Modification by Unicode.  Unicode shall have the right to modify this
       Agreement at any time by posting it to this site. The user may not
-      assign any part of this Agreement without Unicode’s prior written
+      assign any part of this Agreement without Unicode???s prior written
       consent.
 
    3. Taxes. The user agrees to pay any taxes arising from access to this
       website or use of the information herein, except for those based on
-      Unicode’s net income.
+      Unicode???s net income.
 
    4. Severability.  If any provision of this Agreement is declared invalid or
       unenforceable, the remaining provisions of this Agreement shall remain
@@ -2351,7 +2351,7 @@
 
 COPYRIGHT AND PERMISSION NOTICE
 
-Copyright © 1991-2012 Unicode, Inc. All rights reserved. Distributed under the
+Copyright ?? 1991-2012 Unicode, Inc. All rights reserved. Distributed under the
 Terms of Use in http://www.unicode.org/copyright.html.
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/marshaller/NoEscapeHandler.java	Tue Feb 06 18:20:55 2018 +0000
@@ -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.
+ */
+
+package com.sun.xml.internal.bind.marshaller;
+
+import java.io.IOException;
+import java.io.Writer;
+
+/**
+ * Performs no character escaping.
+ *
+ * @author
+ *     Roman Grigoriadi (roman.grigoriadi@oracle.com)
+ */
+public class NoEscapeHandler implements CharacterEscapeHandler {
+
+    public static final NoEscapeHandler theInstance = new NoEscapeHandler();
+
+    @Override
+    public void escape(char[] ch, int start, int length, boolean isAttVal, Writer out) throws IOException {
+        out.write(ch, start, length);
+    }
+}
--- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/BridgeImpl.java	Thu Jan 18 04:46:16 2018 +0000
+++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/BridgeImpl.java	Tue Feb 06 18:20:55 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, 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
@@ -76,7 +76,7 @@
 
     public void marshal(Marshaller _m, T t, XMLStreamWriter output) throws JAXBException {
         MarshallerImpl m = (MarshallerImpl)_m;
-        m.write(tagName,bi,t,XMLStreamWriterOutput.create(output,context),new StAXPostInitAction(output,m.serializer));
+        m.write(tagName,bi,t,XMLStreamWriterOutput.create(output,context, m.getEscapeHandler()),new StAXPostInitAction(output,m.serializer));
     }
 
     public void marshal(Marshaller _m, T t, OutputStream output, NamespaceContext nsContext) throws JAXBException {
--- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/MarshallerImpl.java	Thu Jan 18 04:46:16 2018 +0000
+++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/MarshallerImpl.java	Tue Feb 06 18:20:55 2018 +0000
@@ -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
@@ -160,7 +160,7 @@
 
     @Override
     public void marshal(Object obj, XMLStreamWriter writer) throws JAXBException {
-        write(obj, XMLStreamWriterOutput.create(writer,context), new StAXPostInitAction(writer,serializer));
+        write(obj, XMLStreamWriterOutput.create(writer,context, escapeHandler), new StAXPostInitAction(writer,serializer));
     }
 
     @Override
@@ -364,6 +364,15 @@
     }
 
 
+    /**
+     * Returns escape handler provided with JAXB context parameters.
+     *
+     * @return escape handler
+     */
+    CharacterEscapeHandler getEscapeHandler() {
+        return escapeHandler;
+    }
+
     //
     //
     // create XMLWriter by specifing various type of output.
--- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/output/FastInfosetStreamWriterOutput.java	Thu Jan 18 04:46:16 2018 +0000
+++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/output/FastInfosetStreamWriterOutput.java	Tue Feb 06 18:20:55 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, 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,7 @@
 
 package com.sun.xml.internal.bind.v2.runtime.output;
 
+import com.sun.xml.internal.bind.marshaller.NoEscapeHandler;
 import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
 import com.sun.xml.internal.bind.v2.runtime.Name;
 import com.sun.xml.internal.bind.v2.runtime.XMLSerializer;
@@ -220,7 +221,7 @@
 
     public FastInfosetStreamWriterOutput(StAXDocumentSerializer out,
             JAXBContextImpl context) {
-        super(out);
+        super(out, NoEscapeHandler.theInstance);
 
         this.fiout = out;
         this.localNames = context.getUTF8NameTable();
--- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/output/StAXExStreamWriterOutput.java	Thu Jan 18 04:46:16 2018 +0000
+++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/output/StAXExStreamWriterOutput.java	Tue Feb 06 18:20:55 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, 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
@@ -27,6 +27,7 @@
 
 import javax.xml.stream.XMLStreamException;
 
+import com.sun.xml.internal.bind.marshaller.NoEscapeHandler;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data;
 
 import com.sun.xml.internal.org.jvnet.staxex.XMLStreamWriterEx;
@@ -40,7 +41,7 @@
     private final XMLStreamWriterEx out;
 
     public StAXExStreamWriterOutput(XMLStreamWriterEx out) {
-        super(out);
+        super(out, NoEscapeHandler.theInstance);
         this.out = out;
     }
 
--- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/output/XMLStreamWriterOutput.java	Thu Jan 18 04:46:16 2018 +0000
+++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/output/XMLStreamWriterOutput.java	Tue Feb 06 18:20:55 2018 +0000
@@ -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
@@ -26,15 +26,16 @@
 package com.sun.xml.internal.bind.v2.runtime.output;
 
 import java.io.IOException;
+import java.io.Writer;
 import java.lang.reflect.Constructor;
 
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
 
+import com.sun.xml.internal.bind.marshaller.CharacterEscapeHandler;
 import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
 import com.sun.xml.internal.bind.v2.runtime.XMLSerializer;
 
-import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl;
 import org.xml.sax.SAXException;
 
 /**
@@ -53,7 +54,7 @@
      * Creates a new {@link XmlOutput} from a {@link XMLStreamWriter}.
      * This method recognizes an FI StAX writer.
      */
-    public static XmlOutput create(XMLStreamWriter out, JAXBContextImpl context) {
+    public static XmlOutput create(XMLStreamWriter out, JAXBContextImpl context, CharacterEscapeHandler escapeHandler) {
         // try optimized path
         final Class writerClass = out.getClass();
         if (writerClass==FI_STAX_WRITER_CLASS) {
@@ -69,17 +70,26 @@
             }
         }
 
+        CharacterEscapeHandler xmlStreamEscapeHandler = escapeHandler != null ?
+                escapeHandler : NewLineEscapeHandler.theInstance;
+
         // otherwise the normal writer.
-        return new XMLStreamWriterOutput(out);
+        return new XMLStreamWriterOutput(out, xmlStreamEscapeHandler);
     }
 
 
     private final XMLStreamWriter out;
 
+    private final CharacterEscapeHandler escapeHandler;
+
+    private final XmlStreamOutWriterAdapter writerWrapper;
+
     protected final char[] buf = new char[256];
 
-    protected XMLStreamWriterOutput(XMLStreamWriter out) {
+    protected XMLStreamWriterOutput(XMLStreamWriter out, CharacterEscapeHandler escapeHandler) {
         this.out = out;
+        this.escapeHandler = escapeHandler;
+        this.writerWrapper = new XmlStreamOutWriterAdapter(out);
     }
 
     // not called if we are generating fragments
@@ -137,7 +147,7 @@
     public void text(String value, boolean needsSeparatingWhitespace) throws IOException, SAXException, XMLStreamException {
         if(needsSeparatingWhitespace)
             out.writeCharacters(" ");
-        out.writeCharacters(value);
+        escapeHandler.escape(value.toCharArray(), 0, value.length(), false, writerWrapper);
     }
 
     public void text(Pcdata value, boolean needsSeparatingWhitespace) throws IOException, SAXException, XMLStreamException {
@@ -207,4 +217,82 @@
         }
     }
 
+
+    /**
+     * Performs character escaping only for new lines.
+     */
+    private static class NewLineEscapeHandler implements CharacterEscapeHandler {
+
+        public static final NewLineEscapeHandler theInstance = new NewLineEscapeHandler();
+
+        @Override
+        public void escape(char[] ch, int start, int length, boolean isAttVal, Writer out) throws IOException {
+            int limit = start+length;
+            int lastEscaped = start;
+
+            for (int i = start; i < limit; i++) {
+                char c = ch[i];
+                if (c == '\r' || c == '\n') {
+                    if (i != lastEscaped) {
+                        out.write(ch, lastEscaped, i - lastEscaped);
+                    }
+                    lastEscaped = i + 1;
+                    if (out instanceof XmlStreamOutWriterAdapter) {
+                        try {
+                            ((XmlStreamOutWriterAdapter)out).writeEntityRef("#x" + Integer.toHexString(c));
+                        } catch (XMLStreamException e) {
+                            throw new IOException("Error writing xml stream", e);
+                        }
+                    } else {
+                        out.write("&#x");
+                        out.write(Integer.toHexString(c));
+                        out.write(';');
+                    }
+                }
+            }
+            if (lastEscaped != limit) {
+                out.write(ch, lastEscaped, length - lastEscaped);
+            }
+        }
+    }
+
+    private static final class XmlStreamOutWriterAdapter extends Writer {
+
+        private final XMLStreamWriter writer;
+
+        private XmlStreamOutWriterAdapter(XMLStreamWriter writer) {
+            this.writer = writer;
+        }
+
+        @Override
+        public void write(char[] cbuf, int off, int len) throws IOException {
+            try {
+                writer.writeCharacters(cbuf, off, len);
+            } catch (XMLStreamException e) {
+                throw new IOException("Error writing XML stream", e);
+            }
+        }
+
+        public void writeEntityRef(String entityReference) throws XMLStreamException {
+            writer.writeEntityRef(entityReference);
+        }
+
+        @Override
+        public void flush() throws IOException {
+            try {
+                writer.flush();
+            } catch (XMLStreamException e) {
+                throw new IOException("Error flushing XML stream", e);
+            }
+        }
+
+        @Override
+        public void close() throws IOException {
+            try {
+                writer.close();
+            } catch (XMLStreamException e) {
+                throw new IOException("Error closing XML stream", e);
+            }
+        }
+    }
 }
--- a/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/attributeDeclBody.java	Thu Jan 18 04:46:16 2018 +0000
+++ b/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/attributeDeclBody.java	Tue Feb 06 18:20:55 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, 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,22 +25,15 @@
 
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.Attributes;
-import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
 
-    import com.sun.xml.internal.xsom.*;
-    import com.sun.xml.internal.xsom.parser.*;
-    import com.sun.xml.internal.xsom.impl.*;
-    import com.sun.xml.internal.xsom.impl.parser.*;
-    import org.xml.sax.Locator;
-    import org.xml.sax.ContentHandler;
-    import org.xml.sax.helpers.*;
-    import java.util.*;
-    import java.math.BigInteger;
+import com.sun.xml.internal.bind.WhiteSpaceProcessor;
+import com.sun.xml.internal.xsom.impl.*;
+import com.sun.xml.internal.xsom.impl.parser.*;
+import com.sun.xml.internal.xsom.parser.*;
 
-
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
 
 class attributeDeclBody extends NGCCHandler {
     private String name;
@@ -458,7 +451,7 @@
             break;
         case 11:
             {
-                name = $value;
+                name = WhiteSpaceProcessor.collapse($value);
                 $_ngcc_current_state = 10;
             }
             break;
--- a/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/attributeGroupDecl.java	Thu Jan 18 04:46:16 2018 +0000
+++ b/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/attributeGroupDecl.java	Tue Feb 06 18:20:55 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, 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,22 +25,14 @@
 
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.Attributes;
+import com.sun.xml.internal.bind.WhiteSpaceProcessor;
+import com.sun.xml.internal.xsom.impl.*;
 import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
+import com.sun.xml.internal.xsom.parser.*;
 
-    import com.sun.xml.internal.xsom.*;
-    import com.sun.xml.internal.xsom.parser.*;
-    import com.sun.xml.internal.xsom.impl.*;
-    import com.sun.xml.internal.xsom.impl.parser.*;
-    import org.xml.sax.Locator;
-    import org.xml.sax.ContentHandler;
-    import org.xml.sax.helpers.*;
-    import java.util.*;
-    import java.math.BigInteger;
-
-
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
 
 class attributeGroupDecl extends NGCCHandler {
     private AnnotationImpl annotation;
@@ -401,7 +393,7 @@
             break;
         case 12:
             {
-                name = $value;
+                name = WhiteSpaceProcessor.collapse($value);
                 $_ngcc_current_state = 11;
             }
             break;
--- a/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/complexType.java	Thu Jan 18 04:46:16 2018 +0000
+++ b/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/complexType.java	Tue Feb 06 18:20:55 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, 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,22 +25,17 @@
 
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.Attributes;
-import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
 
-    import com.sun.xml.internal.xsom.*;
-    import com.sun.xml.internal.xsom.parser.*;
-    import com.sun.xml.internal.xsom.impl.*;
-    import com.sun.xml.internal.xsom.impl.parser.*;
-    import org.xml.sax.Locator;
-    import org.xml.sax.ContentHandler;
-    import org.xml.sax.helpers.*;
-    import java.util.*;
-    import java.math.BigInteger;
+import com.sun.xml.internal.bind.WhiteSpaceProcessor;
+import com.sun.xml.internal.xsom.*;
+import com.sun.xml.internal.xsom.impl.*;
+import com.sun.xml.internal.xsom.impl.parser.*;
+import com.sun.xml.internal.xsom.parser.*;
 
-
+import java.util.Collections;
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
 
 class complexType extends NGCCHandler {
     private Integer finalValue;
@@ -1683,7 +1678,7 @@
             break;
         case 70:
             {
-                name = $value;
+                name = WhiteSpaceProcessor.collapse($value);
                 $_ngcc_current_state = 69;
             }
             break;
--- a/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/elementDeclBody.java	Thu Jan 18 04:46:16 2018 +0000
+++ b/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/elementDeclBody.java	Tue Feb 06 18:20:55 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, 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,22 +25,18 @@
 
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.Attributes;
-import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
+
+import com.sun.xml.internal.bind.WhiteSpaceProcessor;
+import com.sun.xml.internal.xsom.impl.*;
+import com.sun.xml.internal.xsom.impl.parser.*;
+import com.sun.xml.internal.xsom.parser.*;
 
-    import com.sun.xml.internal.xsom.*;
-    import com.sun.xml.internal.xsom.parser.*;
-    import com.sun.xml.internal.xsom.impl.*;
-    import com.sun.xml.internal.xsom.impl.parser.*;
-    import org.xml.sax.Locator;
-    import org.xml.sax.ContentHandler;
-    import org.xml.sax.helpers.*;
-    import java.util.*;
-    import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
 
-
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
 
 class elementDeclBody extends NGCCHandler {
     private Integer finalValue;
@@ -813,7 +809,7 @@
             break;
         case 22:
             {
-                name = $value;
+                name = WhiteSpaceProcessor.collapse($value);
                 $_ngcc_current_state = 21;
             }
             break;
--- a/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/group.java	Thu Jan 18 04:46:16 2018 +0000
+++ b/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/group.java	Tue Feb 06 18:20:55 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, 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,22 +25,15 @@
 
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.Attributes;
-import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
 
-    import com.sun.xml.internal.xsom.*;
-    import com.sun.xml.internal.xsom.parser.*;
-    import com.sun.xml.internal.xsom.impl.*;
-    import com.sun.xml.internal.xsom.impl.parser.*;
-    import org.xml.sax.Locator;
-    import org.xml.sax.ContentHandler;
-    import org.xml.sax.helpers.*;
-    import java.util.*;
-    import java.math.BigInteger;
+import com.sun.xml.internal.bind.WhiteSpaceProcessor;
+import com.sun.xml.internal.xsom.impl.*;
+import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
+import com.sun.xml.internal.xsom.parser.*;
 
-
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
 
 class group extends NGCCHandler {
     private AnnotationImpl annotation;
@@ -403,7 +396,7 @@
             break;
         case 9:
             {
-                name = $value;
+                name = WhiteSpaceProcessor.collapse($value);
                 $_ngcc_current_state = 8;
             }
             break;
--- a/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/identityConstraint.java	Thu Jan 18 04:46:16 2018 +0000
+++ b/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/identityConstraint.java	Tue Feb 06 18:20:55 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, 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,22 +25,18 @@
 
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.Attributes;
-import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
 
-    import com.sun.xml.internal.xsom.*;
-    import com.sun.xml.internal.xsom.parser.*;
-    import com.sun.xml.internal.xsom.impl.*;
-    import com.sun.xml.internal.xsom.impl.parser.*;
-    import org.xml.sax.Locator;
-    import org.xml.sax.ContentHandler;
-    import org.xml.sax.helpers.*;
-    import java.util.*;
-    import java.math.BigInteger;
+import com.sun.xml.internal.bind.WhiteSpaceProcessor;
+import com.sun.xml.internal.xsom.*;
+import com.sun.xml.internal.xsom.impl.*;
+import com.sun.xml.internal.xsom.impl.parser.*;
+import com.sun.xml.internal.xsom.parser.*;
 
+import java.util.ArrayList;
+import java.util.List;
 
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
 
 class identityConstraint extends NGCCHandler {
     private String name;
@@ -471,7 +467,7 @@
         switch($_ngcc_current_state) {
         case 15:
             {
-                name = $value;
+                name = WhiteSpaceProcessor.collapse($value);
                 $_ngcc_current_state = 14;
             }
             break;
--- a/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/notation.java	Thu Jan 18 04:46:16 2018 +0000
+++ b/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/notation.java	Tue Feb 06 18:20:55 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, 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,22 +25,16 @@
 
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.Attributes;
-import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
 
-    import com.sun.xml.internal.xsom.*;
-    import com.sun.xml.internal.xsom.parser.*;
-    import com.sun.xml.internal.xsom.impl.*;
-    import com.sun.xml.internal.xsom.impl.parser.*;
-    import org.xml.sax.Locator;
-    import org.xml.sax.ContentHandler;
-    import org.xml.sax.helpers.*;
-    import java.util.*;
-    import java.math.BigInteger;
+import com.sun.xml.internal.bind.WhiteSpaceProcessor;
+import com.sun.xml.internal.xsom.*;
+import com.sun.xml.internal.xsom.impl.*;
+import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
+import com.sun.xml.internal.xsom.parser.*;
 
-
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
 
 class notation extends NGCCHandler {
     private String name;
@@ -435,7 +429,7 @@
             break;
         case 13:
             {
-                name = $value;
+                name = WhiteSpaceProcessor.collapse($value);
                 $_ngcc_current_state = 12;
             }
             break;
--- a/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/qname.java	Thu Jan 18 04:46:16 2018 +0000
+++ b/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/qname.java	Tue Feb 06 18:20:55 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, 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,22 +25,12 @@
 
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.Attributes;
+
+import com.sun.xml.internal.bind.WhiteSpaceProcessor;
 import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
 
-    import com.sun.xml.internal.xsom.*;
-    import com.sun.xml.internal.xsom.parser.*;
-    import com.sun.xml.internal.xsom.impl.*;
-    import com.sun.xml.internal.xsom.impl.parser.*;
-    import org.xml.sax.Locator;
-    import org.xml.sax.ContentHandler;
-    import org.xml.sax.helpers.*;
-    import java.util.*;
-    import java.math.BigInteger;
-
-
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
 
 class qname extends NGCCHandler {
     private String qvalue;
@@ -150,7 +140,7 @@
             break;
         case 1:
             {
-                qvalue = $value;
+                qvalue = WhiteSpaceProcessor.collapse($value);
                 $_ngcc_current_state = 0;
             }
             break;
--- a/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/simpleType.java	Thu Jan 18 04:46:16 2018 +0000
+++ b/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/simpleType.java	Tue Feb 06 18:20:55 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, 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,22 +25,21 @@
 
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.Attributes;
+
+import com.sun.xml.internal.bind.WhiteSpaceProcessor;
+import com.sun.xml.internal.xsom.*;
+import com.sun.xml.internal.xsom.impl.*;
 import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
+import com.sun.xml.internal.xsom.parser.*;
 
-    import com.sun.xml.internal.xsom.*;
-    import com.sun.xml.internal.xsom.parser.*;
-    import com.sun.xml.internal.xsom.impl.*;
-    import com.sun.xml.internal.xsom.impl.parser.*;
-    import org.xml.sax.Locator;
-    import org.xml.sax.ContentHandler;
-    import org.xml.sax.helpers.*;
-    import java.util.*;
-    import java.math.BigInteger;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.StringTokenizer;
 
-
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
 
 class simpleType extends NGCCHandler {
     private AnnotationImpl annotation;
@@ -373,7 +372,7 @@
         switch($_ngcc_current_state) {
         case 13:
             {
-                name = $value;
+                name = WhiteSpaceProcessor.collapse($value);
                 $_ngcc_current_state = 12;
             }
             break;