You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Stefano Bagnara <ap...@bago.org> on 2006/09/08 16:29:19 UTC

James 2.3 regression

I just upgraded a 2.3.0rc1 to latest branch and I got NPEs in one mailet
having this code:
-----------
mail.setMessage(mail.getMessage())
-----------
The problem is the new check I added in MailImpl.setMessage that call
the dispose for the old message when you set a new message.

The dispose call is needed to avoid leaks, but this creates problems.

I thought that we should at least check if the new message is different
from the old one before calling the dispose(), WDYT?

Either way this new code may introduce subtle problems: most people
won't expect that when they call the setMessage and they had a reference
to the old getMessage the old message will be disposed. What should we do?

Another option is to remove the dispose check in the setMessage and
manually change all callers of the setMessage to make sure the previous
message is correctly disposed.

Stefano


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