commits@javamail.java.net

[javamail~mercurial:537] Merge 1.4.7 with 1.5.0.

From: <shannon_at_kenai.com>
Date: Sat, 9 Mar 2013 01:24:28 +0000

Project: javamail
Repository: mercurial
Revision: 537
Author: shannon
Date: 2013-03-09 01:17:22 UTC
Link:

Log Message:
------------
Update version to 1.5.0-b01.
Update version to 1.5.0-SNAPSHOT.
MailHandler allow comparators to override reverseOrder behavior.
MailHandler attachment filters should inherit body filter by default.
MailHandler use Message.getSession() instead of MessageContext.
MailHandler copyOf methods should use generics.
MailHandler fix FindBugs DLS and RCN warnings.
MailHandler update since tags from 1.5 to 1.5.0.
LogManagerProperties add reverseOrder method.
MailHandlerTest fail if InternetAddress.parse returns null.
MailHandlerTest test for reverserOrder override.
MailHandlerTest test init default attachment filters.
MailHandlerTest test default set attachment filters.
LogManagerPropertiesTest add testReverseOrder method.

(From Jason)
Update version to 1.4.7-rc1.
Backport two key fixes from 1.5.0.
Update version to 1.4.7.
Added tag JAVAMAIL-1_4_7 for changeset ba4e734fdfa9
Merge 1.4.7 with 1.5.0.


Revisions:
----------
530
531
532
533
534
535
536
537


Modified Paths:
---------------
client/pom.xml
demo/pom.xml
dsn/pom.xml
gimap/pom.xml
imap/pom.xml
javadoc/pom.xml
logging/pom.xml
mail/pom.xml
mailapi/pom.xml
mailapijar/pom.xml
mbox/dist/pom.xml
mbox/native/pom.xml
mbox/pom.xml
oldmail/pom.xml
outlook/pom.xml
parent-distrib/pom.xml
pom.xml
pop3/pom.xml
servlet/pom.xml
smtp/pom.xml
taglib/pom.xml
webapp/pom.xml
mail/src/main/java/com/sun/mail/util/logging/LogManagerProperties.java
mail/src/main/java/com/sun/mail/util/logging/MailHandler.java
mail/src/test/java/com/sun/mail/util/logging/LogManagerPropertiesTest.java
mail/src/test/java/com/sun/mail/util/logging/MailHandlerTest.java
doc/release/CHANGES.txt
mail/src/main/java/com/sun/mail/imap/IMAPMessage.java
mail/src/main/java/com/sun/mail/imap/IMAPNestedMessage.java
mail/src/main/java/com/sun/mail/imap/protocol/IMAPProtocol.java
mail/src/main/java/com/sun/mail/smtp/SMTPTransport.java
mail/src/test/java/com/sun/mail/imap/IMAPHandler.java
mail/src/test/java/com/sun/mail/smtp/SMTPHandler.java
.hgtags
assembly.xml
doc/release/COMPAT.txt
gimap/src/main/java/com/sun/mail/gimap/GmailMessage.java
logging/src/main/java/FileErrorManager.java
logging/src/main/java/MailHandlerDemo.java
logging/src/main/java/README.txt
logging/src/main/java/SummaryFormatter.java
logging/src/main/java/SummaryNameFormatter.java
mail/src/main/java/com/sun/mail/imap/IMAPFolder.java
mail/src/main/java/com/sun/mail/imap/IMAPStore.java
mail/src/main/java/com/sun/mail/imap/protocol/BODYSTRUCTURE.java
mail/src/main/java/com/sun/mail/util/SocketFetcher.java
mail/src/main/java/javax/mail/AuthenticationFailedException.java
mail/src/main/java/javax/mail/FetchProfile.java
mail/src/main/java/javax/mail/Flags.java
mail/src/main/java/javax/mail/FolderClosedException.java
mail/src/main/java/javax/mail/FolderNotFoundException.java
mail/src/main/java/javax/mail/IllegalWriteException.java
mail/src/main/java/javax/mail/Message.java
mail/src/main/java/javax/mail/MessageContext.java
mail/src/main/java/javax/mail/MessageRemovedException.java
mail/src/main/java/javax/mail/MethodNotSupportedException.java
mail/src/main/java/javax/mail/NoSuchProviderException.java
mail/src/main/java/javax/mail/ReadOnlyFolderException.java
mail/src/main/java/javax/mail/StoreClosedException.java
mail/src/main/java/javax/mail/Transport.java
mail/src/main/java/javax/mail/internet/ContentDisposition.java
mail/src/main/java/javax/mail/internet/ContentType.java
mail/src/main/java/javax/mail/internet/HeaderTokenizer.java
mail/src/main/java/javax/mail/internet/MimeBodyPart.java
mail/src/main/java/javax/mail/internet/MimeMessage.java
mail/src/main/java/javax/mail/internet/MimeMultipart.java
mail/src/main/java/javax/mail/internet/MimeUtility.java
mail/src/main/java/javax/mail/internet/ParameterList.java
mail/src/main/java/javax/mail/internet/package.html
mail/src/main/java/javax/mail/package.html
mail/src/main/java/javax/mail/search/AndTerm.java
mail/src/main/java/javax/mail/search/FlagTerm.java
mail/src/main/java/javax/mail/search/HeaderTerm.java
mail/src/main/java/javax/mail/search/NotTerm.java
mail/src/main/java/javax/mail/search/OrTerm.java
mail/src/main/java/javax/mail/search/RecipientTerm.java
mail/src/main/java/overview.html
mail/src/test/java/javax/mail/internet/MimeUtilityTest.java


