commits@javamail.java.net

[javamail~mercurial:515] 1.5 profile needs to use 1.5 compiler.

From: <shannon_at_kenai.com>
Date: Mon, 11 Feb 2013 23:31:39 +0000

Project: javamail
Repository: mercurial
Revision: 515
Author: shannon
Date: 2013-02-11 22:04:52 UTC
Link:

Log Message:
------------
Update version to 1.5-SNAPSHOT. Compile with 1.5 compiler.
add FetchProfile.Item.SIZE - bug 5682
fix protected fields in final classes in javax.mail.search - bug 5683
add MimeMultipart(String subtype, BodyPart... bps) constructor - bug 5684
ParameterList needs to support use by IMAP - bug 5686
ContentType.toString and ContentDisposition.toString should never return null -
bug 5687
add Transport.send(msg, username, password) method - bug 5689
add MimeMessage.setFrom(String) method - bug 5690
add Message.getSession() method - bug 5691
MimeBodyPart.attachFile should set the disposition to ATTACHMENT - bug 5692
add MimeMessage.reply(replyToAll, setAnswered) method - bug 5693
add additional "next" methods to HeaderTokenizer to help parsing bad headers -
bug 5694
add @MailSessionDefinition and @MailSessionDefinitions annotations for Java EE 7bug 5743
make cachedContent field protected in MimeMessage and MimeBodyPart - bug 5769
make MimeMultipart fields protected to allow subclassing - bug 5770
remove non-Boyer-Moore parse method that is no longer needed
Fix javadoc @link.
Fix typo in javadocs.
exceptions should support exception chaining - bug 5685
fix copyright date, javadoc typos, missing @since
fix copyright dates
fix typo in javadoc
remove SocksSupport class, which is no longer needed with JDK 1.5
fix documentation for newly standard properties - bug 5770
need simple way to override MIME type and encoding of attachment - bug 5818
enable RFC 2231 support by default - bug 5819
Add spec of all JavaMail 1.5 changes.
Oops, forgot to add the EncodingAware interface.
Merge with 1.4.6.
1.5 profile needs to use 1.5 compiler.


Revisions:
----------
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515


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
doc/release/CHANGES.txt
mail/src/main/java/com/sun/mail/imap/IMAPFolder.java
mail/src/main/java/com/sun/mail/imap/IMAPMessage.java
mail/src/main/java/javax/mail/FetchProfile.java
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/javax/mail/internet/MimeMultipart.java
mail/src/main/java/com/sun/mail/imap/protocol/BODYSTRUCTURE.java
mail/src/main/java/javax/mail/internet/ParameterList.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/Transport.java
mail/src/main/java/javax/mail/internet/MimeMessage.java
mail/src/main/java/javax/mail/Message.java
mail/src/main/java/javax/mail/internet/MimeBodyPart.java
mail/src/main/java/javax/mail/internet/HeaderTokenizer.java
mail/src/main/java/javax/mail/Flags.java
mail/src/main/java/javax/mail/AuthenticationFailedException.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/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/test/java/javax/mail/internet/MimeUtilityTest.java
gimap/src/main/java/com/sun/mail/gimap/GmailMessage.java
mail/src/main/java/com/sun/mail/util/SocketFetcher.java
mail/src/main/java/javax/mail/internet/package.html
mail/src/main/java/javax/mail/internet/MimeUtility.java
.hgtags
gimap/src/main/java/com/sun/mail/gimap/package.html
gimap/src/main/java/com/sun/mail/gimap/protocol/GmailProtocol.java
mail/src/main/java/com/sun/mail/iap/Response.java
mail/src/test/java/javax/mail/internet/ParameterListDecode.java
mail/src/test/resources/javax/mail/internet/paramdata


Added Paths:
------------
mail/src/main/java/javax/mail/MailSessionDefinition.java
mail/src/main/java/javax/mail/MailSessionDefinitions.java
doc/spec/JavaMail-1.5-changes.txt
mail/src/main/java/javax/mail/EncodingAware.java


Diffs:
------
diff -r 1b4bafe49b74 -r 049dad1bd181 client/pom.xml
--- a/client/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/client/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 1b4bafe49b74 -r 049dad1bd181 demo/pom.xml
--- a/demo/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/demo/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 1b4bafe49b74 -r 049dad1bd181 dsn/pom.xml
--- a/dsn/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/dsn/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 1b4bafe49b74 -r 049dad1bd181 gimap/pom.xml
--- a/gimap/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/gimap/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 1b4bafe49b74 -r 049dad1bd181 imap/pom.xml
--- a/imap/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/imap/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>parent-distrib</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
         <relativePath>../parent-distrib/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 1b4bafe49b74 -r 049dad1bd181 javadoc/pom.xml
--- a/javadoc/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/javadoc/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -48,13 +48,13 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>
     <artifactId>javadoc</artifactId>
     <packaging>pom</packaging>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
     <name>JavaMail API javadocs</name>
     <description>${project.name}</description>
 

diff -r 1b4bafe49b74 -r 049dad1bd181 logging/pom.xml
--- a/logging/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/logging/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 1b4bafe49b74 -r 049dad1bd181 mail/pom.xml
--- a/mail/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/mail/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 1b4bafe49b74 -r 049dad1bd181 mailapi/pom.xml
--- a/mailapi/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/mailapi/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -56,7 +56,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 1b4bafe49b74 -r 049dad1bd181 mailapijar/pom.xml
--- a/mailapijar/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/mailapijar/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -55,7 +55,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>javax.mail</groupId>

