[
https://issues.apache.org/jira/browse/XERCESJ-1500?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
David Costanzo updated XERCESJ-1500:
------------------------------------
Fix Version/s: 2.12.0
> ArrayIndexOutOfBoundsException in SchemaGrammar
> -----------------------------------------------
>
> Key: XERCESJ-1500
> URL: https://issues.apache.org/jira/browse/XERCESJ-1500
> Project: Xerces2-J
> Issue Type: Bug
> Components: XML Schema API
> Affects Versions: 2.11.0
> Reporter: Vojtěch Toman
> Assignee: Khaled Noaman
> Fix For: 2.12.0
>
>
> I got an ArrayIndexOutOfBoundsException in the SchemaGrammar(SchemaGrammar
> constructor):
> ...
> // Groups being redefined by restriction
> fRGCount = grammar.fRGCount;
> if (fRGCount > 0) {
> fRedefinedGroupDecls = new
> XSGroupDecl[grammar.fRedefinedGroupDecls.length];
> fRGLocators = new SimpleLocator[grammar.fRGLocators.length];
> System.arraycopy(grammar.fRedefinedGroupDecls, 0, fRedefinedGroupDecls,
> 0, fRGCount);
> // HERE
> System.arraycopy(grammar.fRGLocators, 0, fRGLocators, 0, fRGCount);
> }
> ...
> The reason for the exception was that the size of both grammar.fRGLocators
> and fRGLocators was 2, but the value of fRGCount was 4.
> It is relatively difficult do describe my setup, but I am basically doing the
> following:
> - Validating a sequence of DITA documents using the same DOMParser instance
> - The parser is using a custom grammar pool implementation
> It all worked fine with Xerces 2.9.1, but not with Xerces 2.11.0 which
> introduced some new behavior in XMLSchemaValidator.findSchemaGrammar(). The
> problem is that if there are schemas in the grammar pool with a matching
> namespace, Xerces does not follow the schema location hints anymore unless
> the following feature is enabled:
> http://apache.org/xml/features/namespace-growth
> After enabling this feature, I got conflicts because of duplicate schemas, so
> I enabled also:
> http://apache.org/xml/features/internal/tolerate-duplicates
> However, that resulted in the ArrayIndexOutOfBoundsException described above.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]