diff options
Diffstat (limited to 'src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj')
-rw-r--r-- | src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java | 30 | ||||
-rw-r--r-- | src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java | 33 |
2 files changed, 11 insertions, 52 deletions
diff --git a/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java b/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java index 034629e8..bd6727f0 100644 --- a/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java +++ b/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java @@ -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 @@ -47,13 +47,13 @@ public abstract class DetailImpl extends FaultElementImpl implements Detail { public DetailEntry addDetailEntry(Name name) throws SOAPException { DetailEntry entry = createDetailEntry(name); addNode(entry); - return (DetailEntry) circumventBug5034339(entry); + return entry; } public DetailEntry addDetailEntry(QName qname) throws SOAPException { DetailEntry entry = createDetailEntry(qname); addNode(entry); - return (DetailEntry) circumventBug5034339(entry); + return entry; } protected SOAPElement addElement(Name name) throws SOAPException { @@ -119,28 +119,4 @@ public abstract class DetailImpl extends FaultElementImpl implements Detail { return true; } - //overriding this method since the only two uses of this method - // are in ElementImpl and DetailImpl - //whereas the original base impl does the correct job for calls to it inside ElementImpl - // But it would not work for DetailImpl. - protected SOAPElement circumventBug5034339(SOAPElement element) { - - Name elementName = element.getElementName(); - if (!isNamespaceQualified(elementName)) { - String prefix = elementName.getPrefix(); - String defaultNamespace = getNamespaceURI(prefix); - if (defaultNamespace != null) { - Name newElementName = - NameImpl.create( - elementName.getLocalName(), - elementName.getPrefix(), - defaultNamespace); - SOAPElement newElement = createDetailEntry(newElementName); - replaceChild(newElement, element); - return newElement; - } - } - return element; - } - } diff --git a/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java b/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java index fc2dcfee..6b833370 100644 --- a/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java +++ b/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java @@ -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 @@ -127,8 +127,11 @@ public class ElementImpl } public SOAPElement addChildElement(String localName) throws SOAPException { - return (SOAPElement) addChildElement( - NameImpl.createFromUnqualifiedName(localName)); + String nsUri = getNamespaceURI(""); + Name name = (nsUri == null || nsUri.isEmpty()) + ? NameImpl.createFromUnqualifiedName(localName) + : NameImpl.createFromQualifiedName(localName, nsUri); + return addChildElement(name); } public SOAPElement addChildElement(String localName, String prefix) @@ -372,13 +375,13 @@ public class ElementImpl protected SOAPElement addElement(Name name) throws SOAPException { SOAPElement newElement = createElement(name); addNode(newElement); - return circumventBug5034339(newElement); + return newElement; } protected SOAPElement addElement(QName name) throws SOAPException { SOAPElement newElement = createElement(name); addNode(newElement); - return circumventBug5034339(newElement); + return newElement; } protected SOAPElement createElement(Name name) { @@ -1201,26 +1204,6 @@ public class ElementImpl return !"".equals(name.getNamespaceURI()); } - protected SOAPElement circumventBug5034339(SOAPElement element) { - - Name elementName = element.getElementName(); - if (!isNamespaceQualified(elementName)) { - String prefix = elementName.getPrefix(); - String defaultNamespace = getNamespaceURI(prefix); - if (defaultNamespace != null) { - Name newElementName = - NameImpl.create( - elementName.getLocalName(), - elementName.getPrefix(), - defaultNamespace); - SOAPElement newElement = createElement(newElementName); - replaceChild(newElement, element); - return newElement; - } - } - return element; - } - //TODO: This is a temporary SAAJ workaround for optimizing XWS // should be removed once the corresponding JAXP bug is fixed // It appears the bug will be fixed in JAXP 1.4 (not by Appserver 9 timeframe) |