You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Stephanie Dietzel (JIRA)" <xe...@xml.apache.org> on 2010/07/09 17:51:50 UTC

[jira] Updated: (XERCESJ-1457) Forgotten calls on intern() for QName fields

     [ https://issues.apache.org/jira/browse/XERCESJ-1457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephanie Dietzel updated XERCESJ-1457:
---------------------------------------

    Attachment: interning-fix.patch

> Forgotten calls on intern() for QName fields
> --------------------------------------------
>
>                 Key: XERCESJ-1457
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1457
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.10.0
>            Reporter: Stephanie Dietzel
>         Attachments: interning-fix.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> In the class Qname.java, the documentation states, "To be used correctly, the strings must be identical references for equal strings."
> Here are 26 places where a QName is constructed or modifed with non-interned strings.
> This is an efficiency concern, because the non-interned strings may take up
> more memory than interned ones.  It is also a correctness concern, because
> Xerces-J performs comparisons against QName fields using ==.
> The attached patch corrects these problems.
> For example, in XIncludeHandler.java,
> new QName(
>            XMLSymbols.PREFIX_XMLNS,
>            "",
>            XMLSymbols.PREFIX_XMLNS + ":",
>            NamespaceContext.XMLNS_URI)
> becomes
> new QName(
>              XMLSymbols.PREFIX_XMLNS,
>              "",
>              (XMLSymbols.PREFIX_XMLNS + ":").intern(),
>              NamespaceContext.XMLNS_URI)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org