Skip to content

Commit

Permalink
remove redundant modifiers, use java-style arrays
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
  • Loading branch information
lukasj committed Apr 30, 2023
1 parent 222cc53 commit 695a699
Show file tree
Hide file tree
Showing 29 changed files with 94 additions and 102 deletions.
2 changes: 1 addition & 1 deletion api/src/main/java/jakarta/mail/EncodingAware.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ public interface EncodingAware {
*
* @return the Content-Transfer-Encoding value, or null
*/
public String getEncoding();
String getEncoding();
}
2 changes: 1 addition & 1 deletion api/src/main/java/jakarta/mail/Flags.java
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ public String toString() {
return sb.toString();
}

/*****
/*
public static void main(String argv[]) throws Exception {
// a new flags object
Flags f1 = new Flags();
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/jakarta/mail/MailLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ private String packageOf(Class<?> clazz) {
*/
private StackTraceElement inferCaller() {
// Get the stack trace.
StackTraceElement stack[] = (new Throwable()).getStackTrace();
StackTraceElement[] stack = (new Throwable()).getStackTrace();
// First, search back to a method in the Logger class.
int ix = 0;
while (ix < stack.length) {
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/jakarta/mail/MessageAware.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ public interface MessageAware {
*
* @return the message context
*/
public MessageContext getMessageContext();
MessageContext getMessageContext();
}
4 changes: 2 additions & 2 deletions api/src/main/java/jakarta/mail/MultipartDataSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public interface MultipartDataSource extends DataSource {
*
* @return number of parts
*/
public int getCount();
int getCount();

/**
* Get the specified Part. Parts are numbered starting at 0.
Expand All @@ -53,6 +53,6 @@ public interface MultipartDataSource extends DataSource {
* is out of range.
* @throws MessagingException for other failures
*/
public BodyPart getBodyPart(int index) throws MessagingException;
BodyPart getBodyPart(int index) throws MessagingException;

}
54 changes: 27 additions & 27 deletions api/src/main/java/jakarta/mail/Part.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public interface Part {
* @return size of content in bytes
* @throws MessagingException for failures
*/
public int getSize() throws MessagingException;
int getSize() throws MessagingException;

/**
* Return the number of lines in the content of this part.
Expand All @@ -102,7 +102,7 @@ public interface Part {
* @return number of lines in the content.
* @throws MessagingException for failures
*/
public int getLineCount() throws MessagingException;
int getLineCount() throws MessagingException;

/**
* Returns the Content-Type of the content of this part.
Expand All @@ -114,7 +114,7 @@ public interface Part {
* @throws MessagingException for failures
* @see jakarta.activation.DataHandler
*/
public String getContentType() throws MessagingException;
String getContentType() throws MessagingException;

/**
* Is this Part of the specified MIME type? This method
Expand All @@ -134,23 +134,23 @@ public interface Part {
* @return true if this part is of the specified type
* @throws MessagingException for failures
*/
public boolean isMimeType(String mimeType) throws MessagingException;
boolean isMimeType(String mimeType) throws MessagingException;

/**
* This part should be presented as an attachment.
*
* @see #getDisposition
* @see #setDisposition
*/
public static final String ATTACHMENT = "attachment";
String ATTACHMENT = "attachment";

/**
* This part should be presented inline.
*
* @see #getDisposition
* @see #setDisposition
*/
public static final String INLINE = "inline";
String INLINE = "inline";

/**
* Return the disposition of this part. The disposition
Expand All @@ -169,7 +169,7 @@ public interface Part {
* @see #INLINE
* @see #getFileName
*/
public String getDisposition() throws MessagingException;
String getDisposition() throws MessagingException;

/**
* Set the disposition of this part.
Expand All @@ -184,7 +184,7 @@ public interface Part {
* @see #INLINE
* @see #setFileName
*/
public void setDisposition(String disposition) throws MessagingException;
void setDisposition(String disposition) throws MessagingException;

/**
* Return a description String for this part. This typically
Expand All @@ -194,7 +194,7 @@ public interface Part {
* @return description of this part
* @throws MessagingException for failures
*/
public String getDescription() throws MessagingException;
String getDescription() throws MessagingException;

/**
* Set a description String for this part. This typically
Expand All @@ -207,7 +207,7 @@ public interface Part {
* from a READ_ONLY folder
* @throws MessagingException for other failures
*/
public void setDescription(String description) throws MessagingException;
void setDescription(String description) throws MessagingException;

/**
* Get the filename associated with this part, if possible.
Expand All @@ -218,7 +218,7 @@ public interface Part {
* @return Filename to associate with this part
* @throws MessagingException for failures
*/
public String getFileName() throws MessagingException;
String getFileName() throws MessagingException;

/**
* Set the filename associated with this part, if possible.
Expand All @@ -233,7 +233,7 @@ public interface Part {
* from a READ_ONLY folder
* @throws MessagingException for other failures
*/
public void setFileName(String filename) throws MessagingException;
void setFileName(String filename) throws MessagingException;

/**
* Return an input stream for this part's "content". Any
Expand All @@ -251,7 +251,7 @@ public interface Part {
* @see #getDataHandler
* @see jakarta.activation.DataHandler#getInputStream
*/
public InputStream getInputStream()
InputStream getInputStream()
throws IOException, MessagingException;

/**
Expand All @@ -262,7 +262,7 @@ public InputStream getInputStream()
* @return DataHandler for the content
* @throws MessagingException for failures
*/
public DataHandler getDataHandler() throws MessagingException;
DataHandler getDataHandler() throws MessagingException;

/**
* Return the content as a Java object. The type of the returned
Expand All @@ -282,7 +282,7 @@ public InputStream getInputStream()
* @throws MessagingException for other failures
* @see jakarta.activation.DataHandler#getContent
*/
public Object getContent() throws IOException, MessagingException;
Object getContent() throws IOException, MessagingException;

/**
* This method provides the mechanism to set this part's content.
Expand All @@ -295,7 +295,7 @@ public InputStream getInputStream()
* from a READ_ONLY folder
* @throws MessagingException for other failures
*/
public void setDataHandler(DataHandler dh) throws MessagingException;
void setDataHandler(DataHandler dh) throws MessagingException;

/**
* A convenience method for setting this part's content. The part
Expand All @@ -315,7 +315,7 @@ public InputStream getInputStream()
* from a READ_ONLY folder
* @throws MessagingException for other failures
*/
public void setContent(Object obj, String type)
void setContent(Object obj, String type)
throws MessagingException;

/**
Expand All @@ -330,7 +330,7 @@ public void setContent(Object obj, String type)
* from a READ_ONLY folder
* @throws MessagingException for other failures
*/
public void setText(String text) throws MessagingException;
void setText(String text) throws MessagingException;

/**
* This method sets the given Multipart object as this message's
Expand All @@ -344,7 +344,7 @@ public void setContent(Object obj, String type)
* from a READ_ONLY folder
* @throws MessagingException for other failures
*/
public void setContent(Multipart mp) throws MessagingException;
void setContent(Multipart mp) throws MessagingException;

/**
* Output a bytestream for this Part. This bytestream is
Expand All @@ -364,7 +364,7 @@ public void setContent(Object obj, String type)
* data to be written
* @see jakarta.activation.DataHandler#writeTo
*/
public void writeTo(OutputStream os) throws IOException, MessagingException;
void writeTo(OutputStream os) throws IOException, MessagingException;

/**
* Get all the headers for this header name. Returns <code>null</code>
Expand All @@ -375,7 +375,7 @@ public void setContent(Object obj, String type)
* this name
* @throws MessagingException for failures
*/
public String[] getHeader(String header_name)
String[] getHeader(String header_name)
throws MessagingException;

/**
Expand All @@ -391,7 +391,7 @@ public String[] getHeader(String header_name)
* obtained from a READ_ONLY folder
* @throws MessagingException for other failures
*/
public void setHeader(String header_name, String header_value)
void setHeader(String header_name, String header_value)
throws MessagingException;

/**
Expand All @@ -406,7 +406,7 @@ public void setHeader(String header_name, String header_value)
* obtained from a READ_ONLY folder
* @throws MessagingException for other failures
*/
public void addHeader(String header_name, String header_value)
void addHeader(String header_name, String header_value)
throws MessagingException;

/**
Expand All @@ -420,7 +420,7 @@ public void addHeader(String header_name, String header_value)
* obtained from a READ_ONLY folder
* @throws MessagingException for other failures
*/
public void removeHeader(String header_name)
void removeHeader(String header_name)
throws MessagingException;

/**
Expand All @@ -430,7 +430,7 @@ public void removeHeader(String header_name)
* @return enumeration of Header objects
* @throws MessagingException for failures
*/
public Enumeration<Header> getAllHeaders() throws MessagingException;
Enumeration<Header> getAllHeaders() throws MessagingException;

/**
* Return matching headers from this part as an Enumeration of
Expand All @@ -440,7 +440,7 @@ public void removeHeader(String header_name)
* @return enumeration of Header objects
* @throws MessagingException for failures
*/
public Enumeration<Header> getMatchingHeaders(String[] header_names)
Enumeration<Header> getMatchingHeaders(String[] header_names)
throws MessagingException;

/**
Expand All @@ -451,6 +451,6 @@ public Enumeration<Header> getMatchingHeaders(String[] header_names)
* @return enumeration of Header objects
* @throws MessagingException for failures
*/
public Enumeration<Header> getNonMatchingHeaders(String[] header_names)
Enumeration<Header> getNonMatchingHeaders(String[] header_names)
throws MessagingException;
}
2 changes: 1 addition & 1 deletion api/src/main/java/jakarta/mail/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -1430,5 +1430,5 @@ private <T> Iterator<T> lookupUsingHk2ServiceLoader(String factoryId) {
* code that loads resources from stream.
*/
interface StreamLoader {
public void load(InputStream is) throws IOException;
void load(InputStream is) throws IOException;
}
18 changes: 9 additions & 9 deletions api/src/main/java/jakarta/mail/UIDFolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public interface UIDFolder {
*
* @see FetchProfile
*/
public static class FetchProfileItem extends FetchProfile.Item {
class FetchProfileItem extends FetchProfile.Item {
protected FetchProfileItem(String name) {
super(name);
}
Expand Down Expand Up @@ -96,7 +96,7 @@ protected FetchProfileItem(String name) {
*
* @see #getMessagesByUID
*/
public static final long LASTUID = -1;
long LASTUID = -1;

/**
* The largest value possible for a UID, a 32-bit unsigned integer.
Expand All @@ -113,7 +113,7 @@ protected FetchProfileItem(String name) {
*
* @since JavaMail 1.6
*/
public static final long MAXUID = 0xffffffffL; // max 32-bit unsigned int
long MAXUID = 0xffffffffL; // max 32-bit unsigned int

/**
* Returns the UIDValidity value associated with this folder. <p>
Expand All @@ -125,7 +125,7 @@ protected FetchProfileItem(String name) {
* @return UIDValidity
* @throws MessagingException for failures
*/
public long getUIDValidity() throws MessagingException;
long getUIDValidity() throws MessagingException;

/**
* Get the Message corresponding to the given UID. If no such
Expand All @@ -136,7 +136,7 @@ protected FetchProfileItem(String name) {
* if no message corresponding to this UID is obtained.
* @throws MessagingException for failures
*/
public Message getMessageByUID(long uid) throws MessagingException;
Message getMessageByUID(long uid) throws MessagingException;

/**
* Get the Messages specified by the given range. The special
Expand All @@ -155,7 +155,7 @@ protected FetchProfileItem(String name) {
* @throws MessagingException for failures
* @see #LASTUID
*/
public Message[] getMessagesByUID(long start, long end)
Message[] getMessagesByUID(long start, long end)
throws MessagingException;

/**
Expand All @@ -170,7 +170,7 @@ public Message[] getMessagesByUID(long start, long end)
* @return array of Message objects
* @throws MessagingException for failures
*/
public Message[] getMessagesByUID(long[] uids)
Message[] getMessagesByUID(long[] uids)
throws MessagingException;

/**
Expand All @@ -184,7 +184,7 @@ public Message[] getMessagesByUID(long[] uids)
* is not in this Folder.
* @throws MessagingException for other failures
*/
public long getUID(Message message) throws MessagingException;
long getUID(Message message) throws MessagingException;

/**
* Returns the predicted UID that will be assigned to the
Expand All @@ -202,5 +202,5 @@ public Message[] getMessagesByUID(long[] uids)
* @throws MessagingException for failures
* @since JavaMail 1.6
*/
public long getUIDNext() throws MessagingException;
long getUIDNext() throws MessagingException;
}
2 changes: 1 addition & 1 deletion api/src/main/java/jakarta/mail/URLName.java
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ private static String _encode(String s) {
}


/**
/*
* The class contains a utility method for converting from
* a MIME format called "<code>x-www-form-urlencoded</code>"
* to a <code>String</code>
Expand Down
Loading

0 comments on commit 695a699

Please sign in to comment.