diff -r 1b4bafe49b74 -r 049dad1bd181 mbox/dist/pom.xml
--- a/mbox/dist/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/mbox/dist/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 1b4bafe49b74 -r 049dad1bd181 mbox/native/pom.xml
--- a/mbox/native/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/mbox/native/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 1b4bafe49b74 -r 049dad1bd181 mbox/pom.xml
--- a/mbox/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/mbox/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 1b4bafe49b74 -r 049dad1bd181 oldmail/pom.xml
--- a/oldmail/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/oldmail/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -53,7 +53,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>javax.mail</groupId>

diff -r 1b4bafe49b74 -r 049dad1bd181 outlook/pom.xml
--- a/outlook/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/outlook/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 1b4bafe49b74 -r 049dad1bd181 parent-distrib/pom.xml
--- a/parent-distrib/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/parent-distrib/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 1b4bafe49b74 -r 049dad1bd181 pom.xml
--- a/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -54,7 +54,7 @@
     <groupId>com.sun.mail</groupId>
     <artifactId>all</artifactId>
     <packaging>pom</packaging>
- <version>1.4.6-rc1</version>
+ <version>1.5-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.4.6-rc1</mail.version>
+ <mail.version>1.5-SNAPSHOT</mail.version>
         <!-- like mail.version, but with underscores instead of dots -->
- <mail.zipversion>1_4_6-rc1</mail.zipversion>
+ <mail.zipversion>1_5-SNAPSHOT</mail.zipversion>
         <mail.spec.version>1.4</mail.spec.version>
         <activation-api.version>1.1</activation-api.version>
         <!-- defaults that are overridden in mail module -->
@@ -278,14 +278,14 @@
         </profile>
 
         <!--
- A special profile for compiling with the real JDK 1.4
+ A special profile for compiling with the real JDK 1.5
             compiler, to make sure there are no accidental dependencies
- on JDK 1.5 APIs. Set the property javac.path to the path
- to the JDK 1.4 compiler, e.g.,
- "mvn -P1.4 -Djavac.path=/opt/jdk1.4/bin/javac".
+ on JDK 1.6 or newer APIs. Set the property javac.path to the path
+ to the JDK 1.5 compiler, e.g.,
+ "mvn -P1.5 -Djavac.path=/opt/jdk1.5/bin/javac".
         -->
         <profile>
- <id>1.4</id>
+ <id>1.5</id>
             <build>
                 <plugins>
                     <plugin>
@@ -297,20 +297,8 @@
                                     <fork>true</fork>
                                     <executable>${javac.path}</executable>
                                     <compilerVersion>1.4</compilerVersion>
- <source>1.4</source>
- <target>1.4</target>
- <!-- these classes depend on JDK 1.5 APIs -->
- <excludes>
- <exclude>
- com/sun/mail/imap/protocol/IMAPSaslAuthenticator.java
- </exclude>
- <exclude>
- com/sun/mail/smtp/SMTPSaslAuthenticator.java
- </exclude>
- <exclude>
- com/sun/mail/util/SocksSupport.java
- </exclude>
- </excludes>
+ <source>1.5</source>
+ <target>1.5</target>
                                 </configuration>
                             </execution>
                         </executions>
@@ -419,8 +407,7 @@
             </plugin>
 
             <!--
- Use the 1.4 compiler for JavaMail itself, but use the
- 1.5 compiler for the test classes, so we can use JUnit 4.
+ Use the 1.5 compiler for JavaMail itself and the test classes.
             -->
             <plugin>
                 <artifactId>maven-compiler-plugin</artifactId>
@@ -428,8 +415,8 @@
                     <execution>
                         <id>default-compile</id>
                         <configuration>
- <source>1.4</source>
- <target>1.4</target>
+ <source>1.5</source>
+ <target>1.5</target>
                         </configuration>
                     </execution>
                     <execution>

diff -r 1b4bafe49b74 -r 049dad1bd181 pop3/pom.xml
--- a/pop3/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/pop3/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>parent-distrib</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
         <relativePath>../parent-distrib/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 1b4bafe49b74 -r 049dad1bd181 servlet/pom.xml
--- a/servlet/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/servlet/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 1b4bafe49b74 -r 049dad1bd181 smtp/pom.xml
--- a/smtp/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/smtp/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>parent-distrib</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
         <relativePath>../parent-distrib/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

diff -r 1b4bafe49b74 -r 049dad1bd181 taglib/pom.xml
--- a/taglib/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/taglib/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>

diff -r 1b4bafe49b74 -r 049dad1bd181 webapp/pom.xml
--- a/webapp/pom.xml Tue Dec 04 14:56:31 2012 -0800
+++ b/webapp/pom.xml Thu Dec 20 14:52:42 2012 -0800
@@ -48,7 +48,7 @@
     <parent>
         <groupId>com.sun.mail</groupId>
         <artifactId>all</artifactId>
- <version>1.4.6-rc1</version>
+ <version>1.5-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.mail</groupId>


diff -r 049dad1bd181 -r cd6c3abe034a doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Thu Dec 20 14:52:42 2012 -0800
+++ b/doc/release/CHANGES.txt Thu Dec 20 15:08:47 2012 -0800
@@ -14,6 +14,13 @@
         https://kenai.com/bugzilla/
 
 
+ CHANGES IN THE 1.5 RELEASE
+ --------------------------
+The following bugs have been fixed in the 1.5 release.
+
+K 5682 add FetchProfile.Item.SIZE
+
+
                   CHANGES IN THE 1.4.6 RELEASE
                   ----------------------------
 The following bugs have been fixed in the 1.4.6 release.

