do not intern when searching for attribute

This commit is contained in:
Maxim.Mossienko
2012-02-04 16:28:28 +04:00
parent 00020401ab
commit 147462653f
@@ -675,17 +675,15 @@ public class XmlTagImpl extends XmlElementImpl implements XmlTag {
@Nullable
public XmlAttribute getAttribute(String qname) {
if (qname == null) return null;
final CharTable charTableByTree = SharedImplUtil.findCharTableByTree(this);
final XmlAttribute[] attributes = getAttributes();
final CharSequence charTableIndex = charTableByTree.intern(qname);
final boolean caseSensitive = isCaseSensitive();
for (final XmlAttribute attribute : attributes) {
final LeafElement attrNameElement = (LeafElement)XmlChildRole.ATTRIBUTE_NAME_FINDER.findChild(attribute.getNode());
if (attrNameElement != null &&
(caseSensitive && attrNameElement.getChars().equals(charTableIndex) ||
!caseSensitive && Comparing.equal(attrNameElement.getChars(), charTableIndex, false))) {
(caseSensitive && Comparing.equal(attrNameElement.getChars(), qname) ||
!caseSensitive && Comparing.equal(attrNameElement.getChars(), qname, false))) {
return attribute;
}
}