Enable lint checks for k9mail-library

This commit is contained in:
Jan Berkel 2015-01-05 23:24:24 +01:00
parent 04b5b4a230
commit c7229e4724
3 changed files with 8 additions and 7 deletions

View File

@ -20,11 +20,12 @@ android {
defaultConfig {
minSdkVersion 15
targetSdkVersion 17
targetSdkVersion 21
}
lintOptions {
abortOnError false
abortOnError true
warningsAsErrors true
lintConfig file("$rootProject.projectDir/config/lint/lint.xml")
}

View File

@ -1,6 +1,7 @@
package com.fsck.k9.mail.store.pop3;
import android.annotation.SuppressLint;
import android.util.Log;
import com.fsck.k9.mail.*;
@ -278,6 +279,7 @@ public class Pop3Store extends RemoteStore {
private InputStream mIn;
private OutputStream mOut;
private Map<String, Pop3Message> mUidToMsgMap = new HashMap<String, Pop3Message>();
@SuppressLint("UseSparseArrays")
private Map<Integer, Pop3Message> mMsgNumToMsgMap = new HashMap<Integer, Pop3Message>();
private Map<String, Integer> mUidToMsgNumMap = new HashMap<String, Integer>();
private String mName;

View File

@ -9,10 +9,8 @@ import com.fsck.k9.mail.ssl.TrustManagerFactory;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
@ -32,7 +30,7 @@ public class WebDavSocketFactory implements LayeredSocketFactory {
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, new TrustManager[] {
TrustManagerFactory.get(host, port)
}, new SecureRandom());
}, null);
mSocketFactory = sslContext.getSocketFactory();
mSchemeSocketFactory = org.apache.http.conn.ssl.SSLSocketFactory.getSocketFactory();
mSchemeSocketFactory.setHostnameVerifier(
@ -41,7 +39,7 @@ public class WebDavSocketFactory implements LayeredSocketFactory {
public Socket connectSocket(Socket sock, String host, int port,
InetAddress localAddress, int localPort, HttpParams params)
throws IOException, UnknownHostException, ConnectTimeoutException {
throws IOException, ConnectTimeoutException {
return mSchemeSocketFactory.connectSocket(sock, host, port, localAddress, localPort, params);
}
@ -57,7 +55,7 @@ public class WebDavSocketFactory implements LayeredSocketFactory {
final String host,
final int port,
final boolean autoClose
) throws IOException, UnknownHostException {
) throws IOException {
SSLSocket sslSocket = (SSLSocket) mSocketFactory.createSocket(
socket,
host,