Added Paths:
------------
mail/src/test/java/com/sun/mail/imap/IMAPSaslHandler.java
mail/src/test/java/com/sun/mail/imap/IMAPSaslLoginTest.java
mail/src/test/java/com/sun/mail/smtp/SMTPSaslHandler.java
mail/src/test/java/com/sun/mail/smtp/SMTPSaslLoginTest.java
doc/spec/JavaMail-1.5-changes.txt
mail/src/main/java/doc-files/speclicense.html
mail/src/main/java/javax/mail/EncodingAware.java
mail/src/main/java/javax/mail/MailSessionDefinition.java
mail/src/main/java/javax/mail/MailSessionDefinitions.java
mail/src/test/java/com/sun/mail/imap/IMAPIdleStateTest.java


Diffs:
------
diff -r 85ac6e7aaad7 -r 5d508dfadcaa client/pom.xml
--- a/client/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/client/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa demo/pom.xml
--- a/demo/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/demo/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa dsn/pom.xml
--- a/dsn/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/dsn/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa gimap/pom.xml
--- a/gimap/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/gimap/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa imap/pom.xml
--- a/imap/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/imap/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>parent-distrib</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
         <relativePath>../parent-distrib/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa javadoc/pom.xml
--- a/javadoc/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/javadoc/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -48,13 +48,13 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>
     <artifactId>javadoc</artifactId>
     <packaging>pom</packaging>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
     <name>JavaMail API javadocs</name>
     <description>${project.name}</description>
 

diff -r 85ac6e7aaad7 -r 5d508dfadcaa logging/pom.xml
--- a/logging/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/logging/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa mail/pom.xml
--- a/mail/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/mail/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa mailapi/pom.xml
--- a/mailapi/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/mailapi/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -56,7 +56,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa mailapijar/pom.xml
--- a/mailapijar/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/mailapijar/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -55,7 +55,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>javax.mail</groupId>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa mbox/dist/pom.xml
--- a/mbox/dist/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/mbox/dist/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa mbox/native/pom.xml
--- a/mbox/native/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/mbox/native/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa mbox/pom.xml
--- a/mbox/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/mbox/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa oldmail/pom.xml
--- a/oldmail/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/oldmail/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -53,7 +53,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>javax.mail</groupId>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa outlook/pom.xml
--- a/outlook/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/outlook/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa parent-distrib/pom.xml
--- a/parent-distrib/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/parent-distrib/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa pom.xml
--- a/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -54,7 +54,7 @@
     <groupId>com.sun.mail</groupId>
     <artifactId>all</artifactId>
     <packaging>pom</packaging>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
     <name>JavaMail API distribution</name>
     <description>${project.name}</description>
     <url>http://kenai.com/projects/javamail</url>
@@ -91,9 +91,9 @@
     </organization>
 
     <properties>
- <mail.version>1.5.0-SNAPSHOT</mail.version>
+ <mail.version>1.5.0-b01</mail.version>
         <!-- like mail.version, but with underscores instead of dots -->
- <mail.zipversion>1_5_0-SNAPSHOT</mail.zipversion>
+ <mail.zipversion>1_5_0-b01</mail.zipversion>
         <mail.spec.version>1.5</mail.spec.version>
         <activation-api.version>1.1</activation-api.version>
         <!-- defaults that are overridden in mail module -->
@@ -158,7 +158,6 @@
         <module>gimap</module>
         <module>pop3</module>
         <module>dsn</module>
- <module>oldmail</module>
     </modules>
 
     <profiles>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa pop3/pom.xml
--- a/pop3/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/pop3/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>parent-distrib</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
         <relativePath>../parent-distrib/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa servlet/pom.xml
--- a/servlet/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/servlet/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa smtp/pom.xml
--- a/smtp/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/smtp/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>parent-distrib</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
         <relativePath>../parent-distrib/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa taglib/pom.xml
--- a/taglib/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/taglib/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 85ac6e7aaad7 -r 5d508dfadcaa webapp/pom.xml
--- a/webapp/pom.xml Tue Mar 05 13:31:59 2013 -0800
+++ b/webapp/pom.xml Fri Mar 08 15:35:04 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0-b01</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>


diff -r 5d508dfadcaa -r 5e2d9dbe615b client/pom.xml
--- a/client/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/client/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 5d508dfadcaa -r 5e2d9dbe615b demo/pom.xml
--- a/demo/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/demo/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 5d508dfadcaa -r 5e2d9dbe615b dsn/pom.xml
--- a/dsn/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/dsn/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 5d508dfadcaa -r 5e2d9dbe615b gimap/pom.xml
--- a/gimap/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/gimap/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 5d508dfadcaa -r 5e2d9dbe615b imap/pom.xml
--- a/imap/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/imap/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>parent-distrib</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
         <relativePath>../parent-distrib/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 5d508dfadcaa -r 5e2d9dbe615b javadoc/pom.xml
--- a/javadoc/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/javadoc/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -48,13 +48,13 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>
     <artifactId>javadoc</artifactId>
     <packaging>pom</packaging>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
     <name>JavaMail API javadocs</name>
     <description>${project.name}</description>
 

