From c04ffa17ced5798468682f2e27314ad7d02188af Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Sat, 3 Nov 2018 11:34:35 +0100 Subject: [PATCH] Added missing @deprecated javadoc tags; fixed style check violations --- .../cache/ehcache/TestEhcacheHttpCacheStorage.java | 2 +- .../OSGI-INF/metatype/metatype.properties | 2 +- .../http/impl/auth/win/WindowsNegotiateScheme.java | 3 +++ .../apache/http/client/protocol/ClientContext.java | 5 ----- .../client/protocol/RequestAuthenticationBase.java | 3 +++ .../impl/client/CloseableHttpResponseProxy.java | 2 +- .../http/impl/client/DefaultRequestDirector.java | 7 +------ .../http/impl/cookie/BestMatchSpecFactory.java | 2 +- .../methods/AbstractExecutionAwareRequest.java | 6 ++++++ .../apache/http/client/utils/URLEncodedUtils.java | 1 + .../http/conn/scheme/SocketFactoryAdaptor.java | 3 +++ .../http/conn/ssl/SSLConnectionSocketFactory.java | 9 +++++++++ .../org/apache/http/impl/auth/NTLMEngineImpl.java | 14 ++++++++++---- .../http/impl/execchain/HttpResponseProxy.java | 2 -- .../http/impl/execchain/RequestEntityProxy.java | 1 - .../http/impl/execchain/ResponseEntityProxy.java | 1 - .../apache/http/conn/ssl/TestHostnameVerifier.java | 2 ++ .../apache/http/impl/auth/TestRFC2617Scheme.java | 1 - .../org/apache/http/entity/mime/version.properties | 2 +- 19 files changed, 43 insertions(+), 25 deletions(-) diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheHttpCacheStorage.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheHttpCacheStorage.java index ee91cecc4..a1366e8a1 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheHttpCacheStorage.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheHttpCacheStorage.java @@ -74,7 +74,7 @@ public class TestEhcacheHttpCacheStorage extends TestCase { impl.putEntry(key, value); verify(mockSerializer).writeTo(same(value), isA(OutputStream.class)); - verify(mockCache).put(e);; + verify(mockCache).put(e); } @Test diff --git a/httpclient-osgi/src/main/resources/OSGI-INF/metatype/metatype.properties b/httpclient-osgi/src/main/resources/OSGI-INF/metatype/metatype.properties index 30e35f260..481761544 100644 --- a/httpclient-osgi/src/main/resources/OSGI-INF/metatype/metatype.properties +++ b/httpclient-osgi/src/main/resources/OSGI-INF/metatype/metatype.properties @@ -14,7 +14,7 @@ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations -# under the License. +# under the License. # proxyconfigurator.name = Apache HTTP Components Proxy Configurator diff --git a/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsNegotiateScheme.java b/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsNegotiateScheme.java index 333458bd5..141df87a7 100644 --- a/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsNegotiateScheme.java +++ b/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsNegotiateScheme.java @@ -305,6 +305,9 @@ public class WindowsNegotiateScheme extends AuthSchemeBase { return !continueNeeded; } + /** + * @deprecated Use {@link #authenticate(Credentials, HttpRequest, HttpContext)} + */ @Override @Deprecated public Header authenticate( diff --git a/httpclient/src/main/java-deprecated/org/apache/http/client/protocol/ClientContext.java b/httpclient/src/main/java-deprecated/org/apache/http/client/protocol/ClientContext.java index 4794f612a..e59334b89 100644 --- a/httpclient/src/main/java-deprecated/org/apache/http/client/protocol/ClientContext.java +++ b/httpclient/src/main/java-deprecated/org/apache/http/client/protocol/ClientContext.java @@ -50,7 +50,6 @@ public interface ClientContext { * Attribute name of a {@link org.apache.http.conn.scheme.Scheme} * object that represents the actual protocol scheme registry. */ - @Deprecated public static final String SCHEME_REGISTRY = "http.scheme-registry"; /** @@ -101,10 +100,6 @@ public interface ClientContext { */ public static final String PROXY_AUTH_STATE = "http.auth.proxy-scope"; - /** - * @deprecated (4.1) do not use - */ - @Deprecated public static final String AUTH_SCHEME_PREF = "http.auth.scheme-pref"; /** diff --git a/httpclient/src/main/java-deprecated/org/apache/http/client/protocol/RequestAuthenticationBase.java b/httpclient/src/main/java-deprecated/org/apache/http/client/protocol/RequestAuthenticationBase.java index bec0069b2..34e923b9c 100644 --- a/httpclient/src/main/java-deprecated/org/apache/http/client/protocol/RequestAuthenticationBase.java +++ b/httpclient/src/main/java-deprecated/org/apache/http/client/protocol/RequestAuthenticationBase.java @@ -43,6 +43,9 @@ import org.apache.http.auth.Credentials; import org.apache.http.protocol.HttpContext; import org.apache.http.util.Asserts; +/** + * @deprecated Do not use. + */ @Deprecated abstract class RequestAuthenticationBase implements HttpRequestInterceptor { diff --git a/httpclient/src/main/java-deprecated/org/apache/http/impl/client/CloseableHttpResponseProxy.java b/httpclient/src/main/java-deprecated/org/apache/http/impl/client/CloseableHttpResponseProxy.java index 649d35927..da67b7e4b 100644 --- a/httpclient/src/main/java-deprecated/org/apache/http/impl/client/CloseableHttpResponseProxy.java +++ b/httpclient/src/main/java-deprecated/org/apache/http/impl/client/CloseableHttpResponseProxy.java @@ -40,7 +40,7 @@ import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.util.EntityUtils; /** - * @since 4.3 + * @deprecated Do not use. */ @Deprecated class CloseableHttpResponseProxy implements InvocationHandler { diff --git a/httpclient/src/main/java-deprecated/org/apache/http/impl/client/DefaultRequestDirector.java b/httpclient/src/main/java-deprecated/org/apache/http/impl/client/DefaultRequestDirector.java index 45cb9988e..25028744d 100644 --- a/httpclient/src/main/java-deprecated/org/apache/http/impl/client/DefaultRequestDirector.java +++ b/httpclient/src/main/java-deprecated/org/apache/http/impl/client/DefaultRequestDirector.java @@ -128,7 +128,7 @@ import org.apache.http.util.EntityUtils; * * @since 4.0 * - * @deprecated (4.3) + * @deprecated Do not use. */ @Deprecated public class DefaultRequestDirector implements RequestDirector { @@ -157,21 +157,18 @@ public class DefaultRequestDirector implements RequestDirector { protected final HttpRequestRetryHandler retryHandler; /** The redirect handler. */ - @Deprecated protected final RedirectHandler redirectHandler; /** The redirect strategy. */ protected final RedirectStrategy redirectStrategy; /** The target authentication handler. */ - @Deprecated protected final AuthenticationHandler targetAuthHandler; /** The target authentication handler. */ protected final AuthenticationStrategy targetAuthStrategy; /** The proxy authentication handler. */ - @Deprecated protected final AuthenticationHandler proxyAuthHandler; /** The proxy authentication handler. */ @@ -200,7 +197,6 @@ public class DefaultRequestDirector implements RequestDirector { private HttpHost virtualHost; - @Deprecated public DefaultRequestDirector( final HttpRequestExecutor requestExec, final ClientConnectionManager conman, @@ -224,7 +220,6 @@ public class DefaultRequestDirector implements RequestDirector { } - @Deprecated public DefaultRequestDirector( final Log log, final HttpRequestExecutor requestExec, diff --git a/httpclient/src/main/java-deprecated/org/apache/http/impl/cookie/BestMatchSpecFactory.java b/httpclient/src/main/java-deprecated/org/apache/http/impl/cookie/BestMatchSpecFactory.java index e87f3d018..cf8564f43 100644 --- a/httpclient/src/main/java-deprecated/org/apache/http/impl/cookie/BestMatchSpecFactory.java +++ b/httpclient/src/main/java-deprecated/org/apache/http/impl/cookie/BestMatchSpecFactory.java @@ -55,7 +55,7 @@ public class BestMatchSpecFactory implements CookieSpecFactory, CookieSpecProvid public BestMatchSpecFactory(final String[] datepatterns, final boolean oneHeader) { super(); - this.cookieSpec = new BestMatchSpec(datepatterns, oneHeader);; + this.cookieSpec = new BestMatchSpec(datepatterns, oneHeader); } public BestMatchSpecFactory() { diff --git a/httpclient/src/main/java/org/apache/http/client/methods/AbstractExecutionAwareRequest.java b/httpclient/src/main/java/org/apache/http/client/methods/AbstractExecutionAwareRequest.java index 9d2facf2e..e433e9a84 100644 --- a/httpclient/src/main/java/org/apache/http/client/methods/AbstractExecutionAwareRequest.java +++ b/httpclient/src/main/java/org/apache/http/client/methods/AbstractExecutionAwareRequest.java @@ -50,6 +50,9 @@ public abstract class AbstractExecutionAwareRequest extends AbstractHttpMessage this.cancellableRef = new AtomicReference(null); } + /** + * @deprecated Use {@link #setCancellable(Cancellable)} + */ @Override @Deprecated public void setConnectionRequest(final ClientConnectionRequest connRequest) { @@ -64,6 +67,9 @@ public abstract class AbstractExecutionAwareRequest extends AbstractHttpMessage }); } + /** + * @deprecated Use {@link #setCancellable(Cancellable)} + */ @Override @Deprecated public void setReleaseTrigger(final ConnectionReleaseTrigger releaseTrigger) { diff --git a/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java b/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java index 0397cc4f2..11b462a6e 100644 --- a/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java +++ b/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java @@ -72,6 +72,7 @@ public class URLEncodedUtils { /** * @deprecated 4.5 Use {@link #parse(URI, Charset)} */ + @Deprecated public static List parse(final URI uri, final String charsetName) { return parse(uri, charsetName != null ? Charset.forName(charsetName) : null); } diff --git a/httpclient/src/main/java/org/apache/http/conn/scheme/SocketFactoryAdaptor.java b/httpclient/src/main/java/org/apache/http/conn/scheme/SocketFactoryAdaptor.java index 65a160b9b..e89516f9d 100644 --- a/httpclient/src/main/java/org/apache/http/conn/scheme/SocketFactoryAdaptor.java +++ b/httpclient/src/main/java/org/apache/http/conn/scheme/SocketFactoryAdaptor.java @@ -37,6 +37,9 @@ import org.apache.http.conn.ConnectTimeoutException; import org.apache.http.params.BasicHttpParams; import org.apache.http.params.HttpParams; +/** + * @deprecated Do not use. + */ @Deprecated class SocketFactoryAdaptor implements SocketFactory { diff --git a/httpclient/src/main/java/org/apache/http/conn/ssl/SSLConnectionSocketFactory.java b/httpclient/src/main/java/org/apache/http/conn/ssl/SSLConnectionSocketFactory.java index 6ec4412f9..a3cc972d0 100644 --- a/httpclient/src/main/java/org/apache/http/conn/ssl/SSLConnectionSocketFactory.java +++ b/httpclient/src/main/java/org/apache/http/conn/ssl/SSLConnectionSocketFactory.java @@ -142,14 +142,23 @@ public class SSLConnectionSocketFactory implements LayeredConnectionSocketFactor public static final String SSL = "SSL"; public static final String SSLV2 = "SSLv2"; + /** + * @deprecated Use {@link AllowAllHostnameVerifier#INSTANCE}. + */ @Deprecated public static final X509HostnameVerifier ALLOW_ALL_HOSTNAME_VERIFIER = AllowAllHostnameVerifier.INSTANCE; + /** + * @deprecated Use {@link BrowserCompatHostnameVerifier#INSTANCE}. + */ @Deprecated public static final X509HostnameVerifier BROWSER_COMPATIBLE_HOSTNAME_VERIFIER = BrowserCompatHostnameVerifier.INSTANCE; + /** + * @deprecated Use {@link StrictHostnameVerifier#INSTANCE}. + */ @Deprecated public static final X509HostnameVerifier STRICT_HOSTNAME_VERIFIER = StrictHostnameVerifier.INSTANCE; diff --git a/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java b/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java index e642615e2..92a0ecc20 100644 --- a/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java +++ b/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java @@ -27,20 +27,20 @@ package org.apache.http.impl.auth; import java.nio.charset.Charset; -import org.apache.http.Consts; import java.security.Key; import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.cert.Certificate; +import java.security.cert.CertificateEncodingException; import java.util.Arrays; import java.util.Locale; import java.util.Random; import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateEncodingException; -import java.security.cert.Certificate; import org.apache.commons.codec.binary.Base64; +import org.apache.http.Consts; /** * Provides an implementation for NTLMv1, NTLMv2, and NTLM2 Session forms of the NTLM @@ -289,6 +289,9 @@ final class NTLMEngineImpl implements NTLMEngine { protected byte[] ntlm2SessionResponseUserSessionKey = null; protected byte[] lanManagerSessionKey = null; + /** + * @deprecated Use {@link CipherGen#CipherGen(Random, long, String, String, String, byte[], String, byte[], byte[], byte[], byte[], byte[])} + */ @Deprecated public CipherGen(final String domain, final String user, final String password, final byte[] challenge, final String target, final byte[] targetInformation, @@ -320,6 +323,9 @@ final class NTLMEngineImpl implements NTLMEngine { this.timestamp = timestamp; } + /** + * @deprecated Use {@link CipherGen#CipherGen(Random, long, String, String, String, byte[], String, byte[], byte[], byte[], byte[], byte[])} + */ @Deprecated public CipherGen(final String domain, final String user, diff --git a/httpclient/src/main/java/org/apache/http/impl/execchain/HttpResponseProxy.java b/httpclient/src/main/java/org/apache/http/impl/execchain/HttpResponseProxy.java index 533eb704f..6c2ff615b 100644 --- a/httpclient/src/main/java/org/apache/http/impl/execchain/HttpResponseProxy.java +++ b/httpclient/src/main/java/org/apache/http/impl/execchain/HttpResponseProxy.java @@ -189,13 +189,11 @@ class HttpResponseProxy implements CloseableHttpResponse { } @Override - @Deprecated public HttpParams getParams() { return original.getParams(); } @Override - @Deprecated public void setParams(final HttpParams params) { original.setParams(params); } diff --git a/httpclient/src/main/java/org/apache/http/impl/execchain/RequestEntityProxy.java b/httpclient/src/main/java/org/apache/http/impl/execchain/RequestEntityProxy.java index e5bba360c..b70d8166e 100644 --- a/httpclient/src/main/java/org/apache/http/impl/execchain/RequestEntityProxy.java +++ b/httpclient/src/main/java/org/apache/http/impl/execchain/RequestEntityProxy.java @@ -127,7 +127,6 @@ class RequestEntityProxy implements HttpEntity { } @Override - @Deprecated public void consumeContent() throws IOException { consumed = true; original.consumeContent(); diff --git a/httpclient/src/main/java/org/apache/http/impl/execchain/ResponseEntityProxy.java b/httpclient/src/main/java/org/apache/http/impl/execchain/ResponseEntityProxy.java index 47c5ac9ed..ad4b877d4 100644 --- a/httpclient/src/main/java/org/apache/http/impl/execchain/ResponseEntityProxy.java +++ b/httpclient/src/main/java/org/apache/http/impl/execchain/ResponseEntityProxy.java @@ -87,7 +87,6 @@ class ResponseEntityProxy extends HttpEntityWrapper implements EofSensorWatcher return new EofSensorInputStream(this.wrappedEntity.getContent(), this); } - @Deprecated @Override public void consumeContent() throws IOException { releaseConnection(); diff --git a/httpclient/src/test/java/org/apache/http/conn/ssl/TestHostnameVerifier.java b/httpclient/src/test/java/org/apache/http/conn/ssl/TestHostnameVerifier.java index d04b7cab3..e291691f2 100644 --- a/httpclient/src/test/java/org/apache/http/conn/ssl/TestHostnameVerifier.java +++ b/httpclient/src/test/java/org/apache/http/conn/ssl/TestHostnameVerifier.java @@ -40,6 +40,8 @@ import org.junit.Test; /** * Unit tests for deprecated {@link X509HostnameVerifier} implementations. + * + * @deprecated Tests deprecated code. */ @Deprecated public class TestHostnameVerifier { diff --git a/httpclient/src/test/java/org/apache/http/impl/auth/TestRFC2617Scheme.java b/httpclient/src/test/java/org/apache/http/impl/auth/TestRFC2617Scheme.java index dc5e8c207..5c3370331 100644 --- a/httpclient/src/test/java/org/apache/http/impl/auth/TestRFC2617Scheme.java +++ b/httpclient/src/test/java/org/apache/http/impl/auth/TestRFC2617Scheme.java @@ -61,7 +61,6 @@ public class TestRFC2617Scheme { } @Override - @Deprecated public Header authenticate( final Credentials credentials, final HttpRequest request) throws AuthenticationException { diff --git a/httpmime/src/main/resources/org/apache/http/entity/mime/version.properties b/httpmime/src/main/resources/org/apache/http/entity/mime/version.properties index 9e330be7e..13e359481 100644 --- a/httpmime/src/main/resources/org/apache/http/entity/mime/version.properties +++ b/httpmime/src/main/resources/org/apache/http/entity/mime/version.properties @@ -14,7 +14,7 @@ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations -# under the License. +# under the License. # info.module = HttpMime info.release = ${pom.version}