From 47f900a03f60e049d39a5a3e349a7ef0dccb225b Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Sun, 23 Jun 2013 14:07:22 +0000 Subject: [PATCH] Fixed maven checkstyle config; fixed format violations git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1495818 13f79535-47bb-0310-9956-ffa450edef68 --- .../client/protocol/RequestAuthenticationBase.java | 2 -- .../apache/http/conn/ssl/PrivateKeyDetails.java | 2 -- .../apache/http/conn/ssl/PrivateKeyStrategy.java | 3 --- .../apache/http/conn/ssl/SSLContextBuilder.java | 4 ++-- .../conn/LoggingManagedHttpClientConnection.java | 8 -------- .../http/entity/mime/HttpRFC6532Multipart.java | 2 +- .../http/entity/mime/HttpStrictMultipart.java | 2 +- .../java/org/apache/http/entity/mime/MIME.java | 2 +- .../apache/http/entity/mime/MultipartEntity.java | 2 +- pom.xml | 14 ++++++++++++++ 10 files changed, 20 insertions(+), 21 deletions(-) diff --git a/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthenticationBase.java b/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthenticationBase.java index 62466b749..0a90fbac8 100644 --- a/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthenticationBase.java +++ b/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthenticationBase.java @@ -27,13 +27,11 @@ package org.apache.http.client.protocol; -import java.io.IOException; import java.util.Queue; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.http.Header; -import org.apache.http.HttpException; import org.apache.http.HttpRequest; import org.apache.http.HttpRequestInterceptor; import org.apache.http.auth.AuthOption; diff --git a/httpclient/src/main/java/org/apache/http/conn/ssl/PrivateKeyDetails.java b/httpclient/src/main/java/org/apache/http/conn/ssl/PrivateKeyDetails.java index ad48d4384..1abb449fe 100644 --- a/httpclient/src/main/java/org/apache/http/conn/ssl/PrivateKeyDetails.java +++ b/httpclient/src/main/java/org/apache/http/conn/ssl/PrivateKeyDetails.java @@ -28,10 +28,8 @@ package org.apache.http.conn.ssl; import org.apache.http.util.Args; -import java.net.Socket; import java.security.cert.X509Certificate; import java.util.Arrays; -import java.util.Map; /** * Private key details. diff --git a/httpclient/src/main/java/org/apache/http/conn/ssl/PrivateKeyStrategy.java b/httpclient/src/main/java/org/apache/http/conn/ssl/PrivateKeyStrategy.java index 8d99ce0c8..4238e287c 100644 --- a/httpclient/src/main/java/org/apache/http/conn/ssl/PrivateKeyStrategy.java +++ b/httpclient/src/main/java/org/apache/http/conn/ssl/PrivateKeyStrategy.java @@ -27,10 +27,7 @@ package org.apache.http.conn.ssl; import java.net.Socket; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; import java.util.Map; -import java.util.Set; /** * A strategy allowing for a choice of an alias during SSL authentication. diff --git a/httpclient/src/main/java/org/apache/http/conn/ssl/SSLContextBuilder.java b/httpclient/src/main/java/org/apache/http/conn/ssl/SSLContextBuilder.java index 77865ea32..31d2eb7ea 100644 --- a/httpclient/src/main/java/org/apache/http/conn/ssl/SSLContextBuilder.java +++ b/httpclient/src/main/java/org/apache/http/conn/ssl/SSLContextBuilder.java @@ -217,7 +217,7 @@ public class SSLContextBuilder { final String[] keyTypes, final Principal[] issuers, final Socket socket) { final Map validAliases = new HashMap(); for (String keyType: keyTypes) { - String[] aliases = this.keyManager.getClientAliases(keyType, issuers); + final String[] aliases = this.keyManager.getClientAliases(keyType, issuers); if (aliases != null) { for (String alias: aliases) { validAliases.put(alias, @@ -236,7 +236,7 @@ public class SSLContextBuilder { public String chooseServerAlias( final String keyType, final Principal[] issuers, final Socket socket) { final Map validAliases = new HashMap(); - String[] aliases = this.keyManager.getServerAliases(keyType, issuers); + final String[] aliases = this.keyManager.getServerAliases(keyType, issuers); if (aliases != null) { for (String alias: aliases) { validAliases.put(alias, diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/LoggingManagedHttpClientConnection.java b/httpclient/src/main/java/org/apache/http/impl/conn/LoggingManagedHttpClientConnection.java index 50099984d..f36424cc3 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/LoggingManagedHttpClientConnection.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/LoggingManagedHttpClientConnection.java @@ -32,24 +32,16 @@ import org.apache.http.Header; import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; import org.apache.http.config.MessageConstraints; -import org.apache.http.conn.ManagedHttpClientConnection; import org.apache.http.entity.ContentLengthStrategy; -import org.apache.http.impl.DefaultBHttpClientConnection; import org.apache.http.io.HttpMessageParserFactory; import org.apache.http.io.HttpMessageWriterFactory; -import org.apache.http.protocol.HttpContext; -import javax.net.ssl.SSLSession; -import javax.net.ssl.SSLSocket; import java.io.IOException; import java.io.InputStream; -import java.io.InterruptedIOException; import java.io.OutputStream; import java.net.Socket; import java.nio.charset.CharsetDecoder; import java.nio.charset.CharsetEncoder; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; class LoggingManagedHttpClientConnection extends DefaultManagedHttpClientConnection { diff --git a/httpmime/src/main/java/org/apache/http/entity/mime/HttpRFC6532Multipart.java b/httpmime/src/main/java/org/apache/http/entity/mime/HttpRFC6532Multipart.java index aa1f0dd46..a49915160 100644 --- a/httpmime/src/main/java/org/apache/http/entity/mime/HttpRFC6532Multipart.java +++ b/httpmime/src/main/java/org/apache/http/entity/mime/HttpRFC6532Multipart.java @@ -68,5 +68,5 @@ class HttpRFC6532Multipart extends AbstractMultipartForm { writeField(field, MIME.UTF8_CHARSET, out); } } - + } diff --git a/httpmime/src/main/java/org/apache/http/entity/mime/HttpStrictMultipart.java b/httpmime/src/main/java/org/apache/http/entity/mime/HttpStrictMultipart.java index 558e268af..4e56592d4 100644 --- a/httpmime/src/main/java/org/apache/http/entity/mime/HttpStrictMultipart.java +++ b/httpmime/src/main/java/org/apache/http/entity/mime/HttpStrictMultipart.java @@ -68,5 +68,5 @@ class HttpStrictMultipart extends AbstractMultipartForm { writeField(field, out); } } - + } diff --git a/httpmime/src/main/java/org/apache/http/entity/mime/MIME.java b/httpmime/src/main/java/org/apache/http/entity/mime/MIME.java index b0107f625..945bd1536 100644 --- a/httpmime/src/main/java/org/apache/http/entity/mime/MIME.java +++ b/httpmime/src/main/java/org/apache/http/entity/mime/MIME.java @@ -46,7 +46,7 @@ public final class MIME { /** The default character set to be used, i.e. "US-ASCII" */ public static final Charset DEFAULT_CHARSET = Consts.ASCII; - + /** UTF-8 is used for RFC6532 */ public static final Charset UTF8_CHARSET = Consts.UTF_8; diff --git a/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java b/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java index 07674c410..0a09ee78f 100644 --- a/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java +++ b/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java @@ -74,7 +74,7 @@ public class MultipartEntity implements HttpEntity { .setBoundary(boundary); this.entity = null; } - + /** * Creates an instance using the specified {@link HttpMultipartMode} mode. * Boundary and charset are set to {@code null}. diff --git a/pom.xml b/pom.xml index 37faa02b3..1fe3b59fd 100644 --- a/pom.xml +++ b/pom.xml @@ -388,6 +388,20 @@ true false ${basedir}/src/main + + + checkstyle + + + + validate-test + validate + + hc-stylecheck/default.xml + hc-stylecheck/asl2.header + true + true + false ${basedir}/src/test