Replace AndroidX annotations with the ones from JetBrains

This commit is contained in:
Bastian Wilhelm 2022-04-28 14:22:03 +02:00 committed by cketti
parent 27d296f873
commit d71e5b40ac
17 changed files with 22 additions and 36 deletions

View file

@ -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")

View file

@ -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;

View file

@ -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 {

View file

@ -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);

View file

@ -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);

View file

@ -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<Part> knownTextParts,
@NonNull List<Part> attachments) {
@NotNull List<Part> attachments) {
for (Part part : multipart.getBodyParts()) {
Body body = part.getBody();
if (body instanceof Multipart) {

View file

@ -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);

View file

@ -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);

View file

@ -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)) {

View file

@ -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 {

View file

@ -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}"

View file

@ -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;

View file

@ -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;

View file

@ -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}"

View file

@ -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) {

View file

@ -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}"

View file

@ -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}"