[
https://issues.apache.org/jira/browse/XERCESJ-1649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14193834#comment-14193834
]
Tagir Valeev commented on XERCESJ-1649:
---------------------------------------
First point looks irrelevant as exception is not explicitly thrown by
CoreDocumentImpl.isXMLName as well as methods it calls. You may quickly check
this in the code: all called methods are static, so cannot be overridden to
raise an exception or perform any side-effect. If you look at the code you will
see that it's even hardly possible to trigger implicit NPE or
index-out-of-bounds exception.
I changed the type to "Improvement". The rest is of course up to you.
> Dubious calls to CoreDocumentImpl.isXMLName
> -------------------------------------------
>
> Key: XERCESJ-1649
> URL: https://issues.apache.org/jira/browse/XERCESJ-1649
> Project: Xerces2-J
> Issue Type: Improvement
> Affects Versions: 2.11.0
> Reporter: Tagir Valeev
> Priority: Minor
>
> I was just analyzing the Xerces source code (ver 2.11.0) and found some
> dubious code.
> First, in class org.apache.xerces.dom.DOMNormalizer in method protected Node
> normalizeNode (Node node) there's a branch (around line #495):
> {noformat}
> if (fDocument.errorChecking && ((fConfiguration.features &
> DOMConfigurationImpl.WELLFORMED) != 0) &&
> fDocument.isXMLVersionChanged()){
> CoreDocumentImpl.isXMLName(node.getNodeName() ,
> fDocument.isXML11Version());
> }
> {noformat}
> However CoreDocumentImpl.isXMLName seems to have no side effect, just return
> the boolean value which is ignored. Probably adding DOM error was forgotten
> here?
> The similar case is in org.apache.xml.serialize.DOMSerializerImpl, method
> private void verify (Node node, boolean verifyNames, boolean xml11Version),
> around line #1000:
> {noformat}
> case Node.ENTITY_REFERENCE_NODE: {
> // only if entity is preserved in the tree
> if (verifyNames && (features & ENTITIES) != 0){
> CoreDocumentImpl.isXMLName(node.getNodeName() , xml11Version);
> }
> break;
> }
> {noformat}
> Probably it's not so big issue, I just wanted to draw your attention to this
> code.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]