You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Lesniak, Alex" <Al...@mdx.com> on 2002/01/07 23:24:15 UTC

Serialization issue with Xalan-J 2.2D?

Hi,

Sorry if this message is posted twice.  I think I got unsubscribed from the
list,
so here is a resend.

I think I may have found a thread safety issue with the Xalan
SerializerToXML class.
We are seeing an issue where character entity references for HTML output
appear
to sometimes be incorrect.  Sometimes the characters are converted to text
entity references and sometimes they are converted to numerical references.
Sometimes, they appear to be set to an incorrect text reference.

The CharInfo class' getEntityNameForChar method does not appear to be thread
safe, since it uses a global object (m_charKey) as a key into the entity ref
hashtable (the value of the key is set in the method itself).

Also, the CharInfo instance appears to be cached and reused among multiple
instances of SerializerToXML (and by extension SerializerToHTML).

We only see this issue under heavy multithreading.

In a single thread scenario, all appears to be OK.

If anyone could confirm or deny this, please do, since I'm not that familiar
with
the Xalan code.  We saw this with Xalan-J 2.2 D9, and I don't think the
CharInfo code
has changed since then.

Thanks!

-- Alex