james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1635935 - in /james/mime4j/trunk: core/src/main/java/org/apache/james/mime4j/io/ core/src/main/java/org/apache/james/mime4j/util/ dom/src/main/java/org/apache/james/mime4j/field/ dom/src/main/java/org/apache/james/mime4j/field/address/ dom...
Date Sat, 01 Nov 2014 12:07:01 GMT
Author: olegk
Date: Sat Nov  1 12:07:00 2014
New Revision: 1635935

URL: http://svn.apache.org/r1635935
Log:
Rename AddressBuilder to DefaultAddressBuilder and introduce a common interface for DefaultAddressBuilder/LenientAddressBuilder

Added:
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/AddressParser.java
      - copied, changed from r1635924, james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/AddressBuilder.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/DefaultAddressParser.java
  (contents, props changed)
      - copied, changed from r1635924, james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/AddressBuilder.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/LenientAddressParser.java
  (contents, props changed)
      - copied, changed from r1635924, james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/LenientAddressBuilder.java
Removed:
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/AddressBuilder.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/LenientAddressBuilder.java
Modified:
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/io/InputStreams.java
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/util/ContentUtil.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/AddressListFieldImpl.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/AddressListFieldLenientImpl.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxFieldImpl.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxFieldLenientImpl.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxListFieldImpl.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxListFieldLenientImpl.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageBuilder.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/FieldsTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/address/DefaultAddressBuilderTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/address/LenientAddressBuilderTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/message/MessageBuilderTest.java

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/io/InputStreams.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/io/InputStreams.java?rev=1635935&r1=1635934&r2=1635935&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/io/InputStreams.java (original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/io/InputStreams.java Sat
Nov  1 12:07:00 2014
@@ -63,16 +63,16 @@ public final class InputStreams {
         return new BinaryInputStream(b);
     }
 
-    public static InputStream createAscii(final String s) {
+    public static InputStream createAscii(final CharSequence s) {
         if (s == null) {
-            throw new IllegalArgumentException("String may not be null");
+            throw new IllegalArgumentException("CharSequence may not be null");
         }
         return new TextInputStream(s, Charsets.US_ASCII, 1024);
     }
 
-    public static InputStream create(final String s, final Charset charset) {
+    public static InputStream create(final CharSequence s, final Charset charset) {
         if (s == null) {
-            throw new IllegalArgumentException("String may not be null");
+            throw new IllegalArgumentException("CharSequence may not be null");
         }
         return new TextInputStream(s, charset != null ? charset : Charsets.DEFAULT_CHARSET,
1024);
     }

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/util/ContentUtil.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/util/ContentUtil.java?rev=1635935&r1=1635934&r2=1635935&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/util/ContentUtil.java (original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/util/ContentUtil.java Sat
Nov  1 12:07:00 2014
@@ -97,7 +97,7 @@ public class ContentUtil {
      *            string to encode.
      * @return encoded string as an immutable sequence of bytes.
      */
-    public static ByteSequence encode(String string) {
+    public static ByteSequence encode(CharSequence string) {
         if (string == null) {
             return null;
         }
@@ -118,7 +118,7 @@ public class ContentUtil {
      *            string to encode.
      * @return encoded string as an immutable sequence of bytes.
      */
-    public static ByteSequence encode(Charset charset, String string) {
+    public static ByteSequence encode(Charset charset, CharSequence string) {
         if (string == null) {
             return null;
         }

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/AddressListFieldImpl.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/AddressListFieldImpl.java?rev=1635935&r1=1635934&r2=1635935&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/AddressListFieldImpl.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/AddressListFieldImpl.java
Sat Nov  1 12:07:00 2014
@@ -23,7 +23,7 @@ import org.apache.james.mime4j.codec.Dec
 import org.apache.james.mime4j.dom.FieldParser;
 import org.apache.james.mime4j.dom.address.AddressList;
 import org.apache.james.mime4j.dom.field.AddressListField;
-import org.apache.james.mime4j.field.address.AddressBuilder;
+import org.apache.james.mime4j.field.address.DefaultAddressParser;
 import org.apache.james.mime4j.field.address.ParseException;
 import org.apache.james.mime4j.stream.Field;
 
@@ -66,7 +66,7 @@ public class AddressListFieldImpl extend
         String body = getBody();
 
         try {
-            addressList = AddressBuilder.DEFAULT.parseAddressList(body, monitor);
+            addressList = DefaultAddressParser.DEFAULT.parseAddressList(body, monitor);
         } catch (ParseException e) {
             parseException = e;
         }

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/AddressListFieldLenientImpl.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/AddressListFieldLenientImpl.java?rev=1635935&r1=1635934&r2=1635935&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/AddressListFieldLenientImpl.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/AddressListFieldLenientImpl.java
Sat Nov  1 12:07:00 2014
@@ -26,7 +26,7 @@ import org.apache.james.mime4j.dom.Field
 import org.apache.james.mime4j.dom.address.AddressList;
 import org.apache.james.mime4j.dom.address.Mailbox;
 import org.apache.james.mime4j.dom.field.AddressListField;
-import org.apache.james.mime4j.field.address.LenientAddressBuilder;
+import org.apache.james.mime4j.field.address.LenientAddressParser;
 import org.apache.james.mime4j.stream.Field;
 import org.apache.james.mime4j.stream.ParserCursor;
 import org.apache.james.mime4j.stream.RawField;
@@ -68,7 +68,7 @@ public class AddressListFieldLenientImpl
             pos = 0;
         }
         ParserCursor cursor = new ParserCursor(pos, buf.length());
-        addressList = LenientAddressBuilder.DEFAULT.parseAddressList(buf, cursor);
+        addressList = LenientAddressParser.DEFAULT.parseAddressList(buf, cursor);
     }
 
     public static final FieldParser<AddressListField> PARSER = new FieldParser<AddressListField>()
{

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxFieldImpl.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxFieldImpl.java?rev=1635935&r1=1635934&r2=1635935&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxFieldImpl.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxFieldImpl.java
Sat Nov  1 12:07:00 2014
@@ -23,7 +23,7 @@ import org.apache.james.mime4j.codec.Dec
 import org.apache.james.mime4j.dom.FieldParser;
 import org.apache.james.mime4j.dom.address.Mailbox;
 import org.apache.james.mime4j.dom.field.MailboxField;
-import org.apache.james.mime4j.field.address.AddressBuilder;
+import org.apache.james.mime4j.field.address.DefaultAddressParser;
 import org.apache.james.mime4j.field.address.ParseException;
 import org.apache.james.mime4j.stream.Field;
 
@@ -65,7 +65,7 @@ public class MailboxFieldImpl extends Ab
         String body = getBody();
 
         try {
-            mailbox = AddressBuilder.DEFAULT.parseMailbox(body, monitor);
+            mailbox = DefaultAddressParser.DEFAULT.parseMailbox(body, monitor);
         } catch (ParseException e) {
             parseException = e;
         }

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxFieldLenientImpl.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxFieldLenientImpl.java?rev=1635935&r1=1635934&r2=1635935&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxFieldLenientImpl.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxFieldLenientImpl.java
Sat Nov  1 12:07:00 2014
@@ -23,7 +23,7 @@ import org.apache.james.mime4j.codec.Dec
 import org.apache.james.mime4j.dom.FieldParser;
 import org.apache.james.mime4j.dom.address.Mailbox;
 import org.apache.james.mime4j.dom.field.MailboxField;
-import org.apache.james.mime4j.field.address.LenientAddressBuilder;
+import org.apache.james.mime4j.field.address.LenientAddressParser;
 import org.apache.james.mime4j.stream.Field;
 import org.apache.james.mime4j.stream.ParserCursor;
 import org.apache.james.mime4j.stream.RawField;
@@ -64,7 +64,7 @@ public class MailboxFieldLenientImpl ext
             pos = 0;
         }
         ParserCursor cursor = new ParserCursor(pos, buf.length());
-        mailbox = LenientAddressBuilder.DEFAULT.parseMailbox(buf, cursor, null);
+        mailbox = LenientAddressParser.DEFAULT.parseMailbox(buf, cursor, null);
     }
 
     public static final FieldParser<MailboxField> PARSER = new FieldParser<MailboxField>()
{

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxListFieldImpl.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxListFieldImpl.java?rev=1635935&r1=1635934&r2=1635935&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxListFieldImpl.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxListFieldImpl.java
Sat Nov  1 12:07:00 2014
@@ -23,7 +23,7 @@ import org.apache.james.mime4j.codec.Dec
 import org.apache.james.mime4j.dom.FieldParser;
 import org.apache.james.mime4j.dom.address.MailboxList;
 import org.apache.james.mime4j.dom.field.MailboxListField;
-import org.apache.james.mime4j.field.address.AddressBuilder;
+import org.apache.james.mime4j.field.address.DefaultAddressParser;
 import org.apache.james.mime4j.field.address.ParseException;
 import org.apache.james.mime4j.stream.Field;
 
@@ -65,7 +65,7 @@ public class MailboxListFieldImpl extend
         String body = getBody();
 
         try {
-            mailboxList = AddressBuilder.DEFAULT.parseAddressList(body, monitor).flatten();
+            mailboxList = DefaultAddressParser.DEFAULT.parseAddressList(body, monitor).flatten();
         } catch (ParseException e) {
             parseException = e;
         }

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxListFieldLenientImpl.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxListFieldLenientImpl.java?rev=1635935&r1=1635934&r2=1635935&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxListFieldLenientImpl.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/MailboxListFieldLenientImpl.java
Sat Nov  1 12:07:00 2014
@@ -26,7 +26,7 @@ import org.apache.james.mime4j.dom.Field
 import org.apache.james.mime4j.dom.address.Mailbox;
 import org.apache.james.mime4j.dom.address.MailboxList;
 import org.apache.james.mime4j.dom.field.MailboxListField;
-import org.apache.james.mime4j.field.address.LenientAddressBuilder;
+import org.apache.james.mime4j.field.address.LenientAddressParser;
 import org.apache.james.mime4j.stream.Field;
 import org.apache.james.mime4j.stream.ParserCursor;
 import org.apache.james.mime4j.stream.RawField;
@@ -68,7 +68,7 @@ public class MailboxListFieldLenientImpl
             pos = 0;
         }
         ParserCursor cursor = new ParserCursor(pos, buf.length());
-        mailboxList = LenientAddressBuilder.DEFAULT.parseAddressList(buf, cursor).flatten();
+        mailboxList = LenientAddressParser.DEFAULT.parseAddressList(buf, cursor).flatten();
     }
 
     public static final FieldParser<MailboxListField> PARSER = new FieldParser<MailboxListField>()
{

Copied: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/AddressParser.java
(from r1635924, james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/AddressBuilder.java)
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/AddressParser.java?p2=james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/AddressParser.java&p1=james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/AddressBuilder.java&r1=1635924&r2=1635935&rev=1635935&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/AddressBuilder.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/AddressParser.java
Sat Nov  1 12:07:00 2014
@@ -19,102 +19,58 @@
 
 package org.apache.james.mime4j.field.address;
 
-import java.io.StringReader;
-
-import org.apache.james.mime4j.codec.DecodeMonitor;
 import org.apache.james.mime4j.dom.address.Address;
 import org.apache.james.mime4j.dom.address.AddressList;
 import org.apache.james.mime4j.dom.address.Group;
 import org.apache.james.mime4j.dom.address.Mailbox;
 
 /**
- * Default (strict) builder for {@link Address} and its subclasses.
+ * Abstract address parser.
+ * 
  */
-public class AddressBuilder {
-
-    public static final AddressBuilder DEFAULT = new AddressBuilder();
-
-    protected AddressBuilder() {
-        super();
-    }
+public interface AddressParser {
 
     /**
      * Parses the specified raw string into an address.
      *
-     * @param rawAddressString
+     * @param text
      *            string to parse.
-     * @param monitor the DecodeMonitor to be used while parsing/decoding
      * @return an <code>Address</code> object for the specified string.
      * @throws ParseException if the raw string does not represent a single address.
      */
-    public Address parseAddress(String rawAddressString, DecodeMonitor monitor) throws ParseException
{
-        AddressListParser parser = new AddressListParser(new StringReader(
-                rawAddressString));
-        return Builder.getInstance().buildAddress(parser.parseAddress(), monitor);
-    }
-
-    public Address parseAddress(String rawAddressString) throws ParseException {
-        return parseAddress(rawAddressString, DecodeMonitor.STRICT);
-    }
+    Address parseAddress(CharSequence text) throws ParseException;
 
     /**
      * Parse the address list string, such as the value of a From, To, Cc, Bcc,
      * Sender, or Reply-To header.
      *
      * The string MUST be unfolded already.
-     * @param monitor the DecodeMonitor to be used while parsing/decoding
+     * @param text
+     *            string to parse.
      */
-    public AddressList parseAddressList(String rawAddressList, DecodeMonitor monitor)
-            throws ParseException {
-        AddressListParser parser = new AddressListParser(new StringReader(
-                rawAddressList));
-        return Builder.getInstance().buildAddressList(parser.parseAddressList(), monitor);
-    }
-
-    public AddressList parseAddressList(String rawAddressList) throws ParseException {
-        return parseAddressList(rawAddressList, DecodeMonitor.STRICT);
-    }
+    AddressList parseAddressList(CharSequence text) throws ParseException;
 
     /**
      * Parses the specified raw string into a mailbox address.
      *
-     * @param rawMailboxString
+     * @param text
      *            string to parse.
-     * @param monitor the DecodeMonitor to be used while parsing/decoding.
      * @return a <code>Mailbox</code> object for the specified string.
      * @throws ParseException
      *             if the raw string does not represent a single mailbox
      *             address.
      */
-    public Mailbox parseMailbox(String rawMailboxString, DecodeMonitor monitor) throws ParseException
{
-        AddressListParser parser = new AddressListParser(new StringReader(
-                rawMailboxString));
-        return Builder.getInstance().buildMailbox(parser.parseMailbox(), monitor);
-    }
-
-    public Mailbox parseMailbox(String rawMailboxString) throws ParseException {
-        return parseMailbox(rawMailboxString, DecodeMonitor.STRICT);
-    }
+    Mailbox parseMailbox(CharSequence text) throws ParseException;
 
     /**
      * Parses the specified raw string into a group address.
      *
-     * @param rawGroupString
+     * @param text
      *            string to parse.
      * @return a <code>Group</code> object for the specified string.
      * @throws ParseException
      *             if the raw string does not represent a single group address.
      */
-    public Group parseGroup(String rawGroupString, DecodeMonitor monitor) throws ParseException
{
-        Address address = parseAddress(rawGroupString, monitor);
-        if (!(address instanceof Group))
-            throw new ParseException("Not a group address");
-
-        return (Group) address;
-    }
-
-    public Group parseGroup(String rawGroupString) throws ParseException {
-        return parseGroup(rawGroupString, DecodeMonitor.STRICT);
-    }
+    Group parseGroup(CharSequence text) throws ParseException;
 
 }

Copied: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/DefaultAddressParser.java
(from r1635924, james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/AddressBuilder.java)
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/DefaultAddressParser.java?p2=james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/DefaultAddressParser.java&p1=james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/AddressBuilder.java&r1=1635924&r2=1635935&rev=1635935&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/AddressBuilder.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/DefaultAddressParser.java
Sat Nov  1 12:07:00 2014
@@ -19,42 +19,41 @@
 
 package org.apache.james.mime4j.field.address;
 
-import java.io.StringReader;
-
+import org.apache.james.mime4j.Charsets;
 import org.apache.james.mime4j.codec.DecodeMonitor;
 import org.apache.james.mime4j.dom.address.Address;
 import org.apache.james.mime4j.dom.address.AddressList;
 import org.apache.james.mime4j.dom.address.Group;
 import org.apache.james.mime4j.dom.address.Mailbox;
+import org.apache.james.mime4j.io.InputStreams;
 
 /**
  * Default (strict) builder for {@link Address} and its subclasses.
  */
-public class AddressBuilder {
+public class DefaultAddressParser implements AddressParser {
 
-    public static final AddressBuilder DEFAULT = new AddressBuilder();
+    public static final DefaultAddressParser DEFAULT = new DefaultAddressParser();
 
-    protected AddressBuilder() {
+    protected DefaultAddressParser() {
         super();
     }
 
     /**
      * Parses the specified raw string into an address.
      *
-     * @param rawAddressString
+     * @param text
      *            string to parse.
      * @param monitor the DecodeMonitor to be used while parsing/decoding
      * @return an <code>Address</code> object for the specified string.
      * @throws ParseException if the raw string does not represent a single address.
      */
-    public Address parseAddress(String rawAddressString, DecodeMonitor monitor) throws ParseException
{
-        AddressListParser parser = new AddressListParser(new StringReader(
-                rawAddressString));
+    public Address parseAddress(CharSequence text, DecodeMonitor monitor) throws ParseException
{
+        AddressListParser parser = new AddressListParser(InputStreams.create(text, Charsets.UTF_8));
         return Builder.getInstance().buildAddress(parser.parseAddress(), monitor);
     }
 
-    public Address parseAddress(String rawAddressString) throws ParseException {
-        return parseAddress(rawAddressString, DecodeMonitor.STRICT);
+    public Address parseAddress(CharSequence text) throws ParseException {
+        return parseAddress(text, DecodeMonitor.STRICT);
     }
 
     /**
@@ -64,21 +63,20 @@ public class AddressBuilder {
      * The string MUST be unfolded already.
      * @param monitor the DecodeMonitor to be used while parsing/decoding
      */
-    public AddressList parseAddressList(String rawAddressList, DecodeMonitor monitor)
+    public AddressList parseAddressList(CharSequence text, DecodeMonitor monitor)
             throws ParseException {
-        AddressListParser parser = new AddressListParser(new StringReader(
-                rawAddressList));
+        AddressListParser parser = new AddressListParser(InputStreams.create(text, Charsets.UTF_8));
         return Builder.getInstance().buildAddressList(parser.parseAddressList(), monitor);
     }
 
-    public AddressList parseAddressList(String rawAddressList) throws ParseException {
-        return parseAddressList(rawAddressList, DecodeMonitor.STRICT);
+    public AddressList parseAddressList(CharSequence text) throws ParseException {
+        return parseAddressList(text, DecodeMonitor.STRICT);
     }
 
     /**
      * Parses the specified raw string into a mailbox address.
      *
-     * @param rawMailboxString
+     * @param text
      *            string to parse.
      * @param monitor the DecodeMonitor to be used while parsing/decoding.
      * @return a <code>Mailbox</code> object for the specified string.
@@ -86,35 +84,34 @@ public class AddressBuilder {
      *             if the raw string does not represent a single mailbox
      *             address.
      */
-    public Mailbox parseMailbox(String rawMailboxString, DecodeMonitor monitor) throws ParseException
{
-        AddressListParser parser = new AddressListParser(new StringReader(
-                rawMailboxString));
+    public Mailbox parseMailbox(CharSequence text, DecodeMonitor monitor) throws ParseException
{
+        AddressListParser parser = new AddressListParser(InputStreams.create(text, Charsets.UTF_8));
         return Builder.getInstance().buildMailbox(parser.parseMailbox(), monitor);
     }
 
-    public Mailbox parseMailbox(String rawMailboxString) throws ParseException {
-        return parseMailbox(rawMailboxString, DecodeMonitor.STRICT);
+    public Mailbox parseMailbox(CharSequence text) throws ParseException {
+        return parseMailbox(text, DecodeMonitor.STRICT);
     }
 
     /**
      * Parses the specified raw string into a group address.
      *
-     * @param rawGroupString
+     * @param text
      *            string to parse.
      * @return a <code>Group</code> object for the specified string.
      * @throws ParseException
      *             if the raw string does not represent a single group address.
      */
-    public Group parseGroup(String rawGroupString, DecodeMonitor monitor) throws ParseException
{
-        Address address = parseAddress(rawGroupString, monitor);
+    public Group parseGroup(CharSequence text, DecodeMonitor monitor) throws ParseException
{
+        Address address = parseAddress(text, monitor);
         if (!(address instanceof Group))
             throw new ParseException("Not a group address");
 
         return (Group) address;
     }
 
-    public Group parseGroup(String rawGroupString) throws ParseException {
-        return parseGroup(rawGroupString, DecodeMonitor.STRICT);
+    public Group parseGroup(CharSequence text) throws ParseException {
+        return parseGroup(text, DecodeMonitor.STRICT);
     }
 
 }

Propchange: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/DefaultAddressParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/DefaultAddressParser.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/DefaultAddressParser.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/LenientAddressParser.java
(from r1635924, james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/LenientAddressBuilder.java)
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/LenientAddressParser.java?p2=james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/LenientAddressParser.java&p1=james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/LenientAddressBuilder.java&r1=1635924&r2=1635935&rev=1635935&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/LenientAddressBuilder.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/LenientAddressParser.java
Sat Nov  1 12:07:00 2014
@@ -41,7 +41,7 @@ import org.apache.james.mime4j.util.Cont
  * Lenient (tolerant to non-critical format violations) builder for {@link Address}
  * and its subclasses.
  */
-public class LenientAddressBuilder {
+public class LenientAddressParser implements AddressParser {
 
     private static final int AT                = '@';
     private static final int OPENING_BRACKET   = '<';
@@ -56,12 +56,12 @@ public class LenientAddressBuilder {
     private static final BitSet COLON_ONLY             = RawFieldParser.INIT_BITSET(COLON);
     private static final BitSet SEMICOLON_ONLY         = RawFieldParser.INIT_BITSET(SEMICOLON);
 
-    public static final LenientAddressBuilder DEFAULT = new LenientAddressBuilder(DecodeMonitor.SILENT);
+    public static final LenientAddressParser DEFAULT = new LenientAddressParser(DecodeMonitor.SILENT);
 
     private final DecodeMonitor monitor;
     private final RawFieldParser parser;
 
-    protected LenientAddressBuilder(final DecodeMonitor monitor) {
+    protected LenientAddressParser(final DecodeMonitor monitor) {
         super();
         this.monitor = monitor;
         this.parser = new RawFieldParser();
@@ -215,7 +215,7 @@ public class LenientAddressBuilder {
         }
     }
 
-    public Mailbox parseMailbox(final String text) {
+    public Mailbox parseMailbox(final CharSequence text) {
         ByteSequence raw = ContentUtil.encode(text);
         ParserCursor cursor = new ParserCursor(0, text.length());
         return parseMailbox(raw, cursor, null);
@@ -259,7 +259,7 @@ public class LenientAddressBuilder {
         return new Group(name, mboxes);
     }
 
-    public Group parseGroup(final String text) {
+    public Group parseGroup(final CharSequence text) {
         ByteSequence raw = ContentUtil.encode(text);
         ParserCursor cursor = new ParserCursor(0, text.length());
         return parseGroup(raw, cursor);
@@ -302,7 +302,7 @@ public class LenientAddressBuilder {
         }
     }
 
-    public Address parseAddress(final String text) {
+    public Address parseAddress(final CharSequence text) {
         ByteSequence raw = ContentUtil.encode(text);
         ParserCursor cursor = new ParserCursor(0, text.length());
         return parseAddress(raw, cursor, null);
@@ -325,7 +325,7 @@ public class LenientAddressBuilder {
         return new AddressList(addresses, false);
     }
 
-    public AddressList parseAddressList(final String text) {
+    public AddressList parseAddressList(final CharSequence text) {
         ByteSequence raw = ContentUtil.encode(text);
         ParserCursor cursor = new ParserCursor(0, text.length());
         return parseAddressList(raw, cursor);

Propchange: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/LenientAddressParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/LenientAddressParser.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/address/LenientAddressParser.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageBuilder.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageBuilder.java?rev=1635935&r1=1635934&r2=1635935&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageBuilder.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageBuilder.java
Sat Nov  1 12:07:00 2014
@@ -55,7 +55,7 @@ import org.apache.james.mime4j.dom.field
 import org.apache.james.mime4j.field.DefaultFieldParser;
 import org.apache.james.mime4j.field.Fields;
 import org.apache.james.mime4j.field.LenientFieldParser;
-import org.apache.james.mime4j.field.address.AddressBuilder;
+import org.apache.james.mime4j.field.address.DefaultAddressParser;
 import org.apache.james.mime4j.io.InputStreams;
 import org.apache.james.mime4j.parser.MimeStreamParser;
 import org.apache.james.mime4j.stream.BodyDescriptorBuilder;
@@ -777,7 +777,7 @@ public class MessageBuilder extends Abst
         if (mailbox == null) {
             removeFields(fieldName);
         } else {
-            setField(Fields.mailbox(fieldName, AddressBuilder.DEFAULT.parseMailbox(mailbox)));
+            setField(Fields.mailbox(fieldName, DefaultAddressParser.DEFAULT.parseMailbox(mailbox)));
         }
         return this;
     }
@@ -792,7 +792,7 @@ public class MessageBuilder extends Abst
     }
 
     private MessageBuilder setMailboxList(String fieldName, String mailbox) throws ParseException
{
-        return setMailboxList(fieldName, mailbox == null ? null : AddressBuilder.DEFAULT.parseMailbox(mailbox));
+        return setMailboxList(fieldName, mailbox == null ? null : DefaultAddressParser.DEFAULT.parseMailbox(mailbox));
     }
 
     private MessageBuilder setMailboxList(String fieldName, Mailbox... mailboxes) {
@@ -805,7 +805,7 @@ public class MessageBuilder extends Abst
         } else {
             List<Mailbox> list = new ArrayList<Mailbox>();
             for (String mailbox: mailboxes) {
-                list.add(AddressBuilder.DEFAULT.parseMailbox(mailbox));
+                list.add(DefaultAddressParser.DEFAULT.parseMailbox(mailbox));
             }
             return list;
         }
@@ -834,7 +834,7 @@ public class MessageBuilder extends Abst
     }
 
     private MessageBuilder setAddressList(String fieldName, String address) throws ParseException
{
-        return setAddressList(fieldName, address == null ? null : AddressBuilder.DEFAULT.parseMailbox(address));
+        return setAddressList(fieldName, address == null ? null : DefaultAddressParser.DEFAULT.parseMailbox(address));
     }
 
     private MessageBuilder setAddressList(String fieldName, Address... addresses) {
@@ -847,7 +847,7 @@ public class MessageBuilder extends Abst
         } else {
             List<Address> list = new ArrayList<Address>();
             for (String address: addresses) {
-                list.add(AddressBuilder.DEFAULT.parseAddress(address));
+                list.add(DefaultAddressParser.DEFAULT.parseAddress(address));
             }
             return list;
         }

Modified: james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/FieldsTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/FieldsTest.java?rev=1635935&r1=1635934&r2=1635935&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/FieldsTest.java (original)
+++ james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/FieldsTest.java Sat
Nov  1 12:07:00 2014
@@ -35,7 +35,7 @@ import org.apache.james.mime4j.dom.field
 import org.apache.james.mime4j.dom.field.DateTimeField;
 import org.apache.james.mime4j.dom.field.MailboxField;
 import org.apache.james.mime4j.dom.field.MailboxListField;
-import org.apache.james.mime4j.field.address.AddressBuilder;
+import org.apache.james.mime4j.field.address.DefaultAddressParser;
 import org.apache.james.mime4j.stream.Field;
 import org.apache.james.mime4j.util.ByteSequence;
 import org.apache.james.mime4j.util.ContentUtil;
@@ -258,15 +258,15 @@ public class FieldsTest {
 
     @Test
     public void testSender() throws Exception {
-        MailboxField field = Fields.sender(AddressBuilder.DEFAULT
+        MailboxField field = Fields.sender(DefaultAddressParser.DEFAULT
                 .parseMailbox("JD <john.doe@acme.org>"));
         Assert.assertEquals("Sender: JD <john.doe@acme.org>", decode(field));
     }
 
     @Test
     public void testFrom() throws Exception {
-        Mailbox mailbox1 = AddressBuilder.DEFAULT.parseMailbox("JD <john.doe@acme.org>");
-        Mailbox mailbox2 = AddressBuilder.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
+        Mailbox mailbox1 = DefaultAddressParser.DEFAULT.parseMailbox("JD <john.doe@acme.org>");
+        Mailbox mailbox2 = DefaultAddressParser.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
 
         MailboxListField field = Fields.from(mailbox1);
         Assert.assertEquals("From: JD <john.doe@acme.org>", decode(field));
@@ -282,9 +282,9 @@ public class FieldsTest {
 
     @Test
     public void testTo() throws Exception {
-        Mailbox mailbox1 = AddressBuilder.DEFAULT.parseMailbox("JD <john.doe@acme.org>");
-        Mailbox mailbox2 = AddressBuilder.DEFAULT.parseMailbox("jane.doe@example.org");
-        Mailbox mailbox3 = AddressBuilder.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
+        Mailbox mailbox1 = DefaultAddressParser.DEFAULT.parseMailbox("JD <john.doe@acme.org>");
+        Mailbox mailbox2 = DefaultAddressParser.DEFAULT.parseMailbox("jane.doe@example.org");
+        Mailbox mailbox3 = DefaultAddressParser.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
         Group group = new Group("The Does", mailbox1, mailbox2);
 
         AddressListField field = Fields.to(group);
@@ -304,9 +304,9 @@ public class FieldsTest {
 
     @Test
     public void testCc() throws Exception {
-        Mailbox mailbox1 = AddressBuilder.DEFAULT.parseMailbox("JD <john.doe@acme.org>");
-        Mailbox mailbox2 = AddressBuilder.DEFAULT.parseMailbox("jane.doe@example.org");
-        Mailbox mailbox3 = AddressBuilder.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
+        Mailbox mailbox1 = DefaultAddressParser.DEFAULT.parseMailbox("JD <john.doe@acme.org>");
+        Mailbox mailbox2 = DefaultAddressParser.DEFAULT.parseMailbox("jane.doe@example.org");
+        Mailbox mailbox3 = DefaultAddressParser.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
         Group group = new Group("The Does", mailbox1, mailbox2);
 
         AddressListField field = Fields.cc(group);
@@ -326,9 +326,9 @@ public class FieldsTest {
 
     @Test
     public void testBcc() throws Exception {
-        Mailbox mailbox1 = AddressBuilder.DEFAULT.parseMailbox("JD <john.doe@acme.org>");
-        Mailbox mailbox2 = AddressBuilder.DEFAULT.parseMailbox("jane.doe@example.org");
-        Mailbox mailbox3 = AddressBuilder.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
+        Mailbox mailbox1 = DefaultAddressParser.DEFAULT.parseMailbox("JD <john.doe@acme.org>");
+        Mailbox mailbox2 = DefaultAddressParser.DEFAULT.parseMailbox("jane.doe@example.org");
+        Mailbox mailbox3 = DefaultAddressParser.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
         Group group = new Group("The Does", mailbox1, mailbox2);
 
         AddressListField field = Fields.bcc(group);
@@ -348,9 +348,9 @@ public class FieldsTest {
 
     @Test
     public void testReplyTo() throws Exception {
-        Mailbox mailbox1 = AddressBuilder.DEFAULT.parseMailbox("JD <john.doe@acme.org>");
-        Mailbox mailbox2 = AddressBuilder.DEFAULT.parseMailbox("jane.doe@example.org");
-        Mailbox mailbox3 = AddressBuilder.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
+        Mailbox mailbox1 = DefaultAddressParser.DEFAULT.parseMailbox("JD <john.doe@acme.org>");
+        Mailbox mailbox2 = DefaultAddressParser.DEFAULT.parseMailbox("jane.doe@example.org");
+        Mailbox mailbox3 = DefaultAddressParser.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
         Group group = new Group("The Does", mailbox1, mailbox2);
 
         AddressListField field = Fields.replyTo(group);
@@ -370,15 +370,15 @@ public class FieldsTest {
 
     @Test
     public void testMailbox() throws Exception {
-        MailboxField field = Fields.mailbox("Resent-Sender", AddressBuilder.DEFAULT
+        MailboxField field = Fields.mailbox("Resent-Sender", DefaultAddressParser.DEFAULT
                 .parseMailbox("JD <john.doe@acme.org>"));
         Assert.assertEquals("Resent-Sender: JD <john.doe@acme.org>", decode(field));
     }
 
     @Test
     public void testMailboxList() throws Exception {
-        Mailbox mailbox1 = AddressBuilder.DEFAULT.parseMailbox("JD <john.doe@acme.org>");
-        Mailbox mailbox2 = AddressBuilder.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
+        Mailbox mailbox1 = DefaultAddressParser.DEFAULT.parseMailbox("JD <john.doe@acme.org>");
+        Mailbox mailbox2 = DefaultAddressParser.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
 
         MailboxListField field = Fields.mailboxList("Resent-From", Arrays
                 .asList(mailbox1, mailbox2));
@@ -388,9 +388,9 @@ public class FieldsTest {
 
     @Test
     public void testAddressList() throws Exception {
-        Mailbox mailbox1 = AddressBuilder.DEFAULT.parseMailbox("JD <john.doe@acme.org>");
-        Mailbox mailbox2 = AddressBuilder.DEFAULT.parseMailbox("jane.doe@example.org");
-        Mailbox mailbox3 = AddressBuilder.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
+        Mailbox mailbox1 = DefaultAddressParser.DEFAULT.parseMailbox("JD <john.doe@acme.org>");
+        Mailbox mailbox2 = DefaultAddressParser.DEFAULT.parseMailbox("jane.doe@example.org");
+        Mailbox mailbox3 = DefaultAddressParser.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
         Group group = new Group("The Does", mailbox1, mailbox2);
 
         AddressListField field = Fields.addressList("Resent-To", Arrays.asList(

Modified: james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/address/DefaultAddressBuilderTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/address/DefaultAddressBuilderTest.java?rev=1635935&r1=1635934&r2=1635935&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/address/DefaultAddressBuilderTest.java
(original)
+++ james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/address/DefaultAddressBuilderTest.java
Sat Nov  1 12:07:00 2014
@@ -34,11 +34,11 @@ import java.util.List;
 
 public class DefaultAddressBuilderTest {
 
-    private AddressBuilder parser;
+    private DefaultAddressParser parser;
 
     @Before
     public void setUp() throws Exception {
-        parser = AddressBuilder.DEFAULT;
+        parser = DefaultAddressParser.DEFAULT;
     }
 
     @Test

Modified: james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/address/LenientAddressBuilderTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/address/LenientAddressBuilderTest.java?rev=1635935&r1=1635934&r2=1635935&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/address/LenientAddressBuilderTest.java
(original)
+++ james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/address/LenientAddressBuilderTest.java
Sat Nov  1 12:07:00 2014
@@ -37,11 +37,11 @@ import java.util.List;
 
 public class LenientAddressBuilderTest {
 
-    private LenientAddressBuilder parser;
+    private LenientAddressParser parser;
 
     @Before
     public void setUp() throws Exception {
-        parser = LenientAddressBuilder.DEFAULT;
+        parser = LenientAddressParser.DEFAULT;
     }
 
     @Test

Modified: james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/message/MessageBuilderTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/message/MessageBuilderTest.java?rev=1635935&r1=1635934&r2=1635935&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/message/MessageBuilderTest.java
(original)
+++ james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/message/MessageBuilderTest.java
Sat Nov  1 12:07:00 2014
@@ -37,7 +37,7 @@ import org.apache.james.mime4j.dom.field
 import org.apache.james.mime4j.dom.field.FieldName;
 import org.apache.james.mime4j.field.DefaultFieldParser;
 import org.apache.james.mime4j.field.Fields;
-import org.apache.james.mime4j.field.address.AddressBuilder;
+import org.apache.james.mime4j.field.address.DefaultAddressParser;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
@@ -192,8 +192,8 @@ public class MessageBuilderTest {
     public void testSetFrom() throws Exception {
         MessageBuilder builder = MessageBuilder.create();
 
-        Mailbox mailbox1 = AddressBuilder.DEFAULT.parseMailbox("john.doe@example.net");
-        Mailbox mailbox2 = AddressBuilder.DEFAULT.parseMailbox("jane.doe@example.net");
+        Mailbox mailbox1 = DefaultAddressParser.DEFAULT.parseMailbox("john.doe@example.net");
+        Mailbox mailbox2 = DefaultAddressParser.DEFAULT.parseMailbox("jane.doe@example.net");
 
         builder.setFrom(mailbox1);
         Assert.assertEquals("john.doe@example.net", builder.getField("From")
@@ -226,10 +226,10 @@ public class MessageBuilderTest {
     public void testSetTo() throws Exception {
         MessageBuilder builder = MessageBuilder.create();
 
-        Mailbox mailbox1 = AddressBuilder.DEFAULT.parseMailbox("john.doe@example.net");
-        Mailbox mailbox2 = AddressBuilder.DEFAULT.parseMailbox("jane.doe@example.net");
+        Mailbox mailbox1 = DefaultAddressParser.DEFAULT.parseMailbox("john.doe@example.net");
+        Mailbox mailbox2 = DefaultAddressParser.DEFAULT.parseMailbox("jane.doe@example.net");
         Group group = new Group("Does", mailbox1, mailbox2);
-        Mailbox mailbox3 = AddressBuilder.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
+        Mailbox mailbox3 = DefaultAddressParser.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
 
         builder.setTo(group);
         Assert.assertEquals("Does: john.doe@example.net, jane.doe@example.net;",
@@ -264,10 +264,10 @@ public class MessageBuilderTest {
     public void testSetCc() throws Exception {
         MessageBuilder builder = MessageBuilder.create();
 
-        Mailbox mailbox1 = AddressBuilder.DEFAULT.parseMailbox("john.doe@example.net");
-        Mailbox mailbox2 = AddressBuilder.DEFAULT.parseMailbox("jane.doe@example.net");
+        Mailbox mailbox1 = DefaultAddressParser.DEFAULT.parseMailbox("john.doe@example.net");
+        Mailbox mailbox2 = DefaultAddressParser.DEFAULT.parseMailbox("jane.doe@example.net");
         Group group = new Group("Does", mailbox1, mailbox2);
-        Mailbox mailbox3 = AddressBuilder.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
+        Mailbox mailbox3 = DefaultAddressParser.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
 
         builder.setCc(group);
         Assert.assertEquals("Does: john.doe@example.net, jane.doe@example.net;",
@@ -302,10 +302,10 @@ public class MessageBuilderTest {
     public void testSetBcc() throws Exception {
         MessageBuilder builder = MessageBuilder.create();
 
-        Mailbox mailbox1 = AddressBuilder.DEFAULT.parseMailbox("john.doe@example.net");
-        Mailbox mailbox2 = AddressBuilder.DEFAULT.parseMailbox("jane.doe@example.net");
+        Mailbox mailbox1 = DefaultAddressParser.DEFAULT.parseMailbox("john.doe@example.net");
+        Mailbox mailbox2 = DefaultAddressParser.DEFAULT.parseMailbox("jane.doe@example.net");
         Group group = new Group("Does", mailbox1, mailbox2);
-        Mailbox mailbox3 = AddressBuilder.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
+        Mailbox mailbox3 = DefaultAddressParser.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
 
         builder.setBcc(group);
         Assert.assertEquals("Does: john.doe@example.net, jane.doe@example.net;",
@@ -340,10 +340,10 @@ public class MessageBuilderTest {
     public void testSetReplyTo() throws Exception {
         MessageBuilder builder = MessageBuilder.create();
 
-        Mailbox mailbox1 = AddressBuilder.DEFAULT.parseMailbox("john.doe@example.net");
-        Mailbox mailbox2 = AddressBuilder.DEFAULT.parseMailbox("jane.doe@example.net");
+        Mailbox mailbox1 = DefaultAddressParser.DEFAULT.parseMailbox("john.doe@example.net");
+        Mailbox mailbox2 = DefaultAddressParser.DEFAULT.parseMailbox("jane.doe@example.net");
         Group group = new Group("Does", mailbox1, mailbox2);
-        Mailbox mailbox3 = AddressBuilder.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
+        Mailbox mailbox3 = DefaultAddressParser.DEFAULT.parseMailbox("Mary Smith <mary@example.net>");
 
         builder.setReplyTo(group);
         Assert.assertEquals("Does: john.doe@example.net, jane.doe@example.net;",



Mime
View raw message