Mercurial > hg > release > icedtea7-forest-2.4 > jaxp
changeset 719:90b1dbd6baf6
Merge jdk7u40-b40
author | andrew |
---|---|
date | Wed, 21 Aug 2013 14:21:20 +0100 |
parents | 7d8341df70fe (current diff) 6ea57bdf6030 (diff) |
children | 135f46e0e653 |
files | .hgtags src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java |
diffstat | 6 files changed, 94 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Wed Jul 24 21:31:46 2013 +0100 +++ b/.hgtags Wed Aug 21 14:21:20 2013 +0100 @@ -296,7 +296,9 @@ bf2d62ea518d5e4130e442e07705e7a50b821ad9 jdk7u21-b10 3e0e331bdfb8f3adfd0cc78118e0ac588e73a2b5 jdk7u21-b11 980fe893d8fd86d8aee14771167b6e0ac75fa208 jdk7u21-b30 +a320a590b4cac6eeff53829bde520ef46880b006 jdk7u21-b50 a320a590b4cac6eeff53829bde520ef46880b006 jdk7u21-b12 +19b243d00f7740072d051d3fb531f01083cbe999 jdk7u21-b31 5704dc942da676677a820d16c9a08fc6cad5b3bb jdk7u25-b01 f9c1fe7cd1194e785807f07005369631b35b28d8 jdk7u25-b02 fe858d7d6a13829d0ef0a1f762bd0e769cd24fa1 jdk7u25-b03 @@ -312,6 +314,9 @@ 83b80c094befd08cbac4247d9b8f12c6a039f23f jdk7u25-b13 68cc0d2a49f09b5c611b2775f2e66de1022bdedc jdk7u25-b14 503f75b55b34ae22f43b2992b1e56c96e35a60de jdk7u25-b15 +35710c8bd73dbfdd4805e8b3c506f500daf553c7 jdk7u25-b31 +c02dbd8fd8ca142e3987537f7ac43da361fcf9d4 jdk7u25-b33 +ebe5d88948e9f2fd707c808eceb9343f4f32e122 jdk7u25-b34 8c35f2344beeb42e85d718e95813e6fdc2f0a605 jdk7u25-b30 9cebeb3118aca6e356f80a37ac38088ddcc8fb73 jdk7u25-b16 0d4cfe518086198516e6729fc28b161f66524a66 jdk7u25-b32 @@ -337,3 +342,9 @@ 5b31380e2e0b6f8386dcf0ca122461154f2d2704 jdk7u40-b31 75bb397c4ae26c384e1fcb75bbf4b70479f2c5f7 jdk7u40-b32 ce771024e07d2bb6521735a14ce68745a2376bd8 jdk7u40-b33 +23ba797b9e78231806d837f7fb4f9feef6dcd61a jdk7u40-b34 +4056df34b559b904edc9f94a323769f19cf8f426 jdk7u40-b35 +07024f18376ce9597ec8679ebcb9f2efdc5afab0 jdk7u40-b36 +f40f45bd95d4140f691c03132f2ab2c8a0233a8f jdk7u40-b37 +680bf140cdd58e7878318ecafc41c9db47ebfacd jdk7u40-b38 +322af0a5cdce6cad8421a73c1b9af345361dfba0 jdk7u40-b39
--- a/THIRD_PARTY_README Wed Jul 24 21:31:46 2013 +0100 +++ b/THIRD_PARTY_README Wed Aug 21 14:21:20 2013 +0100 @@ -1912,6 +1912,35 @@ ------------------------------------------------------------------------------- +%% This notice is provided with respect to Sparkle v.1.5, +which is included with JRE 7 on Mac OS X. + +--- begin of LICENSE --- + +Copyright (c) 2012 Sparkle.org and Andy Matuschak + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + %% Portions licensed from Taligent, Inc. ------------------------------------------------------------------------------- @@ -3169,12 +3198,12 @@ %% This notice is provided with respect to the following which is included with JRE 7, JDK 7, and OpenJDK 7, except where noted: - Apache Derby 10.8.1.2 [included with JDK 7 only] + Apache Derby 10.8.3.0 [included with JDK 7 only] Apache Jakarta BCEL 5.2 Apache Jakarta Regexp 1.4 Apache Santuario XMLSec-Java 1.4.2 Apache Xalan-Java 2.7.1 - Apache Xerces2 Java 2.10.0 + Apache Xerces2 Java 2.11.0 Apache XML Resolver 1.1
--- a/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java Wed Jul 24 21:31:46 2013 +0100 +++ b/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java Wed Aug 21 14:21:20 2013 +0100 @@ -112,7 +112,7 @@ /** Initial EntityResolver */ private final EntityResolver fInitEntityResolver; - private XMLSecurityPropertyManager fSecurityPropertyMgr; + private final XMLSecurityPropertyManager fSecurityPropertyMgr; /** * Create a SAX parser with the associated features @@ -130,8 +130,10 @@ SAXParserImpl(SAXParserFactoryImpl spf, Hashtable features, boolean secureProcessing) throws SAXException { + fSecurityPropertyMgr = new XMLSecurityPropertyManager(); + // Instantiate a SAXParser directly and not through SAX so that we use the right ClassLoader - xmlReader = new JAXPSAXParser(this); + xmlReader = new JAXPSAXParser(this, fSecurityPropertyMgr); // JAXP "namespaceAware" == SAX Namespaces feature // Note: there is a compatibility problem here with default values: @@ -150,7 +152,6 @@ xmlReader.setFeature0(XINCLUDE_FEATURE, true); } - fSecurityPropertyMgr = new XMLSecurityPropertyManager(); xmlReader.setProperty0(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr); // If the secure processing feature is on set a security manager. @@ -397,14 +398,32 @@ private final HashMap fInitFeatures = new HashMap(); private final HashMap fInitProperties = new HashMap(); private final SAXParserImpl fSAXParser; + private XMLSecurityPropertyManager fSecurityPropertyMgr; + public JAXPSAXParser() { - this(null); + this(null, null); } - JAXPSAXParser(SAXParserImpl saxParser) { + JAXPSAXParser(SAXParserImpl saxParser, XMLSecurityPropertyManager spm) { super(); fSAXParser = saxParser; + fSecurityPropertyMgr = spm; + + /** + * This class may be used directly. So initialize the security manager if + * it is null. + */ + if (fSecurityPropertyMgr == null) { + fSecurityPropertyMgr = new XMLSecurityPropertyManager(); + try { + super.setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr); + } catch (SAXException e) { + throw new UnsupportedOperationException( + SAXMessageFormatter.formatMessage(fConfiguration.getLocale(), + "property-not-recognized", new Object [] {SECURITY_MANAGER}), e); + } + } } /** @@ -542,9 +561,9 @@ setSchemaValidatorProperty(name, value); } /** Check to see if the property is managed by the property manager **/ - int index = fSAXParser.fSecurityPropertyMgr.getIndex(name); + int index = (fSecurityPropertyMgr != null) ? fSecurityPropertyMgr.getIndex(name) : -1; if (index > -1) { - fSAXParser.fSecurityPropertyMgr.setValue(index, + fSecurityPropertyMgr.setValue(index, XMLSecurityPropertyManager.State.APIPROPERTY, (String)value); } else { if (!fInitProperties.containsKey(name)) { @@ -564,9 +583,9 @@ // JAXP 1.2 support return fSAXParser.schemaLanguage; } - int index = fSAXParser.fSecurityPropertyMgr.getIndex(name); + int index = (fSecurityPropertyMgr != null) ? fSecurityPropertyMgr.getIndex(name) : -1; if (index > -1) { - return fSAXParser.fSecurityPropertyMgr.getValueByIndex(index); + return fSecurityPropertyMgr.getValueByIndex(index); } return super.getProperty(name);
--- a/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java Wed Jul 24 21:31:46 2013 +0100 +++ b/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java Wed Aug 21 14:21:20 2013 +0100 @@ -38,6 +38,7 @@ import com.sun.org.apache.xerces.internal.util.PropertyState; import com.sun.org.apache.xerces.internal.util.Status; import com.sun.org.apache.xerces.internal.util.SymbolTable; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.XMLLocator; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; @@ -184,6 +185,10 @@ protected static final String LOCALE = Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY; + /** Property identifier: Security property manager. */ + protected static final String XML_SECURITY_PROPERTY_MANAGER = + Constants.XML_SECURITY_PROPERTY_MANAGER; + // debugging /** Set to true and recompile to print exception stack trace. */ @@ -328,7 +333,8 @@ VALIDATION_MANAGER, JAXP_SCHEMA_SOURCE, JAXP_SCHEMA_LANGUAGE, - LOCALE + LOCALE, + XML_SECURITY_PROPERTY_MANAGER }; addRecognizedProperties(recognizedProperties); @@ -406,6 +412,7 @@ // REVISIT: What is the right thing to do? -Ac } + setProperty(XML_SECURITY_PROPERTY_MANAGER, new XMLSecurityPropertyManager()); } // <init>(SymbolTable,XMLGrammarPool) //
--- a/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java Wed Jul 24 21:31:46 2013 +0100 +++ b/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java Wed Aug 21 14:21:20 2013 +0100 @@ -36,6 +36,7 @@ import com.sun.org.apache.xerces.internal.util.PropertyState; import com.sun.org.apache.xerces.internal.util.Status; import com.sun.org.apache.xerces.internal.util.SymbolTable; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.XMLLocator; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; @@ -157,6 +158,10 @@ protected static final String LOCALE = Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY; + /** Property identifier: Security property manager. */ + protected static final String XML_SECURITY_PROPERTY_MANAGER = + Constants.XML_SECURITY_PROPERTY_MANAGER; + // debugging /** Set to true and recompile to print exception stack trace. */ @@ -310,7 +315,8 @@ XMLGRAMMAR_POOL, DATATYPE_VALIDATOR_FACTORY, VALIDATION_MANAGER, - LOCALE + LOCALE, + XML_SECURITY_PROPERTY_MANAGER }; addRecognizedProperties(recognizedProperties); @@ -367,6 +373,7 @@ // REVISIT: What is the right thing to do? -Ac } + setProperty(XML_SECURITY_PROPERTY_MANAGER, new XMLSecurityPropertyManager()); } // <init>(SymbolTable,XMLGrammarPool) //
--- a/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java Wed Jul 24 21:31:46 2013 +0100 +++ b/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java Wed Aug 21 14:21:20 2013 +0100 @@ -76,6 +76,7 @@ XMLGRAMMAR_POOL, }; + XMLSecurityPropertyManager securityPropertyManager; // // Constructors // @@ -129,16 +130,19 @@ */ public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { - XMLSecurityPropertyManager spm = new XMLSecurityPropertyManager(); - int index = spm.getIndex(name); + if (securityPropertyManager == null) { + securityPropertyManager = new XMLSecurityPropertyManager(); + } + int index = securityPropertyManager.getIndex(name); + if (index > -1) { /** * this is a direct call to this parser, not a subclass since * internally the support of this property is done through * XMLSecurityPropertyManager */ - spm.setValue(index, XMLSecurityPropertyManager.State.APIPROPERTY, (String)value); - super.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, spm); + securityPropertyManager.setValue(index, XMLSecurityPropertyManager.State.APIPROPERTY, (String)value); + super.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager); } else { super.setProperty(name, value); }