Speed up QName.intern() a bit
[yangtools.git] / yang / yang-common / src / main / java / org / opendaylight / yangtools / yang / common / QName.java
index e8851f7c055e6e2675660711c137e7372fdc1384..768cc3eba91c6388a31e9eac341aff36088c7ff3 100644 (file)
@@ -276,7 +276,7 @@ public final class QName implements Immutable, Serializable, Comparable<QName>,
         // Identity comparison is here on purpose, as we are deciding whether to potentially store 'qname' into the
         // interner. It is important that it does not hold user-supplied reference (such a String instance from
         // parsing of an XML document).
-        final QName template = cacheMod == module ? this : QName.create(cacheMod, localName.intern());
+        final QName template = cacheMod == module ? this : new QName(cacheMod, localName.intern());
 
         return INTERNER.intern(template);
     }