Author: mrglavas
Date: Tue Sep 4 06:31:09 2012
New Revision: 1380456
URL: http://svn.apache.org/viewvc?rev=1380456&view=rev
Log:
JIRA Issue #1583: https://issues.apache.org/jira/browse/XERCESJ-1583. Fixing an
NPE. Before processing the 'inheritable' attribute first check that we're in
XML Schema 1.1 mode.
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java?rev=1380456&r1=1380455&r2=1380456&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java
Tue Sep 4 06:31:09 2012
@@ -140,11 +140,16 @@ class XSDAttributeTraverser extends XSDA
attrUse.fDefault.normalizedValue = defaultAtt;
}
- if (attrDecl.getAttributeNode(SchemaSymbols.ATT_INHERITABLE) !=
null) {
- attrUse.fInheritable = inheritableAtt.booleanValue();
+ if (fSchemaHandler.fSchemaVersion >= Constants.SCHEMA_VERSION_1_1)
{
+ if (attrDecl.getAttributeNode(SchemaSymbols.ATT_INHERITABLE)
!= null) {
+ attrUse.fInheritable = inheritableAtt.booleanValue();
+ }
+ else {
+ attrUse.fInheritable = attribute.getInheritable();
+ }
}
else {
- attrUse.fInheritable = attribute.getInheritable();
+ attrUse.fInheritable = false;
}
// Get the annotation associated with the local attr decl
@@ -386,7 +391,7 @@ class XSDAttributeTraverser extends XSDA
boolean inheritable = false;
if (inheritableAtt != null) {
- inheritable = inheritableAtt.booleanValue();
+ inheritable = inheritableAtt.booleanValue();
}
attribute.setValues(nameAtt, tnsAtt, attrType, constraintType, scope,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]