diff -r 5d508dfadcaa -r 5e2d9dbe615b logging/pom.xml
--- a/logging/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/logging/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 5d508dfadcaa -r 5e2d9dbe615b mail/pom.xml
--- a/mail/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/mail/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 5d508dfadcaa -r 5e2d9dbe615b mailapi/pom.xml
--- a/mailapi/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/mailapi/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -56,7 +56,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 5d508dfadcaa -r 5e2d9dbe615b mailapijar/pom.xml
--- a/mailapijar/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/mailapijar/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -55,7 +55,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>javax.mail</groupId>

diff -r 5d508dfadcaa -r 5e2d9dbe615b mbox/dist/pom.xml
--- a/mbox/dist/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/mbox/dist/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 5d508dfadcaa -r 5e2d9dbe615b mbox/native/pom.xml
--- a/mbox/native/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/mbox/native/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 5d508dfadcaa -r 5e2d9dbe615b mbox/pom.xml
--- a/mbox/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/mbox/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 5d508dfadcaa -r 5e2d9dbe615b oldmail/pom.xml
--- a/oldmail/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/oldmail/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -53,7 +53,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>javax.mail</groupId>

diff -r 5d508dfadcaa -r 5e2d9dbe615b outlook/pom.xml
--- a/outlook/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/outlook/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 5d508dfadcaa -r 5e2d9dbe615b parent-distrib/pom.xml
--- a/parent-distrib/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/parent-distrib/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 5d508dfadcaa -r 5e2d9dbe615b pom.xml
--- a/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -54,7 +54,7 @@
     <groupId>com.sun.mail</groupId>
     <artifactId>all</artifactId>
     <packaging>pom</packaging>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
     <name>JavaMail API distribution</name>
     <description>${project.name}</description>
     <url>http://kenai.com/projects/javamail</url>
@@ -91,9 +91,9 @@
     </organization>
 
     <properties>
- <mail.version>1.5.0-b01</mail.version>
+ <mail.version>1.5.0-SNAPSHOT</mail.version>
         <!-- like mail.version, but with underscores instead of dots -->
- <mail.zipversion>1_5_0-b01</mail.zipversion>
+ <mail.zipversion>1_5_0-SNAPSHOT</mail.zipversion>
         <mail.spec.version>1.5</mail.spec.version>
         <activation-api.version>1.1</activation-api.version>
         <!-- defaults that are overridden in mail module -->

diff -r 5d508dfadcaa -r 5e2d9dbe615b pop3/pom.xml
--- a/pop3/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/pop3/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>parent-distrib</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
         <relativePath>../parent-distrib/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 5d508dfadcaa -r 5e2d9dbe615b servlet/pom.xml
--- a/servlet/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/servlet/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 5d508dfadcaa -r 5e2d9dbe615b smtp/pom.xml
--- a/smtp/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/smtp/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>parent-distrib</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
         <relativePath>../parent-distrib/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 5d508dfadcaa -r 5e2d9dbe615b taglib/pom.xml
--- a/taglib/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/taglib/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 5d508dfadcaa -r 5e2d9dbe615b webapp/pom.xml
--- a/webapp/pom.xml Fri Mar 08 15:35:04 2013 -0800
+++ b/webapp/pom.xml Fri Mar 08 15:36:44 2013 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.5.0-b01</version>
+ <version>1.5.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>


diff -r 5e2d9dbe615b -r 0b49cb3cd71c mail/src/main/java/com/sun/mail/util/logging/LogManagerProperties.java
--- a/mail/src/main/java/com/sun/mail/util/logging/LogManagerProperties.java Fri Mar 08 15:36:44 2013 -0800
+++ b/mail/src/main/java/com/sun/mail/util/logging/LogManagerProperties.java Fri Mar 08 15:37:30 2013 -0800
@@ -42,12 +42,11 @@
 
 import java.io.ObjectStreamException;
 import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.util.Comparator;
-import java.util.Enumeration;
-import java.util.Locale;
-import java.util.Properties;
+import java.util.*;
+import java.util.logging.Formatter;
 import java.util.logging.*;
 import javax.mail.Authenticator;
 
