diff --git a/mail/common/build.gradle b/mail/common/build.gradle index f445e3e27..5ce857634 100644 --- a/mail/common/build.gradle +++ b/mail/common/build.gradle @@ -10,7 +10,6 @@ dependencies { implementation "org.apache.james:apache-mime4j-dom:${versions.mime4j}" implementation "com.squareup.okio:okio:${versions.okio}" implementation "commons-io:commons-io:${versions.commonsIo}" - implementation "androidx.annotation:annotation:${versions.androidxAnnotation}" implementation "com.jakewharton.timber:timber:${versions.timber}" testImplementation project(":mail:testing") diff --git a/mail/common/src/main/java/com/fsck/k9/mail/Address.java b/mail/common/src/main/java/com/fsck/k9/mail/Address.java index d90aa220a..587ce7a26 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/Address.java +++ b/mail/common/src/main/java/com/fsck/k9/mail/Address.java @@ -1,8 +1,6 @@ package com.fsck.k9.mail; -import androidx.annotation.NonNull; -import androidx.annotation.VisibleForTesting; import java.io.Serializable; import java.util.ArrayList; @@ -15,6 +13,8 @@ import org.apache.james.mime4j.codec.EncoderUtil; import org.apache.james.mime4j.dom.address.Mailbox; import org.apache.james.mime4j.dom.address.MailboxList; import org.apache.james.mime4j.field.address.DefaultAddressParser; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.VisibleForTesting; import timber.log.Timber; import android.text.TextUtils; @@ -29,7 +29,7 @@ public class Address implements Serializable { */ private static final Address[] EMPTY_ADDRESS_ARRAY = new Address[0]; - @NonNull + @NotNull private String mAddress; private String mPersonal; diff --git a/mail/common/src/main/java/com/fsck/k9/mail/BoundaryGenerator.java b/mail/common/src/main/java/com/fsck/k9/mail/BoundaryGenerator.java index 9b2452e61..87c463273 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/BoundaryGenerator.java +++ b/mail/common/src/main/java/com/fsck/k9/mail/BoundaryGenerator.java @@ -3,7 +3,7 @@ package com.fsck.k9.mail; import java.util.Random; -import androidx.annotation.VisibleForTesting; +import org.jetbrains.annotations.VisibleForTesting; public class BoundaryGenerator { diff --git a/mail/common/src/main/java/com/fsck/k9/mail/Message.java b/mail/common/src/main/java/com/fsck/k9/mail/Message.java index c7aa729fd..91e3a8043 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/Message.java +++ b/mail/common/src/main/java/com/fsck/k9/mail/Message.java @@ -8,10 +8,9 @@ import java.util.EnumSet; import java.util.List; import java.util.Set; -import androidx.annotation.NonNull; - import com.fsck.k9.mail.filter.CountingOutputStream; import com.fsck.k9.mail.filter.EOLConvertingOutputStream; +import org.jetbrains.annotations.NotNull; import timber.log.Timber; @@ -98,7 +97,7 @@ public abstract class Message implements Part, Body { @Override public abstract void setHeader(String name, String value); - @NonNull + @NotNull @Override public abstract String[] getHeader(String name); diff --git a/mail/common/src/main/java/com/fsck/k9/mail/Part.java b/mail/common/src/main/java/com/fsck/k9/mail/Part.java index c3fb55e7c..655c3bb5c 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/Part.java +++ b/mail/common/src/main/java/com/fsck/k9/mail/Part.java @@ -4,7 +4,7 @@ package com.fsck.k9.mail; import java.io.IOException; import java.io.OutputStream; -import androidx.annotation.NonNull; +import org.jetbrains.annotations.NotNull; public interface Part { @@ -27,7 +27,7 @@ public interface Part { /** * Returns an array of headers of the given name. The array may be empty. */ - @NonNull + @NotNull String[] getHeader(String name); boolean isMimeType(String mimeType); diff --git a/mail/common/src/main/java/com/fsck/k9/mail/internet/MessageExtractor.java b/mail/common/src/main/java/com/fsck/k9/mail/internet/MessageExtractor.java index c54f469be..c66d73c2c 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/internet/MessageExtractor.java +++ b/mail/common/src/main/java/com/fsck/k9/mail/internet/MessageExtractor.java @@ -10,9 +10,6 @@ import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; - import com.fsck.k9.mail.Body; import com.fsck.k9.mail.BodyPart; import com.fsck.k9.mail.Message; @@ -20,6 +17,8 @@ import com.fsck.k9.mail.MessagingException; import com.fsck.k9.mail.Multipart; import com.fsck.k9.mail.Part; import org.apache.commons.io.input.BoundedInputStream; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import timber.log.Timber; import static com.fsck.k9.mail.internet.CharsetSupport.fixupCharset; @@ -407,7 +406,7 @@ public class MessageExtractor { * A list that will receive the parts that are considered attachments. */ private static void findAttachments(Multipart multipart, Set knownTextParts, - @NonNull List attachments) { + @NotNull List attachments) { for (Part part : multipart.getBodyParts()) { Body body = part.getBody(); if (body instanceof Multipart) { diff --git a/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeBodyPart.java b/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeBodyPart.java index 1c86dec2d..591f8230d 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeBodyPart.java +++ b/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeBodyPart.java @@ -12,8 +12,6 @@ import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; -import androidx.annotation.NonNull; - import org.jetbrains.annotations.NotNull; import static com.fsck.k9.mail.internet.MimeUtility.isSameMimeType; @@ -86,7 +84,7 @@ public class MimeBodyPart extends BodyPart { mHeader.setHeader(name, value); } - @NonNull + @NotNull @Override public String[] getHeader(String name) { return mHeader.getHeader(name); diff --git a/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeMessage.java b/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeMessage.java index 81d823694..6ec9b65db 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeMessage.java +++ b/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeMessage.java @@ -15,8 +15,6 @@ import java.util.List; import java.util.Locale; import java.util.TimeZone; -import androidx.annotation.NonNull; - import com.fsck.k9.mail.Address; import com.fsck.k9.mail.Body; import com.fsck.k9.mail.BodyFactory; @@ -38,6 +36,7 @@ import org.apache.james.mime4j.parser.MimeStreamParser; import org.apache.james.mime4j.stream.BodyDescriptor; import org.apache.james.mime4j.stream.Field; import org.apache.james.mime4j.stream.MimeConfig; +import org.jetbrains.annotations.NotNull; import timber.log.Timber; @@ -434,7 +433,7 @@ public class MimeMessage extends Message { mHeader.setHeader(name, value); } - @NonNull + @NotNull @Override public String[] getHeader(String name) { return mHeader.getHeader(name); diff --git a/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeUtility.java b/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeUtility.java index c9b61ccd1..1991c33a5 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeUtility.java +++ b/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeUtility.java @@ -9,9 +9,6 @@ import java.util.Locale; import java.util.Map; import java.util.regex.Pattern; -import androidx.annotation.NonNull; -import androidx.annotation.VisibleForTesting; - import com.fsck.k9.mail.Body; import com.fsck.k9.mail.BodyPart; import com.fsck.k9.mail.Message; @@ -21,6 +18,8 @@ import com.fsck.k9.mail.Part; import org.apache.james.mime4j.codec.Base64InputStream; import org.apache.james.mime4j.codec.QuotedPrintableInputStream; import org.apache.james.mime4j.util.MimeUtil; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.VisibleForTesting; import timber.log.Timber; @@ -1069,7 +1068,7 @@ public class MimeUtility { return DEFAULT_ATTACHMENT_MIME_TYPE; } - public static String getExtensionByMimeType(@NonNull String mimeType) { + public static String getExtensionByMimeType(@NotNull String mimeType) { String lowerCaseMimeType = mimeType.toLowerCase(Locale.US); for (String[] contentTypeMapEntry : MIME_TYPE_BY_EXTENSION_MAP) { if (contentTypeMapEntry[1].equals(lowerCaseMimeType)) { diff --git a/mail/common/src/main/java/com/fsck/k9/mail/internet/TextBody.java b/mail/common/src/main/java/com/fsck/k9/mail/internet/TextBody.java index 414be33d2..6a5902a11 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/internet/TextBody.java +++ b/mail/common/src/main/java/com/fsck/k9/mail/internet/TextBody.java @@ -7,8 +7,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import androidx.annotation.Nullable; - import com.fsck.k9.mail.Body; import com.fsck.k9.mail.MessagingException; import com.fsck.k9.mail.filter.CountingOutputStream; @@ -17,6 +15,7 @@ import com.fsck.k9.mail.filter.SignSafeOutputStream; import org.apache.james.mime4j.Charsets; import org.apache.james.mime4j.codec.QuotedPrintableOutputStream; import org.apache.james.mime4j.util.MimeUtil; +import org.jetbrains.annotations.Nullable; public class TextBody implements Body, SizeAware { diff --git a/mail/protocols/imap/build.gradle b/mail/protocols/imap/build.gradle index 54e9e80df..494445041 100644 --- a/mail/protocols/imap/build.gradle +++ b/mail/protocols/imap/build.gradle @@ -12,7 +12,6 @@ dependencies { implementation "com.beetstra.jutf7:jutf7:1.0.0" implementation "commons-io:commons-io:${versions.commonsIo}" implementation "com.jakewharton.timber:timber:${versions.timber}" - implementation "androidx.annotation:annotation:${versions.androidxAnnotation}" testImplementation project(":mail:testing") testImplementation "org.robolectric:robolectric:${versions.robolectric}" diff --git a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ListResponse.java b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ListResponse.java index 4ae0d9dea..57e38f73e 100644 --- a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ListResponse.java +++ b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ListResponse.java @@ -5,7 +5,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import androidx.annotation.Nullable; +import org.jetbrains.annotations.Nullable; import static com.fsck.k9.mail.store.imap.ImapResponseParser.equalsIgnoreCase; diff --git a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/RealImapStore.java b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/RealImapStore.java index 3011442f7..1f89e0ce9 100644 --- a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/RealImapStore.java +++ b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/RealImapStore.java @@ -13,8 +13,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import androidx.annotation.Nullable; - import com.fsck.k9.mail.AuthType; import com.fsck.k9.mail.ConnectionSecurity; import com.fsck.k9.mail.Flag; @@ -24,6 +22,7 @@ import com.fsck.k9.mail.ServerSettings; import com.fsck.k9.mail.oauth.OAuth2TokenProvider; import com.fsck.k9.mail.ssl.TrustedSocketFactory; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import timber.log.Timber; diff --git a/mail/protocols/pop3/build.gradle b/mail/protocols/pop3/build.gradle index f7afb0a6a..a99cfe4f0 100644 --- a/mail/protocols/pop3/build.gradle +++ b/mail/protocols/pop3/build.gradle @@ -8,7 +8,6 @@ dependencies { api project(":mail:common") implementation "com.jakewharton.timber:timber:${versions.timber}" - implementation "androidx.annotation:annotation:${versions.androidxAnnotation}" testImplementation project(":mail:testing") testImplementation "org.robolectric:robolectric:${versions.robolectric}" diff --git a/mail/protocols/pop3/src/main/java/com/fsck/k9/mail/store/pop3/Pop3Store.java b/mail/protocols/pop3/src/main/java/com/fsck/k9/mail/store/pop3/Pop3Store.java index cba76ff04..4542caaed 100644 --- a/mail/protocols/pop3/src/main/java/com/fsck/k9/mail/store/pop3/Pop3Store.java +++ b/mail/protocols/pop3/src/main/java/com/fsck/k9/mail/store/pop3/Pop3Store.java @@ -4,13 +4,12 @@ package com.fsck.k9.mail.store.pop3; import java.util.HashMap; import java.util.Map; -import androidx.annotation.NonNull; - import com.fsck.k9.mail.AuthType; import com.fsck.k9.mail.ConnectionSecurity; import com.fsck.k9.mail.MessagingException; import com.fsck.k9.mail.ServerSettings; import com.fsck.k9.mail.ssl.TrustedSocketFactory; +import org.jetbrains.annotations.NotNull; public class Pop3Store { @@ -36,7 +35,7 @@ public class Pop3Store { authType = serverSettings.authenticationType; } - @NonNull + @NotNull public Pop3Folder getFolder(String name) { Pop3Folder folder = mFolders.get(name); if (folder == null) { diff --git a/mail/protocols/smtp/build.gradle b/mail/protocols/smtp/build.gradle index 478cd591b..8ec2ecb1d 100644 --- a/mail/protocols/smtp/build.gradle +++ b/mail/protocols/smtp/build.gradle @@ -11,7 +11,6 @@ dependencies { implementation "commons-io:commons-io:${versions.commonsIo}" implementation "com.squareup.okio:okio:${versions.okio}" implementation "com.jakewharton.timber:timber:${versions.timber}" - implementation "androidx.annotation:annotation:${versions.androidxAnnotation}" testImplementation project(":mail:testing") testImplementation "org.robolectric:robolectric:${versions.robolectric}" diff --git a/mail/protocols/webdav/build.gradle b/mail/protocols/webdav/build.gradle index 59634c5a6..a14c8083c 100644 --- a/mail/protocols/webdav/build.gradle +++ b/mail/protocols/webdav/build.gradle @@ -9,7 +9,6 @@ dependencies { implementation "commons-io:commons-io:${versions.commonsIo}" implementation "com.jakewharton.timber:timber:${versions.timber}" - implementation "androidx.annotation:annotation:${versions.androidxAnnotation}" testImplementation project(":mail:testing") testImplementation "org.robolectric:robolectric:${versions.robolectric}"