DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29893>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29893

DTMManagerDefault.getDTM() incorrectly returns null





------- Additional Comments From [EMAIL PROTECTED]  2004-07-06 16:09 -------
>We should never be accessing a null slot in m_dtms for any DTM which is in fact
>registered with this DTM Manager... 

I think you are right: a correct program would never have a null in m_dtms for 
a registered DTM. But an incorrect program may have a null.  This is the case 
currently and the reason I suggest change.

>and we *should* be returning null for a DTM
>which is not registered, or which is registered with another manager.

That's a fine design choice for the interface, but not the choice that 
was made.  Maybe the interface should be changed?

>So I'm a bit skeptical about the assertion that the bug is here rather than
>elsewhere. This looks more like a documentation issue.

Even if returning null is prefered, then Xalan still has bugs, not 
documentation issues.

Because the interface claims it will not return null from getDTM(), Xalan has
code that calls getDTM() and does not check the pointer that is returned.
Each of these calls will be a bug.  No efficiency is gained by moving the 
null check out of getDTM() and into all of the calling code.  So I think the
simple solution is to check in getDTM().

The current code without null checks is the most efficient, but it is also the 
most brittle.  If you search the web for "TransformerImpl run 
nullpointerexception" you will see many examples of people wasting time because 
of a mysterious Xalan NPE.

John.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to