@@ -183,6 +182,50 @@
     }
 
     /**
+ * Returns a comparator that imposes the reverse ordering of the specified
+ * {_at_link Comparator}. If the given comparator declares a public
+ * reverseOrder method that method is called first and the return value is
+ * used. If that method is not declared or the caller does not have access
+ * then a comparator wrapping the given comparator is returned.
+ *
+ * @param <T> the element type to be compared
+ * @param c a comparator whose ordering is to be reversed by the returned
+ * comparator
+ * @return A comparator that imposes the reverse ordering of the specified
+ * comparator.
+ * @throws NullPointerException if the given comparator is null.
+ * @since JavaMail 1.5.0
+ */
+ @SuppressWarnings("unchecked")
+ static <T> Comparator<T> reverseOrder(final Comparator<T> c) {
+ Comparator<T> reverse = null;
+ //Comparator in Java 1.8 has 'reverseOrder' as a default method.
+ //This code calls that method first to allow custom code to define what
+ //reverse order means.
+ try {
+ //assert Modifier.isPublic(c.getClass().getModifiers()) :
+ // Modifier.toString(c.getClass().getModifiers());
+ final Method m = c.getClass().getMethod("reverseOrder");
+ if (Comparator.class.isAssignableFrom(m.getReturnType())) {
+ try {
+ reverse = (Comparator<T>) m.invoke(c);
+ } catch (final ExceptionInInitializerError eiie) {
+ throw wrapOrThrow(eiie);
+ }
+ }
+ } catch (final NoSuchMethodException ignore) {
+ } catch (final IllegalAccessException ignore) {
+ } catch (final InvocationTargetException ite) {
+ paramOrError(ite); //Ignore invocation bugs.
+ }
+
+ if (reverse == null) {
+ reverse = Collections.reverseOrder(c);
+ }
+ return reverse;
+ }
+
+ /**
      * Creates a new error manager from the given class name.
      * @param name the fully qualified class name.
      * @return a new error manager.
@@ -262,15 +305,7 @@
             //This is also a nice way to adap this error for the error manager.
             throw new ClassNotFoundException(NCDFE.toString(), NCDFE);
         } catch (final ExceptionInInitializerError EIIE) {
- //This linkage error will escape the constructor new instance call.
- //If the cause is an error, rethrow to skip any error manager.
- if (EIIE.getCause() instanceof Error) {
- throw EIIE;
- } else {
- //Considered a bug in the code, wrap the error so it can be
- //reported to the error manager.
- throw new InvocationTargetException(EIIE);
- }
+ throw wrapOrThrow(EIIE);
         }
     }
 
@@ -294,6 +329,26 @@
     }
 
     /**
+ * Throws the given error if the cause is an error otherwise
+ * the given error is wrapped.
+ * @param eiie the error.
+ * @return an InvocationTargetException.
+ * @since JavaMail 1.5.0
+ */
+ private static InvocationTargetException wrapOrThrow(
+ ExceptionInInitializerError eiie) {
+ //This linkage error will escape the constructor new instance call.
+ //If the cause is an error, rethrow to skip any error manager.
+ if (eiie.getCause() instanceof Error) {
+ throw eiie;
+ } else {
+ //Considered a bug in the code, wrap the error so it can be
+ //reported to the error manager.
+ return new InvocationTargetException(eiie);
+ }
+ }
+
+ /**
      * This code is modified from the LogManager, which explictly states
      * searching the system class loader first, then the context class loader.
      * There is resistance (compatibility) to change this behavior to simply

diff -r 5e2d9dbe615b -r 0b49cb3cd71c mail/src/main/java/com/sun/mail/util/logging/MailHandler.java
--- a/mail/src/main/java/com/sun/mail/util/logging/MailHandler.java Fri Mar 08 15:36:44 2013 -0800
+++ b/mail/src/main/java/com/sun/mail/util/logging/MailHandler.java Fri Mar 08 15:37:30 2013 -0800
@@ -117,7 +117,8 @@
  * <li>&lt;handler-name&gt;.attachment.filters a comma
  * separated list of <tt>Filter</tt> class names used to create each attachment.
  * The literal <tt>null</tt> is reserved for attachments that do not require
- * filtering. (default is no filters)
+ * filtering. (defaults to
+ * {_at_linkplain java.util.logging.Handler#getFilter() body} filter)
  *
  * <li>&lt;handler-name&gt;.attachment.formatters a comma
  * separated list of <tt>Formatter</tt> class names used to create each
@@ -126,7 +127,8 @@
  * <li>&lt;handler-name&gt;.attachment.names a comma separated
  * list of names or <tt>Formatter</tt> class names of each attachment. The
  * attachment file names must not contain any line breaks.
- * (default is no attachments names)
+ * (default is {_at_linkplain java.util.logging.Formatter#toString() toString}
+ * of the attachment formatter)
  *
  * <li>&lt;handler-name&gt;.authenticator name of an
  * {_at_linkplain javax.mail.Authenticator} class used to provide login credentials
@@ -582,7 +584,7 @@
      * @since JavaMail 1.4.5
      */
     private void publish0(final LogRecord record) {
- MessageContext ctx;
+ Message msg;
         boolean priority;
         synchronized (this) {
             if (size == data.length && size < capacity) {
@@ -594,18 +596,18 @@
                 ++size; //Be nice to client compiler.
                 priority = isPushable(record);
                 if (priority || size >= capacity) {
- ctx = writeLogRecords(ErrorManager.WRITE_FAILURE);
+ msg = writeLogRecords(ErrorManager.WRITE_FAILURE);
                 } else {
- ctx = null;
+ msg = null;
                 }
             } else {
                 priority = false;
- ctx = null;
+ msg = null;
             }
         }
 
- if (ctx != null) {
- send(ctx, priority, ErrorManager.WRITE_FAILURE);
+ if (msg != null) {
+ send(msg, priority, ErrorManager.WRITE_FAILURE);
         }
     }
 
@@ -704,10 +706,10 @@
         //Set the CCL to this class loader for loading content handlers.
         final Object ccl = getAndSetContextClassLoader();
         try {
- MessageContext ctx = null;
+ Message msg = null;
             synchronized (this) {
                 try {
- ctx = writeLogRecords(ErrorManager.CLOSE_FAILURE);
+ msg = writeLogRecords(ErrorManager.CLOSE_FAILURE);
                 } finally {
                     super.setLevel(Level.OFF); //Change level after formatting.
                    /**
@@ -726,8 +728,8 @@
                 }
             }
 
- if (ctx != null) {
- send(ctx, false, ErrorManager.CLOSE_FAILURE);
+ if (msg != null) {
+ send(msg, false, ErrorManager.CLOSE_FAILURE);
             }
         } finally {
             setContextClassLoader(ccl);
@@ -954,7 +956,7 @@
      * @return a non null array of attachment filters.
      */
     public final Filter[] getAttachmentFilters() {
- return (Filter[]) readOnlyAttachmentFilters().clone();
+ return readOnlyAttachmentFilters().clone();
     }
 
     /**
@@ -971,7 +973,7 @@
      */
     public final void setAttachmentFilters(Filter... filters) {
         checkAccess();
- filters = (Filter[]) copyOf(filters, filters.length, Filter[].class);
+ filters = copyOf(filters, filters.length, Filter[].class);
         synchronized (this) {
             if (this.attachmentFormatters.length != filters.length) {
                 throw attachmentMismatch(this.attachmentFormatters.length, filters.length);
@@ -994,7 +996,7 @@
         synchronized (this) {
             formatters = this.attachmentFormatters;
         }
- return (Formatter[]) formatters.clone();
+ return formatters.clone();
     }
 
     /**
@@ -1014,7 +1016,7 @@
         if (formatters.length == 0) { //Null check and length check.
             formatters = emptyFormatterArray();
         } else {
- formatters = (Formatter[]) copyOf(formatters,
+ formatters = copyOf(formatters,
                     formatters.length, Formatter[].class);
             for (int i = 0; i < formatters.length; ++i) {
                 if (formatters[i] == null) {
@@ -1046,7 +1048,7 @@
         synchronized (this) {
             formatters = this.attachmentNames;
         }
- return (Formatter[]) formatters.clone();
+ return formatters.clone();
     }
 
     /**
@@ -1123,7 +1125,7 @@
     public final void setAttachmentNames(Formatter... formatters) {
         checkAccess();
 
- formatters = (Formatter[]) copyOf(formatters, formatters.length, Formatter[].class);
+ formatters = copyOf(formatters, formatters.length, Formatter[].class);
         for (int i = 0; i < formatters.length; ++i) {
             if (formatters[i] == null) {
                 throw new NullPointerException(atIndexMsg(i));
@@ -1441,7 +1443,7 @@
         final int expect = this.attachmentFormatters.length;
         final int current = this.attachmentNames.length;
         if (current != expect) {
- this.attachmentNames = (Formatter[]) copyOf(attachmentNames, expect);
+ this.attachmentNames = copyOf(attachmentNames, expect);
             fixed = current != 0;
         }
 
@@ -1471,8 +1473,17 @@
         final int expect = this.attachmentFormatters.length;
         final int current = this.attachmentFilters.length;
         if (current != expect) {
- this.attachmentFilters = (Filter[]) copyOf(attachmentFilters, expect);
+ this.attachmentFilters = copyOf(attachmentFilters, expect);
             fixed = current != 0;
+
+ //Array elements default to null so skip filling if body filter
+ //is null. If not null then only assign to expanded elements.
+ final Filter body = super.getFilter();
+ if (body != null) {
+ for (int i = current; i < expect; ++i) {
+ this.attachmentFilters[i] = body;
+ }
+ }
         }
 
         //Copy of zero length array is cheap, warm up copyOf.
@@ -1486,14 +1497,11 @@
     /**
      * Copies the given array. Can be removed when Java Mail requires Java 1.6.
      * @param a the original array.
- * @param size the new size.
+ * @param len the new size.
      * @return new copy
      */
- private static Object[] copyOf(final Object[] a, final int size) {
- final Object[] copy = (Object[]) Array.newInstance(
- a.getClass().getComponentType(), size);
- System.arraycopy(a, 0, copy, 0, Math.min(a.length, size));
- return copy;
+ private static <T> T[] copyOf(final T[] a, final int len) {
+ return (T[]) copyOf(a, len, a.getClass());
     }
 
     /**
@@ -1501,17 +1509,13 @@
      * Can be removed when Java Mail requires Java 1.6.
      * @param a the original array.
      * @param len the new size.
+ * @param type the array type.
      * @return new copy
      */
- private static Object[] copyOf(Object[] a, int len, Class type) {
- if (type == a.getClass()) {
- return (Object[]) a.clone();
- } else {
- final Object[] copy = (Object[]) Array.newInstance(
- type.getComponentType(), len);
- System.arraycopy(a, 0, copy, 0, Math.min(len, a.length));
- return copy;
- }
+ private static <T,U> T[] copyOf(U[] a, int len, Class<? extends T[]> type) {
+ final T[] copy = (T[]) Array.newInstance(type.getComponentType(), len);
+ System.arraycopy(a, 0, copy, 0, Math.min(len, a.length));
+ return copy;
     }
 
     /**
@@ -1538,7 +1542,7 @@
             newCapacity = capacity;
         }
         assert len != capacity : len;
- this.data = (LogRecord[]) copyOf(data, newCapacity);
+ this.data = copyOf(data, newCapacity);
     }
 
     /**
@@ -1585,7 +1589,7 @@
      * handler. The comparator is not interned. This method can only be
      * called from init after all of formatters and filters are in a constructed
      * and in a consistent state.
- * @since JavaMail 1.5
+ * @since JavaMail 1.5.0
      */
     private void intern() {
         assert Thread.holdsLock(this);
@@ -1660,7 +1664,7 @@
      * @throws SecurityException if this operation is not allowed by the
      * security manager.
      * @throws Exception if there is an unexpected problem.
- * @since JavaMail 1.5
+ * @since JavaMail 1.5.0
      */
     private Object intern(Map<Object, Object> m, Object o) throws Exception {
         if (o == null) {
@@ -1798,20 +1802,20 @@
                     try {
                         a[i] = LogManagerProperties.newFormatter(names[i]);
                         if (a[i] instanceof TailNameFormatter) {
- a[i] = new SimpleFormatter();
                             final Exception CNFE = new ClassNotFoundException(a[i].toString());
                             reportError("Attachment formatter.", CNFE, ErrorManager.OPEN_FAILURE);
+ a[i] = new SimpleFormatter();
                         }
                     } catch (final SecurityException SE) {
                         throw SE; //Avoid catch all.
                     } catch (final Exception E) {
+ reportError(E.getMessage(), E, ErrorManager.OPEN_FAILURE);
                         a[i] = new SimpleFormatter();
- reportError(E.getMessage(), E, ErrorManager.OPEN_FAILURE);
                     }
                 } else {
- a[i] = new SimpleFormatter();
                     final Exception NPE = new NullPointerException(atIndexMsg(i));
                     reportError("Attachment formatter.", NPE, ErrorManager.OPEN_FAILURE);
+ a[i] = new SimpleFormatter();
                 }
             }
 
@@ -1999,8 +2003,8 @@
             if (hasValue(name)) {
                 comparator = LogManagerProperties.newComparator(name);
                 if (Boolean.parseBoolean(reverse)) {
- assert comparator != null;
- comparator = Collections.reverseOrder(comparator);
+ assert comparator != null : "null";
+ comparator = LogManagerProperties.reverseOrder(comparator);
                 }
             } else {
                 if (!isEmpty(reverse)) {
@@ -2115,9 +2119,9 @@
     private void push(final boolean priority, final int code) {
         if (tryMutex()) {
             try {
- final MessageContext ctx = writeLogRecords(code);
- if (ctx != null) {
- send(ctx, priority, code);
+ final Message msg = writeLogRecords(code);
+ if (msg != null) {
+ send(msg, priority, code);
                 }
             } finally {
                 releaseMutex();
@@ -2132,15 +2136,14 @@
      * error manager for this handler. This method does not hold any
      * locks so new records can be added to this handler during a send or
      * failure.
- * @param ctx the message context or null.
+ * @param msg the message or null.
      * @param priority true for high priority or false for normal.
      * @param code the ErrorManager code.
- * @throws NullPointerException if message context is null.
+ * @throws NullPointerException if message is null.
      */
- private void send(MessageContext ctx, boolean priority, int code) {
- final Message msg = ctx.getMessage();
+ private void send(Message msg, boolean priority, int code) {
         try {
- envelopeFor(ctx, priority);
+ envelopeFor(msg, priority);
             Transport.send(msg); //Calls save changes.
         } catch (final Exception E) {
             reportError(msg, E, code);
@@ -2169,14 +2172,12 @@
     /**
      * Formats all records in the buffer and places the output in a Message.
      * This method holds a lock on this handler.
- * Normally code would not aggressively null locals (dead local store) but
- * with this running on older JVMs it seems better to trade time for space.
      * @param code the error manager code.
      * @return null if there are no records or is currently in a push.
- * Otherwise a new message context is created with a formatted message and
+ * Otherwise a new message is created with a formatted message and
      * attached session.
      */
- private synchronized MessageContext writeLogRecords(final int code) {
+ private synchronized Message writeLogRecords(final int code) {
         if (size == 0 || isWriting) {
             return null;
         }
@@ -2282,7 +2283,6 @@
                     buffers[i] = null;
                 }
             }
- buffers = null; //Read the method comments above.
 
             if (buf != null) {
                 buf.append(tail(bodyFormat, ""));
@@ -2297,7 +2297,6 @@
             MimeMultipart multipart = new MimeMultipart();
             String altType = getContentType(bodyFormat.getClass().getName());
             setContent(body, buf, altType == null ? contentType : altType);
- buf = null; //Read the method comments above.
             multipart.addBodyPart(body);
 
             for (int i = 0; i < parts.length; ++i) {
@@ -2306,9 +2305,8 @@
                 }
             }
 
- parts = null; //Read the method comments above.
             msg.setContent(multipart);
- return new MessageContext(msg);
+ return msg;
         } catch (final RuntimeException re) {
             reportError(re.getMessage(), re, code);
         } catch (final Exception e) {
@@ -2394,7 +2392,7 @@
         }
 
         setIncompleteCopy(abort); //Original body part is never added.
- envelopeFor(new MessageContext(abort), true);
+ envelopeFor(abort, true);
         try {
             abort.saveChanges();
         } catch (final MessagingException ME) {
@@ -2677,21 +2675,20 @@
     /**
      * Creates all of the envelope information for a message.
      * This method is safe to call outside of a lock because the message
- * context provides the safe snapshot of the mail properties.
- * @param ctx the MessageContext to write the envelope information.
+ * provides the safe snapshot of the mail properties.
+ * @param msg the Message to write the envelope information.
      * @param priority true for high priority.
      */
- private void envelopeFor(MessageContext ctx, boolean priority) {
- final Message msg = ctx.getMessage();
+ private void envelopeFor(Message msg, boolean priority) {
         setAcceptLang(msg);
- setFrom(ctx);
- if (!setRecipient(ctx, "mail.to", Message.RecipientType.TO)) {
- setDefaultRecipient(ctx);
+ setFrom(msg);
+ if (!setRecipient(msg, "mail.to", Message.RecipientType.TO)) {
+ setDefaultRecipient(msg);
         }
- setRecipient(ctx, "mail.cc", Message.RecipientType.CC);
- setRecipient(ctx, "mail.bcc", Message.RecipientType.BCC);
- setReplyTo(ctx);
- setSender(ctx);
+ setRecipient(msg, "mail.cc", Message.RecipientType.CC);
+ setRecipient(msg, "mail.bcc", Message.RecipientType.BCC);
+ setReplyTo(msg);
+ setSender(msg);
         setMailer(msg);
         setAutoSubmitted(msg);
         if (priority) {
@@ -2968,7 +2965,7 @@
      * @param o the test object must be non null.
      * @param found the possible intern, must be non null.
      * @throws NullPointerException if any argument is null.
- * @since JavaMail 1.5
+ * @since JavaMail 1.5.0
      */
     private void reportNonSymmetric(final Object o, final Object found) {
         reportError("Non symmetric equals implementation."
@@ -2983,7 +2980,7 @@
      * @param o the test object must be non null.
      * @param found the possible intern, must be non null.
      * @throws NullPointerException if any argument is null.
- * @since JavaMail 1.5
+ * @since JavaMail 1.5.0
      */
     private void reportNonDiscriminating(final Object o, final Object found) {
         reportError("Non discriminating equals implementation."
@@ -3088,16 +3085,16 @@
         }
     }
 
- private void setFrom(final MessageContext ctx) {
- final String from = ctx.getSession().getProperty("mail.from");
+ private void setFrom(final Message msg) {
+ final String from = msg.getSession().getProperty("mail.from");
         if (from != null) {
             try {
                 final Address[] address = InternetAddress.parse(from, false);
- if (address != null && address.length > 0) {
+ if (address.length > 0) {
                     if (address.length == 1) {
- ctx.getMessage().setFrom(address[0]);
+ msg.setFrom(address[0]);
                     } else { //Greater than 1 address.
- ctx.getMessage().addFrom(address);
+ msg.addFrom(address);
                     }
                 }
                 //Can't place an else statement here because the 'from' is
@@ -3106,16 +3103,16 @@
                 //header.
             } catch (final MessagingException ME) {
                 reportError(ME.getMessage(), ME, ErrorManager.FORMAT_FAILURE);
- setDefaultFrom(ctx);
+ setDefaultFrom(msg);
             }
         } else {
- setDefaultFrom(ctx);
+ setDefaultFrom(msg);
         }
     }
 
- private void setDefaultFrom(final MessageContext ctx) {
+ private void setDefaultFrom(final Message msg) {
         try {
- ctx.getMessage().setFrom();
+ msg.setFrom();
         } catch (final MessagingException ME) {
             reportError(ME.getMessage(), ME, ErrorManager.FORMAT_FAILURE);
         }
@@ -3124,20 +3121,20 @@
     /**
      * Computes the default to-address if none was specified. This can
      * fail if the local address can't be computed.
- * @param ctx the message context
- * @since JavaMail 1.5
+ * @param msg the message
+ * @since JavaMail 1.5.0
      */
- private void setDefaultRecipient(final MessageContext ctx) {
+ private void setDefaultRecipient(final Message msg) {
         try {
- Address a = InternetAddress.getLocalAddress(ctx.getSession());
+ Address a = InternetAddress.getLocalAddress(msg.getSession());
             if (a != null) {
- ctx.getMessage().setRecipient(Message.RecipientType.TO, a);
+ msg.setRecipient(Message.RecipientType.TO, a);
             } else {
- final MimeMessage m = new MimeMessage(ctx.getSession());
+ final MimeMessage m = new MimeMessage(msg.getSession());
                 m.setFrom(); //Should throw an exception with a cause.
                 Address[] from = m.getFrom();
- if (from != null && from.length > 0) {
- ctx.getMessage().addFrom(from);
+ if (from.length > 0) {
+ msg.addFrom(from);
                 } else {
                     throw new MessagingException("No local address.");
                 }
@@ -3148,13 +3145,13 @@
         }
     }
 
- private void setReplyTo(final MessageContext ctx) {
- final String reply = ctx.getSession().getProperty("mail.reply.to");
+ private void setReplyTo(final Message msg) {
+ final String reply = msg.getSession().getProperty("mail.reply.to");
         if (!isEmpty(reply)) {
             try {
                 final Address[] address = InternetAddress.parse(reply, false);
- if (address != null && address.length > 0) {
- ctx.getMessage().setReplyTo(address);
+ if (address.length > 0) {
+ msg.setReplyTo(address);
                 }
             } catch (final MessagingException ME) {
                 reportError(ME.getMessage(), ME, ErrorManager.FORMAT_FAILURE);
@@ -3162,15 +3159,14 @@
         }
     }
 
- private void setSender(final MessageContext ctx) {
- final Message msg = ctx.getMessage();
+ private void setSender(final Message msg) {
         assert msg instanceof MimeMessage : msg;
- final String sender = ctx.getSession().getProperty("mail.sender");
+ final String sender = msg.getSession().getProperty("mail.sender");
         if (!isEmpty(sender)) {
             try {
                 final InternetAddress[] address =
                         InternetAddress.parse(sender, false);
- if (address != null && address.length > 0) {
+ if (address.length > 0) {
                     ((MimeMessage) msg).setSender(address[0]);
                     if (address.length > 1) {
                         reportError("Ignoring other senders.",
@@ -3191,21 +3187,21 @@
 
     /**
      * Sets the recipient for the given message.
- * @param ctx the context containing the message.
+ * @param msg the message.
      * @param key the key to search in the session.
      * @param type the recipient type.
      * @return true if the key was contained in the session.
      */
- private boolean setRecipient(final MessageContext ctx,
+ private boolean setRecipient(final Message msg,
             final String key, final Message.RecipientType type) {
         boolean containsKey;
- final String value = ctx.getSession().getProperty(key);
+ final String value = msg.getSession().getProperty(key);
         containsKey = value != null;
         if (!isEmpty(value)) {
             try {
                 final Address[] address = InternetAddress.parse(value, false);
- if (address != null && address.length > 0) {
- ctx.getMessage().setRecipients(type, address);
+ if (address.length > 0) {
+ msg.setRecipients(type, address);
                 }
             } catch (final MessagingException ME) {
                 reportError(ME.getMessage(), ME, ErrorManager.FORMAT_FAILURE);

diff -r 5e2d9dbe615b -r 0b49cb3cd71c mail/src/test/java/com/sun/mail/util/logging/LogManagerPropertiesTest.java
--- a/mail/src/test/java/com/sun/mail/util/logging/LogManagerPropertiesTest.java Fri Mar 08 15:36:44 2013 -0800
+++ b/mail/src/test/java/com/sun/mail/util/logging/LogManagerPropertiesTest.java Fri Mar 08 15:37:30 2013 -0800
@@ -407,6 +407,31 @@
     }
 
     @Test
+ public void testReverseOrder() throws Exception {
+ try {
+ LogManagerProperties.reverseOrder(null);
+ fail("Null was allowed.");
+ } catch (NullPointerException expect) {
+ }
+
+ Comparator<LogRecord> c = new ErrorComparator();
+ Comparator<LogRecord> r = LogManagerProperties.reverseOrder(c);
+ assertTrue(c.getClass() != r.getClass());
+ assertFalse(r instanceof ErrorComparator);
+ assertFalse(r instanceof AscComparator);
+ assertFalse(r instanceof DescComparator);
+
+ c = new AscComparator();
+ r = LogManagerProperties.reverseOrder(c);
+ assertTrue(r instanceof DescComparator);
+
+ c = new AscComparator();
+ r = LogManagerProperties.reverseOrder(c);
+ assertTrue(r instanceof DescComparator);
+ }
+
+
+ @Test
     public void testNewErrorManager() throws Exception {
         try {
             LogManagerProperties.newErrorManager(null);
@@ -703,7 +728,8 @@
         }
     }
 
- public static class ErrorComparator implements Comparator<LogRecord>, Serializable {
+ public static class ErrorComparator implements Comparator<LogRecord>,
+ Serializable {
 
         private static final long serialVersionUID = 1L;
 
@@ -716,6 +742,32 @@
         }
     }
 
+ public static class AscComparator implements Comparator<LogRecord>,
+ Serializable {
+ private static final long serialVersionUID = 1L;
+
+ public int compare(LogRecord r1, LogRecord r2) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Comparator<LogRecord> reverseOrder() {
+ return new DescComparator();
+ }
+ }
+
+ public static class DescComparator implements Comparator<LogRecord>,
+ Serializable {
+ private static final long serialVersionUID = 1L;
+
+ public int compare(LogRecord r1, LogRecord r2) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Comparator<LogRecord> reverseOrder() {
+ return new AscComparator();
+ }
+ }
+
     public static class ErrorFilter implements Filter {
 
         public ErrorFilter() {

diff -r 5e2d9dbe615b -r 0b49cb3cd71c mail/src/test/java/com/sun/mail/util/logging/MailHandlerTest.java
--- a/mail/src/test/java/com/sun/mail/util/logging/MailHandlerTest.java Fri Mar 08 15:36:44 2013 -0800
+++ b/mail/src/test/java/com/sun/mail/util/logging/MailHandlerTest.java Fri Mar 08 15:37:30 2013 -0800
@@ -2692,9 +2692,9 @@
 
     @Test
     public void testEmptyAddressParse() throws Exception {
- //Assumed in the MailHandler.setFrom.
+ //Assumed to never return null in the MailHandler.
         InternetAddress[] a = InternetAddress.parse("", false);
- assertTrue(a == null || a.length == 0);
+ assertTrue(a.length == 0);
     }
 
     @Test
@@ -2914,8 +2914,8 @@
             fail(re.toString());
         }
 
-
         assertEquals(instance.getAttachmentFormatters().length, 2);
+ //Force a subclass array.
         instance.setAttachmentFilters(new ThrowFilter[]{new ThrowFilter(), new ThrowFilter()});
         assertEquals(Filter[].class, instance.get
[truncated due to length]