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 ba...@apache.org on 2006/09/12 14:38:58 UTC
svn commit: r442571 -
/james/server/branches/v2.3/src/java/org/apache/james/core/MailImpl.java
Author: bago
Date: Tue Sep 12 05:38:57 2006
New Revision: 442571
URL: http://svn.apache.org/viewvc?view=rev&rev=442571
Log:
Fixed a cause of NPEs in MailImpl.setMessage when the new message was the same of the previous message (JAMES-609)
Modified:
james/server/branches/v2.3/src/java/org/apache/james/core/MailImpl.java
Modified: james/server/branches/v2.3/src/java/org/apache/james/core/MailImpl.java
URL: http://svn.apache.org/viewvc/james/server/branches/v2.3/src/java/org/apache/james/core/MailImpl.java?view=diff&rev=442571&r1=442570&r2=442571
==============================================================================
--- james/server/branches/v2.3/src/java/org/apache/james/core/MailImpl.java (original)
+++ james/server/branches/v2.3/src/java/org/apache/james/core/MailImpl.java Tue Sep 12 05:38:57 2006
@@ -384,13 +384,15 @@
* @param message the new MimeMessage associated with this MailImpl
*/
public void setMessage(MimeMessage message) {
- // If a setMessage is called on a Mail that already have a message
- // (discouraged) we have to make sure that the message we remove is
- // correctly unreferenced and disposed, otherwise it will keep locks
- if (this.message != null) {
- ContainerUtil.dispose(this.message);
+ if (this.message != message) {
+ // If a setMessage is called on a Mail that already have a message
+ // (discouraged) we have to make sure that the message we remove is
+ // correctly unreferenced and disposed, otherwise it will keep locks
+ if (this.message != null) {
+ ContainerUtil.dispose(this.message);
+ }
+ this.message = message;
}
- this.message = message;
}
/**
* Set the recipients for this MailImpl.
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org