diff -r 049dad1bd181 -r cd6c3abe034a mail/src/main/java/com/sun/mail/imap/IMAPFolder.java
--- a/mail/src/main/java/com/sun/mail/imap/IMAPFolder.java Thu Dec 20 14:52:42 2012 -0800
+++ b/mail/src/main/java/com/sun/mail/imap/IMAPFolder.java Thu Dec 20 15:08:47 2012 -0800
@@ -306,7 +306,9 @@
          * This item indicates that the sizes of the messages in the specified
          * range are desired to be prefetched. <p>
          *
- * SIZE should move to FetchProfile.Item in JavaMail 1.3.
+ * SIZE was moved to FetchProfile.Item in JavaMail 1.5.
+ *
+ * @deprecated
          */
         public static final FetchProfileItem SIZE =
                 new FetchProfileItem("SIZE");
@@ -1045,7 +1047,8 @@
                 command.append(first ? "RFC822.HEADER" : " RFC822.HEADER");
             first = false;
         }
- if (fp.contains(IMAPFolder.FetchProfileItem.SIZE)) {
+ if (fp.contains(FetchProfile.Item.SIZE) ||
+ fp.contains(IMAPFolder.FetchProfileItem.SIZE)) {
             command.append(first ? "RFC822.SIZE" : " RFC822.SIZE");
             first = false;
         }

diff -r 049dad1bd181 -r cd6c3abe034a mail/src/main/java/com/sun/mail/imap/IMAPMessage.java
--- a/mail/src/main/java/com/sun/mail/imap/IMAPMessage.java Thu Dec 20 14:52:42 2012 -0800
+++ b/mail/src/main/java/com/sun/mail/imap/IMAPMessage.java Thu Dec 20 15:08:47 2012 -0800
@@ -990,6 +990,8 @@
                 needFlags = true;
             if (fp.contains(FetchProfile.Item.CONTENT_INFO))
                 needBodyStructure = true;
+ if (fp.contains(FetchProfile.Item.SIZE))
+ needSize = true;
             if (fp.contains(UIDFolder.FetchProfileItem.UID))
                 needUID = true;
             if (fp.contains(IMAPFolder.FetchProfileItem.HEADERS))

diff -r 049dad1bd181 -r cd6c3abe034a mail/src/main/java/javax/mail/FetchProfile.java
--- a/mail/src/main/java/javax/mail/FetchProfile.java Thu Dec 20 14:52:42 2012 -0800
+++ b/mail/src/main/java/javax/mail/FetchProfile.java Thu Dec 20 15:08:47 2012 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -128,6 +128,16 @@
         public static final Item CONTENT_INFO = new Item("CONTENT_INFO");
 
         /**
+ * SIZE is a fetch profile item that can be included in a
+ * <code>FetchProfile</code> during a fetch request to a Folder.
+ * This item indicates that the sizes of the messages in the specified
+ * range should be prefetched. <p>
+ *
+ * @since JavaMail 1.5
+ */
+ public static final Item SIZE = new Item("SIZE");
+
+ /**
          * This is the Flags item.
          */
         public static final Item FLAGS = new Item("FLAGS");


diff -r cd6c3abe034a -r 890f5862e065 doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Thu Dec 20 15:08:47 2012 -0800
+++ b/doc/release/CHANGES.txt Thu Dec 20 15:12:19 2012 -0800
@@ -19,6 +19,7 @@
 The following bugs have been fixed in the 1.5 release.
 
 K 5682 add FetchProfile.Item.SIZE
+K 5683 fix protected fields in final classes in javax.mail.search
 
 
                   CHANGES IN THE 1.4.6 RELEASE

diff -r cd6c3abe034a -r 890f5862e065 mail/src/main/java/javax/mail/search/AndTerm.java
--- a/mail/src/main/java/javax/mail/search/AndTerm.java Thu Dec 20 15:08:47 2012 -0800
+++ b/mail/src/main/java/javax/mail/search/AndTerm.java Thu Dec 20 15:12:19 2012 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -57,7 +57,7 @@
      *
      * @serial
      */
- protected SearchTerm[] terms;
+ private SearchTerm[] terms;
 
     private static final long serialVersionUID = -3583274505380989582L;
 

diff -r cd6c3abe034a -r 890f5862e065 mail/src/main/java/javax/mail/search/FlagTerm.java
--- a/mail/src/main/java/javax/mail/search/FlagTerm.java Thu Dec 20 15:08:47 2012 -0800
+++ b/mail/src/main/java/javax/mail/search/FlagTerm.java Thu Dec 20 15:12:19 2012 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -58,14 +58,14 @@
      *
      * @serial
      */
- protected boolean set;
+ private boolean set;
 
     /**
      * Flags object containing the flags to test.
      *
      * @serial
      */
- protected Flags flags;
+ private Flags flags;
 
     private static final long serialVersionUID = -142991500302030647L;
 

diff -r cd6c3abe034a -r 890f5862e065 mail/src/main/java/javax/mail/search/HeaderTerm.java
--- a/mail/src/main/java/javax/mail/search/HeaderTerm.java Thu Dec 20 15:08:47 2012 -0800
+++ b/mail/src/main/java/javax/mail/search/HeaderTerm.java Thu Dec 20 15:12:19 2012 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -56,7 +56,7 @@
      *
      * @serial
      */
- protected String headerName;
+ private String headerName;
 
     private static final long serialVersionUID = 8342514650333389122L;
 

diff -r cd6c3abe034a -r 890f5862e065 mail/src/main/java/javax/mail/search/NotTerm.java
--- a/mail/src/main/java/javax/mail/search/NotTerm.java Thu Dec 20 15:08:47 2012 -0800
+++ b/mail/src/main/java/javax/mail/search/NotTerm.java Thu Dec 20 15:12:19 2012 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -54,7 +54,7 @@
      *
      * @serial
      */
- protected SearchTerm term;
+ private SearchTerm term;
 
     private static final long serialVersionUID = 7152293214217310216L;
 

diff -r cd6c3abe034a -r 890f5862e065 mail/src/main/java/javax/mail/search/OrTerm.java
--- a/mail/src/main/java/javax/mail/search/OrTerm.java Thu Dec 20 15:08:47 2012 -0800
+++ b/mail/src/main/java/javax/mail/search/OrTerm.java Thu Dec 20 15:12:19 2012 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -56,7 +56,7 @@
      *
      * @serial
      */
- protected SearchTerm[] terms;
+ private SearchTerm[] terms;
 
     private static final long serialVersionUID = 5380534067523646936L;
 

diff -r cd6c3abe034a -r 890f5862e065 mail/src/main/java/javax/mail/search/RecipientTerm.java
--- a/mail/src/main/java/javax/mail/search/RecipientTerm.java Thu Dec 20 15:08:47 2012 -0800
+++ b/mail/src/main/java/javax/mail/search/RecipientTerm.java Thu Dec 20 15:12:19 2012 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -56,7 +56,7 @@
      *
      * @serial
      */
- protected Message.RecipientType type;
+ private Message.RecipientType type;
 
     private static final long serialVersionUID = 6548700653122680468L;
 


diff -r 890f5862e065 -r 65bc44e9e962 doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Thu Dec 20 15:12:19 2012 -0800
+++ b/doc/release/CHANGES.txt Thu Dec 20 15:19:08 2012 -0800
@@ -20,6 +20,7 @@
 
 K 5682 add FetchProfile.Item.SIZE
 K 5683 fix protected fields in final classes in javax.mail.search
+K 5684 add MimeMultipart(String subtype, BodyPart... bps) constructor
 
 
                   CHANGES IN THE 1.4.6 RELEASE

diff -r 890f5862e065 -r 65bc44e9e962 mail/src/main/java/javax/mail/internet/MimeMultipart.java
--- a/mail/src/main/java/javax/mail/internet/MimeMultipart.java Thu Dec 20 15:12:19 2012 -0800
+++ b/mail/src/main/java/javax/mail/internet/MimeMultipart.java Thu Dec 20 15:19:08 2012 -0800
@@ -183,6 +183,31 @@
     }
 
     /**
+ * Construct a MimeMultipart object of the default "mixed" subtype,
+ * and with the given body parts. More body parts may be added later.
+ *
+ * @since JavaMail 1.5
+ */
+ public MimeMultipart(BodyPart... parts) throws MessagingException {
+ this();
+ for (BodyPart bp : parts)
+ super.addBodyPart(bp);
+ }
+
+ /**
+ * Construct a MimeMultipart object of the given subtype
+ * and with the given body parts. More body parts may be added later.
+ *
+ * @since JavaMail 1.5
+ */
+ public MimeMultipart(String subtype, BodyPart... parts)
+ throws MessagingException {
+ this(subtype);
+ for (BodyPart bp : parts)
+ super.addBodyPart(bp);
+ }
+
+ /**
      * Constructs a MimeMultipart object and its bodyparts from the
      * given DataSource. <p>
      *


diff -r 65bc44e9e962 -r cc97d6bf89cb doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Thu Dec 20 15:19:08 2012 -0800
+++ b/doc/release/CHANGES.txt Thu Dec 20 15:21:34 2012 -0800
@@ -21,6 +21,7 @@
 K 5682 add FetchProfile.Item.SIZE
 K 5683 fix protected fields in final classes in javax.mail.search
 K 5684 add MimeMultipart(String subtype, BodyPart... bps) constructor
+K 5686 ParameterList needs to support use by IMAP
 
 
                   CHANGES IN THE 1.4.6 RELEASE

diff -r 65bc44e9e962 -r cc97d6bf89cb mail/src/main/java/com/sun/mail/imap/protocol/BODYSTRUCTURE.java
--- a/mail/src/main/java/com/sun/mail/imap/protocol/BODYSTRUCTURE.java Thu Dec 20 15:19:08 2012 -0800
+++ b/mail/src/main/java/com/sun/mail/imap/protocol/BODYSTRUCTURE.java Thu Dec 20 15:21:34 2012 -0800
@@ -401,7 +401,7 @@
                     System.out.println("DEBUG IMAP: parameter value " + value);
                 list.set(name, value);
             } while (r.readByte() != ')');
- list.set(null, "DONE"); // XXX - hack
+ list.combineSegments();
         } else if (b == 'N' || b == 'n') {
             if (parseDebug)
                 System.out.println("DEBUG IMAP: parameter list NIL");

diff -r 65bc44e9e962 -r cc97d6bf89cb mail/src/main/java/javax/mail/internet/ParameterList.java
--- a/mail/src/main/java/javax/mail/internet/ParameterList.java Thu Dec 20 15:19:08 2012 -0800
+++ b/mail/src/main/java/javax/mail/internet/ParameterList.java Thu Dec 20 15:21:34 2012 -0800
@@ -302,6 +302,36 @@
     }
 
     /**
+ * Normal users of this class will use simple parameter names.
+ * In some cases, for example, when processing IMAP protocol
+ * messages, individual segments of a multi-segment name
+ * (specified by RFC 2231) will be encountered and passed to
+ * the {_at_link #set} method. After all these segments are added
+ * to this ParameterList, they need to be combined to represent
+ * the logical parameter name and value. This method will combine
+ * all segments of multi-segment names. <p>
+ *
+ * Normal users should never need to call this method.
+ *
+ * @since JavaMail 1.5
+ */
+ public void combineSegments() {
+ /*
+ * If we've accumulated any multi-segment names from calls to
+ * the set method from (e.g.) the IMAP provider, combine the pieces.
+ * Ignore any parse errors (e.g., from decoding the values)
+ * because it's too late to report them.
+ */
+ if (decodeParameters && multisegmentNames.size() > 0) {
+ try {
+ combineMultisegmentNames(true);
+ } catch (ParseException pex) {
+ // too late to do anything about it
+ }
+ }
+ }
+
+ /**
      * If the name is an encoded or multi-segment name (or both)
      * handle it appropriately, storing the appropriate String
      * or Value object. Multi-segment names are stored in the
@@ -486,24 +516,6 @@
      * @param value value of the parameter.
      */
     public void set(String name, String value) {
- // XXX - an incredible kludge used by the IMAP provider
- // to indicate that it's done setting parameters
- if (name == null && value != null && value.equals("DONE")) {
- /*
- * If we've accumulated any multi-segment names from calls to
- * the set method from the IMAP provider, combine the pieces.
- * Ignore any parse errors (e.g., from decoding the values)
- * because it's too late to report them.
- */
- if (decodeParameters && multisegmentNames.size() > 0) {
- try {
- combineMultisegmentNames(true);
- } catch (ParseException pex) {
- // too late to do anything about it
- }
- }
- return;
- }
         name = name.trim().toLowerCase(Locale.ENGLISH);
         if (decodeParameters) {
             try {


diff -r cc97d6bf89cb -r 7a91c5efd9c9 doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Thu Dec 20 15:21:34 2012 -0800
+++ b/doc/release/CHANGES.txt Thu Dec 20 15:25:24 2012 -0800
@@ -22,6 +22,7 @@
 K 5683 fix protected fields in final classes in javax.mail.search
 K 5684 add MimeMultipart(String subtype, BodyPart... bps) constructor
 K 5686 ParameterList needs to support use by IMAP
+K 5687 ContentType.toString & ContentDisposition.toString shouldn't return null
 
 
                   CHANGES IN THE 1.4.6 RELEASE

diff -r cc97d6bf89cb -r 7a91c5efd9c9 mail/src/main/java/javax/mail/internet/ContentDisposition.java
--- a/mail/src/main/java/javax/mail/internet/ContentDisposition.java Thu Dec 20 15:21:34 2012 -0800
+++ b/mail/src/main/java/javax/mail/internet/ContentDisposition.java Thu Dec 20 15:25:24 2012 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -168,7 +168,7 @@
 
     /**
      * Retrieve a RFC2045 style string representation of
- * this ContentDisposition. Returns <code>null</code> if
+ * this ContentDisposition. Returns an empty string if
      * the conversion failed.
      *
      * @return RFC2045 style string
@@ -176,7 +176,7 @@
      */
     public String toString() {
         if (disposition == null)
- return null;
+ return "";
 
         if (list == null)
             return disposition;

diff -r cc97d6bf89cb -r 7a91c5efd9c9 mail/src/main/java/javax/mail/internet/ContentType.java
--- a/mail/src/main/java/javax/mail/internet/ContentType.java Thu Dec 20 15:21:34 2012 -0800
+++ b/mail/src/main/java/javax/mail/internet/ContentType.java Thu Dec 20 15:25:24 2012 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -45,9 +45,9 @@
 import java.io.*;
 
 /**
- * This class represents a MIME ContentType value. It provides
- * methods to parse a ContentType string into individual components
- * and to generate a MIME style ContentType string.
+ * This class represents a MIME Content-Type value. It provides
+ * methods to parse a Content-Type string into individual components
+ * and to generate a MIME style Content-Type string.
  *
  * @author John Mani
  */
@@ -203,14 +203,14 @@
 
     /**
      * Retrieve a RFC2045 style string representation of
- * this Content-Type. Returns <code>null</code> if
+ * this Content-Type. Returns an empty string if
      * the conversion failed.
      *
      * @return RFC2045 style string
      */
     public String toString() {
         if (primaryType == null || subType == null) // need both
- return null;
+ return "";
 
         StringBuffer sb = new StringBuffer();
         sb.append(primaryType).append('/').append(subType);


diff -r 7a91c5efd9c9 -r 9039372fff74 doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Thu Dec 20 15:25:24 2012 -0800
+++ b/doc/release/CHANGES.txt Thu Dec 20 15:27:55 2012 -0800
@@ -23,6 +23,7 @@
 K 5684 add MimeMultipart(String subtype, BodyPart... bps) constructor
 K 5686 ParameterList needs to support use by IMAP
 K 5687 ContentType.toString & ContentDisposition.toString shouldn't return null
+K 5689 add Transport.send(msg, username, password) method
 
 
                   CHANGES IN THE 1.4.6 RELEASE

diff -r 7a91c5efd9c9 -r 9039372fff74 mail/src/main/java/javax/mail/Transport.java
--- a/mail/src/main/java/javax/mail/Transport.java Thu Dec 20 15:25:24 2012 -0800
+++ b/mail/src/main/java/javax/mail/Transport.java Thu Dec 20 15:27:55 2012 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 1997-2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -121,7 +121,7 @@
      */
     public static void send(Message msg) throws MessagingException {
         msg.saveChanges(); // do this first
- send0(msg, msg.getAllRecipients());
+ send0(msg, msg.getAllRecipients(), null, null);
     }
 
     /**
@@ -143,12 +143,68 @@
                 throws MessagingException {
 
         msg.saveChanges();
- send0(msg, addresses);
+ send0(msg, addresses, null, null);
+ }
+
+ /**
+ * Send a message. The message will be sent to all recipient
+ * addresses specified in the message (as returned from the
+ * <code>Message</code> method <code>getAllRecipients</code>).
+ * The <code>send</code> method calls the <code>saveChanges</code>
+ * method on the message before sending it. <p>
+ *
+ * Use the specified user name and password to authenticate to
+ * the mail server.
+ *
+ * @param msg the message to send
+ * @param user the user name
+ * @param password this user's password
+ * @exception SendFailedException if the message could not
+ * be sent to some or any of the recipients.
+ * @exception MessagingException
+ * @see Message#saveChanges
+ * @see #send(Message)
+ * @see javax.mail.SendFailedException
+ * @since JavaMail 1.5
+ */
+ public static void send(Message msg,
+ String user, String password) throws MessagingException {
+
+ msg.saveChanges();
+ send0(msg, msg.getAllRecipients(), user, password);
+ }
+
+ /**
+ * Send the message to the specified addresses, ignoring any
+ * recipients specified in the message itself. The
+ * <code>send</code> method calls the <code>saveChanges</code>
+ * method on the message before sending it. <p>
+ *
+ * Use the specified user name and password to authenticate to
+ * the mail server.
+ *
+ * @param msg the message to send
+ * @param addresses the addresses to which to send the message
+ * @param user the user name
+ * @param password this user's password
+ * @exception SendFailedException if the message could not
+ * be sent to some or any of the recipients.
+ * @exception MessagingException
+ * @see Message#saveChanges
+ * @see #send(Message)
+ * @see javax.mail.SendFailedException
+ * @since JavaMail 1.5
+ */
+ public static void send(Message msg, Address[] addresses,
+ String user, String password) throws MessagingException {
+
+ msg.saveChanges();
+ send0(msg, addresses, user, password);
     }
 
     // send, but without the saveChanges
- private static void send0(Message msg, Address[] addresses)
- throws MessagingException {
+ private static void send0(Message msg, Address[] addresses,
+ String user, String password) throws MessagingException {
 
         if (addresses == null || addresses.length == 0)
             throw new SendFailedException("No recipient addresses");
@@ -191,7 +247,10 @@
         if (dsize == 1) {
             transport = s.getTransport(addresses[0]);
             try {
- transport.connect();
+ if (user != null)
+ transport.connect(user, password);
+ else
+ transport.connect();
                 transport.sendMessage(msg, addresses);
             } finally {
                 transport.close();


diff -r 9039372fff74 -r c8376dac3afe doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Thu Dec 20 15:27:55 2012 -0800
+++ b/doc/release/CHANGES.txt Thu Dec 20 15:31:19 2012 -0800
@@ -24,6 +24,7 @@
 K 5686 ParameterList needs to support use by IMAP
 K 5687 ContentType.toString & ContentDisposition.toString shouldn't return null
 K 5689 add Transport.send(msg, username, password) method
+K 5690 add MimeMessage.setFrom(String) method
 
 
                   CHANGES IN THE 1.4.6 RELEASE

diff -r 9039372fff74 -r c8376dac3afe mail/src/main/java/javax/mail/internet/MimeMessage.java
--- a/mail/src/main/java/javax/mail/internet/MimeMessage.java Thu Dec 20 15:27:55 2012 -0800
+++ b/mail/src/main/java/javax/mail/internet/MimeMessage.java Thu Dec 20 15:31:19 2012 -0800
@@ -387,6 +387,26 @@
     }
 
     /**
+ * Set the RFC 822 "From" header field. Any existing values are
+ * replaced with the given addresses. If address is <code>null</code>,
+ * this header is removed.
+ *
+ * @param address the sender(s) of this message
+ * @exception IllegalWriteException if the underlying
+ * implementation does not support modification
+ * of existing values
+ * @exception IllegalStateException if this message is
+ * obtained from a READ_ONLY folder.
+ * @exception MessagingException
+ */
+ public void setFrom(String address) throws MessagingException {
+ if (address == null)
+ removeHeader("From");
+ else
+ setAddressHeader("From", InternetAddress.parse(address));
+ }
+
+ /**
      * Set the RFC 822 "From" header field using the value of the
      * <code>InternetAddress.getLocalAddress</code> method.
      *


diff -r c8376dac3afe -r 2db1cae5b9cb doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Thu Dec 20 15:31:19 2012 -0800
+++ b/doc/release/CHANGES.txt Thu Dec 20 15:33:46 2012 -0800
@@ -25,6 +25,7 @@
 K 5687 ContentType.toString & ContentDisposition.toString shouldn't return null
 K 5689 add Transport.send(msg, username, password) method
 K 5690 add MimeMessage.setFrom(String) method
+K 5691 add Message.getSession() method
 
 
                   CHANGES IN THE 1.4.6 RELEASE

diff -r c8376dac3afe -r 2db1cae5b9cb mail/src/main/java/javax/mail/Message.java
--- a/mail/src/main/java/javax/mail/Message.java Thu Dec 20 15:31:19 2012 -0800
+++ b/mail/src/main/java/javax/mail/Message.java Thu Dec 20 15:33:46 2012 -0800
@@ -132,6 +132,16 @@
     }
 
     /**
+ * Return the Session used when this message was created.
+ *
+ * @return the message's Session
+ * @since JavaMail 1.5
+ */
+ public Session getSession() {
+ return session;
+ }
+
+ /**
      * Returns the "From" attribute. The "From" attribute contains
      * the identity of the person(s) who wished this message to
      * be sent. <p>


diff -r 2db1cae5b9cb -r 1a612c7ac564 doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Thu Dec 20 15:33:46 2012 -0800
+++ b/doc/release/CHANGES.txt Thu Dec 20 15:38:41 2012 -0800
@@ -26,6 +26,7 @@
 K 5689 add Transport.send(msg, username, password) method
 K 5690 add MimeMessage.setFrom(String) method
 K 5691 add Message.getSession() method
+K 5692 MimeBodyPart.attachFile should set the disposition to ATTACHMENT
 
 
                   CHANGES IN THE 1.4.6 RELEASE

diff -r 2db1cae5b9cb -r 1a612c7ac564 mail/src/main/java/javax/mail/internet/MimeBodyPart.java
--- a/mail/src/main/java/javax/mail/internet/MimeBodyPart.java Thu Dec 20 15:33:46 2012 -0800
+++ b/mail/src/main/java/javax/mail/internet/MimeBodyPart.java Thu Dec 20 15:38:41 2012 -0800
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 1997-2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -775,7 +775,8 @@
      * The simple file name is used as the file name for this
      * part and the data in the file is used as the data for this
      * part. The encoding will be chosen appropriately for the
- * file data.
+ * file data. The disposition of this part is set to
+ * {_at_link Part#ATTACHMENT Part.ATTACHMENT}.
      *
      * @param file the File object to attach
      * @exception IOException errors related to accessing the file
@@ -783,9 +784,10 @@
      * @since JavaMail 1.4
      */
     public void attachFile(File file) throws IOException, MessagingException {
- FileDataSource fds = new FileDataSource(file);
- this.setDataHandler(new DataHandler(fds));
- this.setFileName(fds.getName());
+ FileDataSource fds = new FileDataSource(file);
+ this.setDataHandler(new DataHandler(fds));
+ this.setFileName(fds.getName());
+ this.setDisposition(ATTACHMENT);
     }
 
     /**


diff -r 1a612c7ac564 -r c1a0920cabcf doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Thu Dec 20 15:38:41 2012 -0800
+++ b/doc/release/CHANGES.txt Thu Dec 20 15:42:59 2012 -0800
@@ -27,6 +27,7 @@
 K 5690 add MimeMessage.setFrom(String) method
 K 5691 add Message.getSession() method
 K 5692 MimeBodyPart.attachFile should set the disposition to ATTACHMENT
+K 5693 add MimeMessage.reply(replyToAll, setAnswered) method
 
 
                   CHANGES IN THE 1.4.6 RELEASE

diff -r 1a612c7ac564 -r c1a0920cabcf mail/src/main/java/javax/mail/internet/MimeMessage.java
--- a/mail/src/main/java/javax/mail/internet/MimeMessage.java Thu Dec 20 15:38:41 2012 -0800
+++ b/mail/src/main/java/javax/mail/internet/MimeMessage.java Thu Dec 20 15:42:59 2012 -0800
@@ -1605,6 +1605,43 @@
      * @exception MessagingException
      */
     public Message reply(boolean replyToAll) throws MessagingException {
+ return reply(replyToAll, true);
+ }
+
+ /**
+ * Get a new Message suitable for a reply to this message.
+ * The new Message will have its attributes and headers
+ * set up appropriately. Note that this new message object
+ * will be empty, i.e., it will <strong>not</strong> have a "content".
+ * These will have to be suitably filled in by the client. <p>
+ *
+ * If <code>replyToAll</code> is set, the new Message will be addressed
+ * to all recipients of this message. Otherwise, the reply will be
+ * addressed to only the sender of this message (using the value
+ * of the <code>getReplyTo</code> method). <p>
+ *
+ * If <code>setAnswered> is set, the {_at_link Flags.Flag.ANSWERED ANSWERED}
+ * flag is set in this messaage. <p>
+ *
+ * The "Subject" field is filled in with the original subject
+ * prefixed with "Re:" (unless it already starts with "Re:").
+ * The "In-Reply-To" header is set in the new message if this
+ * message has a "Message-Id" header.
+ *
+ * The current implementation also sets the "References" header
+ * in the new message to include the contents of the "References"
+ * header (or, if missing, the "In-Reply-To" header) in this message,
+ * plus the contents of the "Message-Id" header of this message,
+ * as described in RFC 2822.
+ *
+ * @param replyToAll reply should be sent to all recipients
+ * of this message
+ * @return the reply Message
+ * @exception MessagingException
+ * @since JavaMail 1.5
+ */
+ public Message reply(boolean replyToAll, boolean setAnswered)
+ throws MessagingException {
         MimeMessage reply = createMimeMessage(session);
         /*
          * Have to manipulate the raw Subject header so that we don't lose
@@ -1692,10 +1729,12 @@
         if (refs != null)
             reply.setHeader("References", MimeUtility.fold(12, refs));
 
- try {
- setFlags(answeredFlag, true);
- } catch (MessagingException mex) {
- // ignore it
+ if (setAnswered) {
+ try {
+ setFlags(answeredFlag, true);
+ } catch (MessagingException mex) {
+ // ignore it
+ }
         }
         return reply;
     }


diff -r c1a0920cabcf -r a1d58319f6f1 doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Thu Dec 20 15:42:59 2012 -0800
+++ b/doc/release/CHANGES.txt Thu Dec 20 15:45:00 2012 -0800
@@ -28,6 +28,7 @@
 K 5691 add Message.getSession() method
 K 5692 MimeBodyPart.attachFile should set the disposition to ATTACHMENT
 K 5693 add MimeMessage.reply(replyToAll, setAnswered) method
+K 5694 add "next" methods to HeaderTokenizer to help parsing bad headers
 
 
                   CHANGES IN THE 1.4.6 RELEASE

diff -r c1a0920cabcf -r a1d58319f6f1 mail/src/main/java/javax/mail/internet/HeaderTokenizer.java
--- a/mail/src/main/java/javax/mail/internet/HeaderTokenizer.java Thu Dec 20 15:42:59 2012 -0800
+++ b/mail/src/main/java/javax/mail/internet/HeaderTokenizer.java Thu Dec 20 15:45:00 2012 -0800
@@ -217,8 +217,7 @@
      * @exception ParseException if the parse fails
      * @since JavaMail 1.5
      */
- // package-private; can't be public until JavaMail 1.5
- Token next(char endOfAtom) throws ParseException {
+ public Token next(char endOfAtom) throws ParseException {
         return next(endOfAtom, false);
     }
 
@@ -236,8 +235,7 @@
      * @exception ParseException if the parse fails
      * @since JavaMail 1.5
      */
- // package-private; can't be public until JavaMail 1.5
- Token next(char endOfAtom, boolean keepEscapes)
+ public Token next(char endOfAtom, boolean keepEscapes)
                                 throws ParseException {
         Token tk;
 


diff -r a1d58319f6f1 -r 9d550494c082 doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Thu Dec 20 15:45:00 2012 -0800
+++ b/doc/release/CHANGES.txt Thu Dec 20 15:47:39 2012 -0800
@@ -29,6 +29,7 @@
 K 5692 MimeBodyPart.attachFile should set the disposition to ATTACHMENT
 K 5693 add MimeMessage.reply(replyToAll, setAnswered) method
 K 5694 add "next" methods to HeaderTokenizer to help parsing bad headers
+K 5743 add @MailSessionDefinition and @MailSessionDefinitions for Java EE 7
 
 
                   CHANGES IN THE 1.4.6 RELEASE

diff -r a1d58319f6f1 -r 9d550494c082 mail/src/main/java/javax/mail/MailSessionDefinition.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/src/main/java/javax/mail/MailSessionDefinition.java Thu Dec 20 15:47:39 2012 -0800
@@ -0,0 +1,112 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
+ * or packager/legal/LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at packager/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.mail;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used by Java EE applications to define a <code>MailSession</code>
+ * to be registered with JNDI. The <code>MailSession</code> may be configured
+ * by setting the annotation elements for commonly used <code>Session</code>
+ * properties. Additional standard and vendor-specific properties may be
+ * specified using the <code>properties</code> element.
+ * <p/>
+ * The session will be registered under the name specified in the
+ * <code>name</code> element. It may be defined to be in any valid
+ * <code>Java EE</code> namespace, and will determine the accessibility of
+ * the session from other components.
+ *
+ * @since JavaMail 1.5
+ */
+_at_Target({ElementType.TYPE})
+_at_Retention(RetentionPolicy.RUNTIME)
+public @interface MailSessionDefinition {
+
+ /**
+ * Description of this mail session.
+ */
+ String description() default "";
+
+ /**
+ * JNDI name by which the mail session will be registered.
+ */
+ String name();
+
+ /**
+ * Store protocol name.
+ */
+ String storeProtocol() default "";
+
+ /**
+ * Transport protocol name.
+ */
+ String transportProtocol() default "";
+
+ /**
+ * Host name for the mail server.
+ */
+ String host() default "";
+
+ /**
+ * User name to use for authentication.
+ */
+ String user() default "";
+
+ /**
+ * Password to use for authentication.
+ */
+ String password() default "";
+
+ /**
+ * From address for the user.
+ */
+ String from() default "";
+
+ /**
+ * Properties to include in the Session.
+ * Properties are specified using the format:
+ * <i>propertyName=propertyValue</i> with one property per array element.
+ */
+ String[] properties() default {};
+}

diff -r a1d58319f6f1 -r 9d550494c082 mail/src/main/java/javax/mail/MailSessionDefinitions.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/src/main/java/javax/mail/MailSessionDefinitions.java Thu Dec 20 15:47:39 2012 -0800
@@ -0,0 +1,58 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
+ * or packager/legal/LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at packager/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.mail;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Declares one or more <code>MailSessionDefinition</code> annotations.
+ *
+ * @see MailSessionDefinition
+ * @since JavaMail 1.5
+ */
+_at_Target({ElementType.TYPE})
+_at_Retention(RetentionPolicy.RUNTIME)
+public @interface MailSessionDefinitions {
+ MailSessionDefinition[] value();
+}


diff -r 9d550494c082 -r fa1440a344ca doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Thu Dec 20 15:47:39 2012 -0800
+++ b/doc/release/CHANGES.txt Thu Dec 20 15:55:15 2012 -0800
@@ -30,6 +30,7 @@
 K 5693 add MimeMessage.reply(replyToAll, setAnswered) method
 K 5694 add "next" methods to HeaderTokenizer to help parsing bad headers
 K 5743 add @MailSessionDefinition and @MailSessionDefinitions for Java EE 7
+K 5769 make cachedContent field protected in MimeMessage and MimeBodyPart
 
 
                   CHANGES IN THE 1.4.6 RELEASE

diff -r 9d550494c082 -r fa1440a344ca mail/src/main/java/javax/mail/internet/MimeBodyPart.java
--- a/mail/src/ma
[truncated due to length]