changeset 847:3e508429bac2

Merge
author coffeys
date Tue, 06 Aug 2013 14:01:36 +0100
parents cb54cc83d8be 680bf140cdd5
children 57ccc648d968
files
diffstat 3 files changed, 61 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri Jul 26 13:16:52 2013 +0100
+++ b/.hgtags	Tue Aug 06 14:01:36 2013 +0100
@@ -334,3 +334,5 @@
 ce771024e07d2bb6521735a14ce68745a2376bd8 jdk7u40-b33
 23ba797b9e78231806d837f7fb4f9feef6dcd61a jdk7u40-b34
 4056df34b559b904edc9f94a323769f19cf8f426 jdk7u40-b35
+07024f18376ce9597ec8679ebcb9f2efdc5afab0 jdk7u40-b36
+f40f45bd95d4140f691c03132f2ab2c8a0233a8f jdk7u40-b37
--- a/THIRD_PARTY_README	Fri Jul 26 13:16:52 2013 +0100
+++ b/THIRD_PARTY_README	Tue Aug 06 14:01:36 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	Fri Jul 26 13:16:52 2013 +0100
+++ b/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java	Tue Aug 06 14:01:36 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);