Author: bago
Date: Mon Jul 10 08:34:20 2006
New Revision: 420566
URL: http://svn.apache.org/viewvc?rev=420566&view=rev
Log:
Further mimemessage handling optimisation conservative changes (not a code
revert, but a logical revert) (JAMES-559)
It seems to work even without this change because of a weird behaviour of
MimeMessage.saveChanges in Sun Javamail.
Modified:
james/server/branches/v2.3/src/java/org/apache/james/core/MimeMessageWrapper.java
james/server/branches/v2.3/src/test/org/apache/james/core/MimeMessageWrapperTest.java
Modified:
james/server/branches/v2.3/src/java/org/apache/james/core/MimeMessageWrapper.java
URL:
http://svn.apache.org/viewvc/james/server/branches/v2.3/src/java/org/apache/james/core/MimeMessageWrapper.java?rev=420566&r1=420565&r2=420566&view=diff
==============================================================================
---
james/server/branches/v2.3/src/java/org/apache/james/core/MimeMessageWrapper.java
(original)
+++
james/server/branches/v2.3/src/java/org/apache/james/core/MimeMessageWrapper.java
Mon Jul 10 08:34:20 2006
@@ -410,10 +410,16 @@
private synchronized void checkModifyHeaders() throws MessagingException {
+ // Disable only-header loading optimizations for JAMES-559
+ if (!messageParsed) {
+ loadMessage();
+ }
+ // End JAMES-559
if (headers == null) {
loadHeaders();
}
modified = true;
+ saved = false;
headersModified = true;
}
@@ -446,6 +452,7 @@
*/
public synchronized void setDataHandler(DataHandler arg0) throws
MessagingException {
modified = true;
+ saved = false;
bodyModified = true;
super.setDataHandler(arg0);
}
Modified:
james/server/branches/v2.3/src/test/org/apache/james/core/MimeMessageWrapperTest.java
URL:
http://svn.apache.org/viewvc/james/server/branches/v2.3/src/test/org/apache/james/core/MimeMessageWrapperTest.java?rev=420566&r1=420565&r2=420566&view=diff
==============================================================================
---
james/server/branches/v2.3/src/test/org/apache/james/core/MimeMessageWrapperTest.java
(original)
+++
james/server/branches/v2.3/src/test/org/apache/james/core/MimeMessageWrapperTest.java
Mon Jul 10 08:34:20 2006
@@ -125,6 +125,7 @@
assertFalse(mw.isModified());
}
+ /** this is commented out due optimisation reverts (JAMES-559)
public void testDeferredMessageLoadingWhileWriting() throws
MessagingException, IOException {
mw.setMessageLoadable(false);
assertEquals("foo",mw.getSubject());
@@ -134,8 +135,8 @@
assertFalse(mw.messageParsed());
assertTrue(mw.isModified());
mw.setMessageLoadable(true);
-
}
+ */
public void testDeferredHeaderLoading() throws MessagingException,
IOException {
mw.setHeadersLoadable(false);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]