Mercurial > hg > release > icedtea7-forest-2.6 > jaxws
changeset 1099:e24556d88882 jdk7u80-b03
Merge
author | lana |
---|---|
date | Wed, 15 Oct 2014 10:09:52 -0700 |
parents | fea1db443eb1 (current diff) 3c37fddd70d6 (diff) |
children | aaa0e97579b6 2b8438680e29 |
files | |
diffstat | 2 files changed, 18 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/ContentHandlerAdaptor.java Tue Oct 07 12:51:37 2014 -0700 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/ContentHandlerAdaptor.java Wed Oct 15 10:09:52 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, 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 @@ -25,10 +25,6 @@ package com.sun.xml.internal.bind.v2.runtime; -import java.io.IOException; - -import javax.xml.stream.XMLStreamException; - import com.sun.istack.internal.FinalArrayList; import com.sun.istack.internal.SAXException2; @@ -36,6 +32,9 @@ import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; +import javax.xml.stream.XMLStreamException; +import java.io.IOException; + /** * Receives SAX2 events and send the equivalent events to * {@link XMLSerializer} @@ -70,14 +69,14 @@ private boolean containsPrefixMapping(String prefix, String uri) { for( int i=0; i<prefixMap.size(); i+=2 ) { if(prefixMap.get(i).equals(prefix) - && prefixMap.get(i+1).equals(uri)) + && prefixMap.get(i+1).equals(uri)) return true; } return false; } public void startElement(String namespaceURI, String localName, String qName, Attributes atts) - throws SAXException { + throws SAXException { try { flushText(); @@ -92,13 +91,13 @@ serializer.startElement(namespaceURI,localName, p,null); // declare namespace events - for( int i=0; i<prefixMap.size(); i+=2 ) { + for (int i = 0; i < prefixMap.size(); i += 2) { // forcibly set this binding, instead of using declareNsUri. // this guarantees that namespaces used in DOM will show up // as-is in the marshalled output (instead of reassigned to something else, // which may happen if you'd use declareNsUri.) serializer.getNamespaceContext().force( - prefixMap.get(i+1), prefixMap.get(i) ); + prefixMap.get(i + 1), prefixMap.get(i)); } // make sure namespaces needed by attributes are bound for( int i=0; i<len; i++ ) { @@ -108,7 +107,7 @@ String prefix = getPrefix(qname); serializer.getNamespaceContext().declareNamespace( - atts.getURI(i), prefix, true ); + atts.getURI(i), prefix, true ); } serializer.endNamespaceDecls(null); @@ -128,9 +127,10 @@ } } + // make sure namespaces needed by attributes are bound private String getPrefix(String qname) { int idx = qname.indexOf(':'); - String prefix = (idx==-1)?qname:qname.substring(0,idx); + String prefix = (idx == -1) ? "" : qname.substring(0, idx); return prefix; }
--- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXStreamConnector.java Tue Oct 07 12:51:37 2014 -0700 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXStreamConnector.java Wed Oct 15 10:09:52 2014 -0700 @@ -70,7 +70,7 @@ // Quick hack until SJSXP fixes 6270116 boolean isZephyr = readerClass.getName().equals("com.sun.xml.internal.stream.XMLReaderImpl"); if (getBoolProp(reader,"org.codehaus.stax2.internNames") && - getBoolProp(reader,"org.codehaus.stax2.internNsUris")) + getBoolProp(reader,"org.codehaus.stax2.internNsUris")) ; // no need for interning else if (isZephyr) @@ -219,8 +219,8 @@ int nsCount = staxStreamReader.getNamespaceCount(); for (int i = 0; i < nsCount; i++) { visitor.startPrefixMapping( - fixNull(staxStreamReader.getNamespacePrefix(i)), - fixNull(staxStreamReader.getNamespaceURI(i))); + fixNull(staxStreamReader.getNamespacePrefix(i)), + fixNull(staxStreamReader.getNamespaceURI(i))); } // fire startElement @@ -310,13 +310,13 @@ protected void handleCharacters() throws XMLStreamException, SAXException { if( predictor.expectText() ) buffer.append( - staxStreamReader.getTextCharacters(), - staxStreamReader.getTextStart(), - staxStreamReader.getTextLength() ); + staxStreamReader.getTextCharacters(), + staxStreamReader.getTextStart(), + staxStreamReader.getTextLength() ); } private void processText( boolean ignorable ) throws SAXException { - if( predictor.expectText() && (!ignorable || !WhiteSpaceProcessor.isWhiteSpace(buffer))) { + if( predictor.expectText() && (!ignorable || !WhiteSpaceProcessor.isWhiteSpace(buffer) || context.getCurrentState().isMixed())) { if(textReported) { textReported = false; } else {