src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/xml/XMLMessage.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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

@@ -324,11 +324,11 @@
         public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException {
             getMessage().writeTo(contentHandler, errorHandler);
         }
 
         public Message copy() {
-            return getMessage().copy();
+            return getMessage().copy().copyFrom(getMessage());
         }
 
         protected void writePayloadTo(ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) throws SAXException {
             throw new UnsupportedOperationException();
         }

@@ -447,11 +447,11 @@
         public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException {
             getMessage().writeTo(contentHandler, errorHandler);
         }
 
         public Message copy() {
-            return getMessage().copy();
+            return getMessage().copy().copyFrom(getMessage());
         }
 
         protected void writePayloadTo(ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) throws SAXException {
             throw new UnsupportedOperationException();
         }

@@ -505,10 +505,11 @@
          */
         private UnknownContent(UnknownContent that) {
             super(that.soapVersion);
             this.ds = that.ds;
             this.headerList = HeaderList.copy(that.headerList);
+            this.copyFrom(that);
         }
 
         public boolean hasUnconsumedDataSource() {
             return true;
         }

@@ -558,11 +559,11 @@
         public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException {
             // No XML. Nothing to do
         }
 
         public Message copy() {
-            return new UnknownContent(this);
+            return new UnknownContent(this).copyFrom(this);
         }
 
     }
 
     public static DataSource getDataSource(Message msg, WSFeatureList f) {