Skip to content

Commit 49d683b

Browse files
author
Lana Steuck
committed
Merge
2 parents bcda508 + 262e9ca commit 49d683b

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

jaxp/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import com.sun.org.apache.xerces.internal.util.PropertyState;
3939
import com.sun.org.apache.xerces.internal.util.Status;
4040
import com.sun.org.apache.xerces.internal.util.SymbolTable;
41+
import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
4142
import com.sun.org.apache.xerces.internal.xni.XMLLocator;
4243
import com.sun.org.apache.xerces.internal.xni.XNIException;
4344
import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
@@ -184,6 +185,10 @@ public class DTDConfiguration
184185
protected static final String LOCALE =
185186
Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY;
186187

188+
/** Property identifier: Security property manager. */
189+
protected static final String XML_SECURITY_PROPERTY_MANAGER =
190+
Constants.XML_SECURITY_PROPERTY_MANAGER;
191+
187192
// debugging
188193

189194
/** Set to true and recompile to print exception stack trace. */
@@ -328,7 +333,8 @@ public DTDConfiguration(SymbolTable symbolTable,
328333
VALIDATION_MANAGER,
329334
JAXP_SCHEMA_SOURCE,
330335
JAXP_SCHEMA_LANGUAGE,
331-
LOCALE
336+
LOCALE,
337+
XML_SECURITY_PROPERTY_MANAGER
332338
};
333339
addRecognizedProperties(recognizedProperties);
334340

@@ -406,6 +412,7 @@ public DTDConfiguration(SymbolTable symbolTable,
406412
// REVISIT: What is the right thing to do? -Ac
407413
}
408414

415+
setProperty(XML_SECURITY_PROPERTY_MANAGER, new XMLSecurityPropertyManager());
409416
} // <init>(SymbolTable,XMLGrammarPool)
410417

411418
//

jaxp/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import com.sun.org.apache.xerces.internal.util.PropertyState;
3737
import com.sun.org.apache.xerces.internal.util.Status;
3838
import com.sun.org.apache.xerces.internal.util.SymbolTable;
39+
import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
3940
import com.sun.org.apache.xerces.internal.xni.XMLLocator;
4041
import com.sun.org.apache.xerces.internal.xni.XNIException;
4142
import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
@@ -157,6 +158,10 @@ public class NonValidatingConfiguration
157158
protected static final String LOCALE =
158159
Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY;
159160

161+
/** Property identifier: Security property manager. */
162+
protected static final String XML_SECURITY_PROPERTY_MANAGER =
163+
Constants.XML_SECURITY_PROPERTY_MANAGER;
164+
160165
// debugging
161166

162167
/** Set to true and recompile to print exception stack trace. */
@@ -310,7 +315,8 @@ public NonValidatingConfiguration(SymbolTable symbolTable,
310315
XMLGRAMMAR_POOL,
311316
DATATYPE_VALIDATOR_FACTORY,
312317
VALIDATION_MANAGER,
313-
LOCALE
318+
LOCALE,
319+
XML_SECURITY_PROPERTY_MANAGER
314320
};
315321
addRecognizedProperties(recognizedProperties);
316322

@@ -367,6 +373,7 @@ public NonValidatingConfiguration(SymbolTable symbolTable,
367373
// REVISIT: What is the right thing to do? -Ac
368374
}
369375

376+
setProperty(XML_SECURITY_PROPERTY_MANAGER, new XMLSecurityPropertyManager());
370377
} // <init>(SymbolTable,XMLGrammarPool)
371378

372379
//

jaxp/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public class SAXParser
7676
XMLGRAMMAR_POOL,
7777
};
7878

79+
XMLSecurityPropertyManager securityPropertyManager;
7980
//
8081
// Constructors
8182
//
@@ -129,16 +130,19 @@ public SAXParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) {
129130
*/
130131
public void setProperty(String name, Object value)
131132
throws SAXNotRecognizedException, SAXNotSupportedException {
132-
XMLSecurityPropertyManager spm = new XMLSecurityPropertyManager();
133-
int index = spm.getIndex(name);
133+
if (securityPropertyManager == null) {
134+
securityPropertyManager = new XMLSecurityPropertyManager();
135+
}
136+
int index = securityPropertyManager.getIndex(name);
137+
134138
if (index > -1) {
135139
/**
136140
* this is a direct call to this parser, not a subclass since
137141
* internally the support of this property is done through
138142
* XMLSecurityPropertyManager
139143
*/
140-
spm.setValue(index, XMLSecurityPropertyManager.State.APIPROPERTY, (String)value);
141-
super.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, spm);
144+
securityPropertyManager.setValue(index, XMLSecurityPropertyManager.State.APIPROPERTY, (String)value);
145+
super.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager);
142146
} else {
143147
super.setProperty(name, value);
144148
}

0 commit comments

Comments
 (0)