Javadoc: Replace <code></code> HTML tags with Javadoc {@code} notation.
diff --git a/src/main/java/org/apache/commons/mail/DataSourceResolver.java b/src/main/java/org/apache/commons/mail/DataSourceResolver.java
index b2e771c..ebcb85c 100644
--- a/src/main/java/org/apache/commons/mail/DataSourceResolver.java
+++ b/src/main/java/org/apache/commons/mail/DataSourceResolver.java
@@ -20,23 +20,23 @@
import java.io.IOException;
/**
- * Creates a <code>DataSource</code> based on an URL.
+ * Creates a {@code DataSource} based on an URL.
*
* @since 1.3
*/
public interface DataSourceResolver
{
/**
- * Resolves the given resource location to a <code>DataSource</code>.
+ * Resolves the given resource location to a {@code DataSource}.
*
* @param resourceLocation the location of the resource
- * @return the <code>DataSource</code>
+ * @return the {@code DataSource}
* @throws IOException the resource was not found
*/
DataSource resolve(final String resourceLocation) throws IOException;
/**
- * Resolves the given resource location to a <code>DataSource</code>.
+ * Resolves the given resource location to a {@code DataSource}.
*
* @param resourceLocation the location of the resource
* @param isLenient shall we ignore resources not found or complain with an exception?
diff --git a/src/main/java/org/apache/commons/mail/DefaultAuthenticator.java b/src/main/java/org/apache/commons/mail/DefaultAuthenticator.java
index 862d160..9802c1b 100644
--- a/src/main/java/org/apache/commons/mail/DefaultAuthenticator.java
+++ b/src/main/java/org/apache/commons/mail/DefaultAuthenticator.java
@@ -46,7 +46,7 @@
* Gets the authentication object that will be used to login to the mail
* server.
*
- * @return A <code>PasswordAuthentication</code> object containing the
+ * @return A {@code PasswordAuthentication} object containing the
* login information.
* @since 1.0
*/
diff --git a/src/main/java/org/apache/commons/mail/Email.java b/src/main/java/org/apache/commons/mail/Email.java
index 5a31f99..2408fcb 100644
--- a/src/main/java/org/apache/commons/mail/Email.java
+++ b/src/main/java/org/apache/commons/mail/Email.java
@@ -198,7 +198,7 @@
protected Date sentDate;
/**
- * Instance of an <code>Authenticator</code> object that will be used
+ * Instance of an {@code Authenticator} object that will be used
* when authentication is requested from the mail server.
*/
protected Authenticator authenticator;
@@ -236,8 +236,8 @@
/**
* Address to which undeliverable mail should be sent.
* Because this is handled by JavaMail as a String property
- * in the mail session, this property is of type <code>String</code>
- * rather than <code>InternetAddress</code>.
+ * in the mail session, this property is of type {@code String}
+ * rather than {@code InternetAddress}.
*/
protected String bounceAddress;
@@ -341,7 +341,7 @@
* method is not used, no authentication will be performed.
* <p>
* This method will create a new instance of
- * <code>DefaultAuthenticator</code> using the supplied parameters.
+ * {@code DefaultAuthenticator} using the supplied parameters.
*
* @param userName User name for the SMTP server
* @param password password for the SMTP server
@@ -355,13 +355,13 @@
}
/**
- * Sets the <code>Authenticator</code> to be used when authentication
+ * Sets the {@code Authenticator} to be used when authentication
* is requested from the mail server.
* <p>
* This method should be used when your outgoing mail server requires
* authentication. Your mail server must also support RFC2554.
*
- * @param newAuthenticator the <code>Authenticator</code> object.
+ * @param newAuthenticator the {@code Authenticator} object.
* @see Authenticator
* @since 1.0
*/
@@ -849,10 +849,10 @@
/**
* Set a list of "TO" addresses. All elements in the specified
- * <code>Collection</code> are expected to be of type
- * <code>java.mail.internet.InternetAddress</code>.
+ * {@code Collection} are expected to be of type
+ * {@code java.mail.internet.InternetAddress}.
*
- * @param aCollection collection of <code>InternetAddress</code> objects.
+ * @param aCollection collection of {@code InternetAddress} objects.
* @return An Email.
* @throws EmailException Indicates an invalid email address.
* @see javax.mail.internet.InternetAddress
@@ -958,10 +958,10 @@
/**
* Set a list of "CC" addresses. All elements in the specified
- * <code>Collection</code> are expected to be of type
- * <code>java.mail.internet.InternetAddress</code>.
+ * {@code Collection} are expected to be of type
+ * {@code java.mail.internet.InternetAddress}.
*
- * @param aCollection collection of <code>InternetAddress</code> objects.
+ * @param aCollection collection of {@code InternetAddress} objects.
* @return An Email.
* @throws EmailException Indicates an invalid email address.
* @see javax.mail.internet.InternetAddress
@@ -1067,10 +1067,10 @@
/**
* Set a list of "BCC" addresses. All elements in the specified
- * <code>Collection</code> are expected to be of type
- * <code>java.mail.internet.InternetAddress</code>.
+ * {@code Collection} are expected to be of type
+ * {@code java.mail.internet.InternetAddress}.
*
- * @param aCollection collection of <code>InternetAddress</code> objects
+ * @param aCollection collection of {@code InternetAddress} objects
* @return An Email.
* @throws EmailException Indicates an invalid email address
* @see javax.mail.internet.InternetAddress
@@ -1146,10 +1146,10 @@
/**
* Set a list of reply to addresses. All elements in the specified
- * <code>Collection</code> are expected to be of type
- * <code>java.mail.internet.InternetAddress</code>.
+ * {@code Collection} are expected to be of type
+ * {@code java.mail.internet.InternetAddress}.
*
- * @param aCollection collection of <code>InternetAddress</code> objects
+ * @param aCollection collection of {@code InternetAddress} objects
* @return An Email.
* @throws EmailException Indicates an invalid email address
* @see javax.mail.internet.InternetAddress
diff --git a/src/main/java/org/apache/commons/mail/EmailException.java b/src/main/java/org/apache/commons/mail/EmailException.java
index e010b7e..f023e15 100644
--- a/src/main/java/org/apache/commons/mail/EmailException.java
+++ b/src/main/java/org/apache/commons/mail/EmailException.java
@@ -37,7 +37,7 @@
private static final long serialVersionUID = 5550674499282474616L;
/**
- * Constructs a new <code>EmailException</code> with no
+ * Constructs a new {@code EmailException} with no
* detail message.
*/
public EmailException()
@@ -46,7 +46,7 @@
}
/**
- * Constructs a new <code>EmailException</code> with specified
+ * Constructs a new {@code EmailException} with specified
* detail message.
*
* @param msg the error message.
@@ -57,8 +57,8 @@
}
/**
- * Constructs a new <code>EmailException</code> with specified
- * nested <code>Throwable</code> root cause.
+ * Constructs a new {@code EmailException} with specified
+ * nested {@code Throwable} root cause.
*
* @param rootCause the exception or error that caused this exception
* to be thrown.
@@ -69,8 +69,8 @@
}
/**
- * Constructs a new <code>EmailException</code> with specified
- * detail message and nested <code>Throwable</code> root cause.
+ * Constructs a new {@code EmailException} with specified
+ * detail message and nested {@code Throwable} root cause.
*
* @param msg the error message.
* @param rootCause the exception or error that caused this exception
@@ -93,7 +93,7 @@
/**
* Prints the stack trace of this exception to the specified stream.
*
- * @param out the <code>PrintStream</code> to use for output
+ * @param out the {@code PrintStream} to use for output
*/
@Override
public void printStackTrace(final PrintStream out)
@@ -111,7 +111,7 @@
/**
* Prints the stack trace of this exception to the specified writer.
*
- * @param out the <code>PrintWriter</code> to use for output
+ * @param out the {@code PrintWriter} to use for output
*/
@Override
public void printStackTrace(final PrintWriter out)
diff --git a/src/main/java/org/apache/commons/mail/EmailUtils.java b/src/main/java/org/apache/commons/mail/EmailUtils.java
index 3df96d6..d89b408 100644
--- a/src/main/java/org/apache/commons/mail/EmailUtils.java
+++ b/src/main/java/org/apache/commons/mail/EmailUtils.java
@@ -103,7 +103,7 @@
}
/**
- * Constructs a new <code>EmailException</code> with no detail message.
+ * Constructs a new {@code EmailException} with no detail message.
*/
private EmailUtils()
{
@@ -115,7 +115,7 @@
*
* @param str the String to check, may be null
*
- * @return <code>true</code> if the String is empty or null
+ * @return {@code true} if the String is empty or null
*
* @since Commons Lang v2.1, svn 240418
*/
@@ -129,7 +129,7 @@
*
* @param str the String to check, may be null
*
- * @return <code>true</code> if the String is not empty and not null
+ * @return {@code true} if the String is not empty and not null
*
* @since Commons Lang v2.1, svn 240418
*/
@@ -139,13 +139,13 @@
}
/**
- * Validate an argument, throwing <code>IllegalArgumentException</code>
- * if the argument is <code>null</code>.
+ * Validate an argument, throwing {@code IllegalArgumentException}
+ * if the argument is {@code null}.
*
- * @param object the object to check is not <code>null</code>
- * @param message the exception message you would like to see if the object is <code>null</code>
+ * @param object the object to check is not {@code null}
+ * @param message the exception message you would like to see if the object is {@code null}
*
- * @throws IllegalArgumentException if the object is <code>null</code>
+ * @throws IllegalArgumentException if the object is {@code null}
*
* @since Commons Lang v2.1, svn 201930
*/
@@ -179,13 +179,13 @@
* Creates a random string based on a variety of options, using supplied source of randomness.
*
* <p>
- * If start and end are both <code>0</code>, start and end are set to <code>' '</code> and <code>'z'</code>,
- * the ASCII printable characters, will be used, unless letters and numbers are both <code>false</code>,
- * in which case, start and end are set to <code>0</code> and <code>Integer.MAX_VALUE</code>.
+ * If start and end are both {@code 0}, start and end are set to {@code ' '} and {@code 'z'},
+ * the ASCII printable characters, will be used, unless letters and numbers are both {@code false},
+ * in which case, start and end are set to {@code 0} and {@code Integer.MAX_VALUE}.
* </p>
*
* <p>
- * If set is not <code>null</code>, characters between start and end are chosen.
+ * If set is not {@code null}, characters between start and end are chosen.
* </p>
*
* <p>
@@ -199,13 +199,13 @@
* @param end the position in set of chars to end before
* @param letters only allow letters?
* @param numbers only allow numbers?
- * @param chars the set of chars to choose randoms from. If <code>null</code>,
+ * @param chars the set of chars to choose randoms from. If {@code null},
* then it will use the set of all chars.
* @param random a source of randomness.
*
* @return the random string
*
- * @throws IllegalArgumentException if <code>count</code> < 0.
+ * @throws IllegalArgumentException if {@code count} < 0.
*
* @since Commons Lang v2.1, svn 201930
*/
diff --git a/src/main/java/org/apache/commons/mail/HtmlEmail.java b/src/main/java/org/apache/commons/mail/HtmlEmail.java
index 1714aa8..f331633 100644
--- a/src/main/java/org/apache/commons/mail/HtmlEmail.java
+++ b/src/main/java/org/apache/commons/mail/HtmlEmail.java
@@ -46,19 +46,19 @@
* <p>This class also inherits from {@link MultiPartEmail}, so it is easy to
* add attachments to the email.
*
- * <p>To send an email in HTML, one should create a <code>HtmlEmail</code>, then
+ * <p>To send an email in HTML, one should create a {@code HtmlEmail}, then
* use the {@link #setFrom(String)}, {@link #addTo(String)} etc. methods.
* The HTML content can be set with the {@link #setHtmlMsg(String)} method. The
* alternative text content can be set with {@link #setTextMsg(String)}.
*
* <p>Either the text or HTML can be omitted, in which case the "main"
* part of the multipart becomes whichever is supplied rather than a
- * <code>multipart/alternative</code>.
+ * {@code multipart/alternative}.
*
* <h3>Embedding Images and Media</h3>
*
* <p>It is also possible to embed URLs, files, or arbitrary
- * <code>DataSource</code>s directly into the body of the mail:
+ * {@code DataSource}s directly into the body of the mail:
* <pre>
* HtmlEmail he = new HtmlEmail();
* File img = new File("my/image.gif");
@@ -72,12 +72,12 @@
* // code to set the other email fields (not shown)
* </pre>
*
- * <p>Embedded entities are tracked by their name, which for <code>File</code>s is
- * the file name itself and for <code>URL</code>s is the canonical path. It is
+ * <p>Embedded entities are tracked by their name, which for {@code File}s is
+ * the file name itself and for {@code URL}s is the canonical path. It is
* an error to bind the same name to more than one entity, and this class will
- * attempt to validate that for <code>File</code>s and <code>URL</code>s. When
- * embedding a <code>DataSource</code>, the code uses the <code>equals()</code>
- * method defined on the <code>DataSource</code>s to make the determination.
+ * attempt to validate that for {@code File}s and {@code URL}s. When
+ * embedding a {@code DataSource}, the code uses the {@code equals()}
+ * method defined on the {@code DataSource}s to make the determination.
*
* @since 1.0
*/
@@ -164,7 +164,7 @@
* part.
*
* @param msg the message text to use
- * @return this <code>HtmlEmail</code>
+ * @return this {@code HtmlEmail}
* @throws EmailException if msg is null or empty;
* see javax.mail.internet.MimeBodyPart for definitions
* @since 1.0
@@ -195,7 +195,7 @@
}
/**
- * Attempts to parse the specified <code>String</code> as a URL that will
+ * Attempts to parse the specified {@code String} as a URL that will
* then be embedded in the message.
*
* @param urlString String representation of the URL.
@@ -225,21 +225,21 @@
* <p>This method embeds a file located by an URL into
* the mail body. It allows, for instance, to add inline images
* to the email. Inline files may be referenced with a
- * <code>cid:xxxxxx</code> URL, where xxxxxx is the Content-ID
+ * {@code cid:xxxxxx} URL, where xxxxxx is the Content-ID
* returned by the embed function. It is an error to bind the same name
* to more than one URL; if the same URL is embedded multiple times, the
* same Content-ID is guaranteed to be returned.
*
- * <p>While functionally the same as passing <code>URLDataSource</code> to
+ * <p>While functionally the same as passing {@code URLDataSource} to
* {@link #embed(DataSource, String, String)}, this method attempts
* to validate the URL before embedding it in the message and will throw
- * <code>EmailException</code> if the validation fails. In this case, the
- * <code>HtmlEmail</code> object will not be changed.
+ * {@code EmailException} if the validation fails. In this case, the
+ * {@code HtmlEmail} object will not be changed.
*
* <p>
* NOTE: Clients should take care to ensure that different URLs are bound to
* different names. This implementation tries to detect this and throw
- * <code>EmailException</code>. However, it is not guaranteed to catch
+ * {@code EmailException}. However, it is not guaranteed to catch
* all cases, especially when the URL refers to a remote HTTP host that
* may be part of a virtual host cluster.
*
@@ -308,9 +308,9 @@
* Embeds a file in the HTML. This implementation delegates to
* {@link #embed(File, String)}.
*
- * @param file The <code>File</code> object to embed
+ * @param file The {@code File} object to embed
* @return A String with the Content-ID of the file.
- * @throws EmailException when the supplied <code>File</code> cannot be
+ * @throws EmailException when the supplied {@code File} cannot be
* used; also see {@link javax.mail.internet.MimeBodyPart} for definitions
*
* @see #embed(File, String)
@@ -328,21 +328,21 @@
* <p>This method embeds a file located by an URL into
* the mail body. It allows, for instance, to add inline images
* to the email. Inline files may be referenced with a
- * <code>cid:xxxxxx</code> URL, where xxxxxx is the Content-ID
+ * {@code cid:xxxxxx} URL, where xxxxxx is the Content-ID
* returned by the embed function. Files are bound to their names, which is
* the value returned by {@link java.io.File#getName()}. If the same file
* is embedded multiple times, the same CID is guaranteed to be returned.
*
- * <p>While functionally the same as passing <code>FileDataSource</code> to
+ * <p>While functionally the same as passing {@code FileDataSource} to
* {@link #embed(DataSource, String, String)}, this method attempts
* to validate the file before embedding it in the message and will throw
- * <code>EmailException</code> if the validation fails. In this case, the
- * <code>HtmlEmail</code> object will not be changed.
+ * {@code EmailException} if the validation fails. In this case, the
+ * {@code HtmlEmail} object will not be changed.
*
- * @param file The <code>File</code> to embed
- * @param cid the Content-ID to use for the embedded <code>File</code>
+ * @param file The {@code File} to embed
+ * @param cid the Content-ID to use for the embedded {@code File}
* @return A String with the Content-ID of the file.
- * @throws EmailException when the supplied <code>File</code> cannot be used
+ * @throws EmailException when the supplied {@code File} cannot be used
* or if the file has already been embedded;
* also see {@link javax.mail.internet.MimeBodyPart} for definitions
* @since 1.1
@@ -412,13 +412,13 @@
}
/**
- * Embeds the specified <code>DataSource</code> in the HTML using a
+ * Embeds the specified {@code DataSource} in the HTML using a
* randomly generated Content-ID. Returns the generated Content-ID string.
*
- * @param dataSource the <code>DataSource</code> to embed
+ * @param dataSource the {@code DataSource} to embed
* @param name the name that will be set in the file name header field
- * @return the generated Content-ID for this <code>DataSource</code>
- * @throws EmailException if the embedding fails or if <code>name</code> is
+ * @return the generated Content-ID for this {@code DataSource}
+ * @throws EmailException if the embedding fails or if {@code name} is
* null or empty
* @see #embed(DataSource, String, String)
* @since 1.1
@@ -446,14 +446,14 @@
}
/**
- * Embeds the specified <code>DataSource</code> in the HTML using the
+ * Embeds the specified {@code DataSource} in the HTML using the
* specified Content-ID. Returns the specified Content-ID string.
*
- * @param dataSource the <code>DataSource</code> to embed
+ * @param dataSource the {@code DataSource} to embed
* @param name the name that will be set in the file name header field
- * @param cid the Content-ID to use for this <code>DataSource</code>
- * @return the URL encoded Content-ID for this <code>DataSource</code>
- * @throws EmailException if the embedding fails or if <code>name</code> is
+ * @param cid the Content-ID to use for this {@code DataSource}
+ * @return the URL encoded Content-ID for this {@code DataSource}
+ * @throws EmailException if the embedding fails or if {@code name} is
* null or empty
* @since 1.1
*/
@@ -630,17 +630,17 @@
{
/** content id. */
private final String cid;
- /** <code>DataSource</code> for the content. */
+ /** {@code DataSource} for the content. */
private final DataSource dataSource;
- /** the <code>MimeBodyPart</code> that contains the encoded data. */
+ /** the {@code MimeBodyPart} that contains the encoded data. */
private final MimeBodyPart mbp;
/**
* Creates an InlineImage object to represent the
- * specified content ID and <code>MimeBodyPart</code>.
+ * specified content ID and {@code MimeBodyPart}.
* @param cid the generated content ID
- * @param dataSource the <code>DataSource</code> that represents the content
- * @param mbp the <code>MimeBodyPart</code> that contains the encoded
+ * @param dataSource the {@code DataSource} that represents the content
+ * @param mbp the {@code MimeBodyPart} that contains the encoded
* data
*/
public InlineImage(final String cid, final DataSource dataSource, final MimeBodyPart mbp)
@@ -660,8 +660,8 @@
}
/**
- * Returns the <code>DataSource</code> that represents the encoded content.
- * @return the <code>DataSource</code> representing the encoded content
+ * Returns the {@code DataSource} that represents the encoded content.
+ * @return the {@code DataSource} representing the encoded content
*/
public DataSource getDataSource()
{
@@ -669,9 +669,9 @@
}
/**
- * Returns the <code>MimeBodyPart</code> that contains the
+ * Returns the {@code MimeBodyPart} that contains the
* encoded InlineImage data.
- * @return the <code>MimeBodyPart</code> containing the encoded
+ * @return the {@code MimeBodyPart} containing the encoded
* InlineImage data
*/
public MimeBodyPart getMbp()
diff --git a/src/main/java/org/apache/commons/mail/ImageHtmlEmail.java b/src/main/java/org/apache/commons/mail/ImageHtmlEmail.java
index 0b84af7..bb101ad 100644
--- a/src/main/java/org/apache/commons/mail/ImageHtmlEmail.java
+++ b/src/main/java/org/apache/commons/mail/ImageHtmlEmail.java
@@ -36,7 +36,7 @@
* the element and link it in.
* </p>
* <p>
- * The image loading is done by an instance of <code>DataSourceResolver</code>
+ * The image loading is done by an instance of {@code DataSourceResolver}
* which has to be provided by the caller.
* </p>
*
diff --git a/src/main/java/org/apache/commons/mail/resolver/DataSourceClassPathResolver.java b/src/main/java/org/apache/commons/mail/resolver/DataSourceClassPathResolver.java
index 8b6186b..124dde7 100644
--- a/src/main/java/org/apache/commons/mail/resolver/DataSourceClassPathResolver.java
+++ b/src/main/java/org/apache/commons/mail/resolver/DataSourceClassPathResolver.java
@@ -24,7 +24,7 @@
import java.io.InputStream;
/**
- * Creates a <code>DataSource</code> based on an class path.
+ * Creates a {@code DataSource} based on an class path.
*
* @since 1.3
*/
diff --git a/src/main/java/org/apache/commons/mail/resolver/DataSourceFileResolver.java b/src/main/java/org/apache/commons/mail/resolver/DataSourceFileResolver.java
index 49ecf59..0aeafc8 100644
--- a/src/main/java/org/apache/commons/mail/resolver/DataSourceFileResolver.java
+++ b/src/main/java/org/apache/commons/mail/resolver/DataSourceFileResolver.java
@@ -22,7 +22,7 @@
import java.io.IOException;
/**
- * Creates a <code>DataSource</code> based on an URL. The implementation
+ * Creates a {@code DataSource} based on an URL. The implementation
* also resolves file resources.
*
* @since 1.3
diff --git a/src/main/java/org/apache/commons/mail/resolver/DataSourceUrlResolver.java b/src/main/java/org/apache/commons/mail/resolver/DataSourceUrlResolver.java
index 9946db0..842e390 100644
--- a/src/main/java/org/apache/commons/mail/resolver/DataSourceUrlResolver.java
+++ b/src/main/java/org/apache/commons/mail/resolver/DataSourceUrlResolver.java
@@ -23,7 +23,7 @@
import java.net.URL;
/**
- * Creates a <code>DataSource</code> based on an URL.
+ * Creates a {@code DataSource} based on an URL.
*
* @since 1.3
*/
diff --git a/src/test/java/org/apache/commons/mail/AbstractEmailTest.java b/src/test/java/org/apache/commons/mail/AbstractEmailTest.java
index e32f6a3..6cf2ba2 100644
--- a/src/test/java/org/apache/commons/mail/AbstractEmailTest.java
+++ b/src/test/java/org/apache/commons/mail/AbstractEmailTest.java
@@ -394,11 +394,11 @@
}
/**
- * Serializes the {@link MimeMessage} from the <code>WiserMessage</code>
+ * Serializes the {@link MimeMessage} from the {@code WiserMessage}
* passed in. The headers are serialized first followed by the message
* body.
*
- * @param wiserMessage The <code>WiserMessage</code> to serialize.
+ * @param wiserMessage The {@code WiserMessage} to serialize.
* @return The string format of the message.
* @throws MessagingException
* @throws IOException
@@ -509,11 +509,11 @@
/**
* Checks if an email server is running at the address stored in the
- * <code>fakeMailServer</code>.
+ * {@code fakeMailServer}.
*
* @param fakeMailServer
* The server from which the address is picked up.
- * @return <code>true</code> if the server claims to be running
+ * @return {@code true} if the server claims to be running
* @since 1.1
*/
protected boolean isMailServerStopped(final Wiser fakeMailServer) {
diff --git a/src/test/java/org/apache/commons/mail/EmailLiveTest.java b/src/test/java/org/apache/commons/mail/EmailLiveTest.java
index 8b28821..4c75d7d 100644
--- a/src/test/java/org/apache/commons/mail/EmailLiveTest.java
+++ b/src/test/java/org/apache/commons/mail/EmailLiveTest.java
@@ -318,7 +318,7 @@
/**
* Testing if we are able to send a few emails in a batch, i.e.
- * using a single authenticated <code>Transport</code> instance.
+ * using a single authenticated {@code Transport} instance.
* Use a single instance speeds up processing since the
* authorization is only done once.
*