From ac5e71b6aae096607c5a6357a8f70fde3b4107d8 Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Wed, 27 Jan 2016 09:04:42 +0000 Subject: [PATCH] Add final modifier to local variables. git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/branches/4.5.x@1726971 13f79535-47bb-0310-9956-ffa450edef68 --- .../http/impl/auth/win/WindowsNegotiateScheme.java | 4 ++-- .../org/apache/http/impl/client/WinHttpClients.java | 2 +- .../http/impl/client/CloseableHttpResponseProxy.java | 8 ++++---- .../apache/http/client/methods/RequestBuilder.java | 2 +- .../java/org/apache/http/client/utils/URIUtils.java | 4 ++-- .../apache/http/client/utils/URLEncodedUtils.java | 2 +- .../org/apache/http/conn/ssl/AbstractVerifier.java | 4 ++-- .../http/conn/ssl/DefaultHostnameVerifier.java | 6 +++--- .../http/conn/ssl/SSLConnectionSocketFactory.java | 4 ++-- .../apache/http/conn/util/PublicSuffixMatcher.java | 10 +++++----- .../http/conn/util/PublicSuffixMatcherLoader.java | 2 +- .../org/apache/http/impl/auth/GGSSchemeBase.java | 2 +- .../org/apache/http/impl/client/BasicAuthCache.java | 6 +++--- .../apache/http/impl/client/HttpClientBuilder.java | 2 +- .../http/impl/client/IdleConnectionEvictor.java | 2 +- .../apache/http/impl/conn/LoggingInputStream.java | 12 ++++++------ .../apache/http/impl/conn/LoggingOutputStream.java | 10 +++++----- .../apache/http/impl/cookie/AbstractCookieSpec.java | 2 +- .../apache/http/impl/cookie/LaxExpiresHandler.java | 2 +- .../apache/http/impl/cookie/RFC6265CookieSpec.java | 4 ++-- .../http/impl/execchain/ResponseEntityProxy.java | 12 ++++++------ .../java/org/apache/http/client/entity/TestGZip.java | 2 +- .../http/conn/ssl/TestDefaultHostnameVerifier.java | 8 ++++---- .../apache/http/entity/mime/FormBodyPartBuilder.java | 2 +- 24 files changed, 57 insertions(+), 57 deletions(-) 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 29a6b42ca..3b0223f22 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 @@ -188,7 +188,7 @@ public class WindowsNegotiateScheme extends AuthSchemeBase { final String targetName = getServicePrincipalName(context); response = getToken(null, null, targetName); - } catch (RuntimeException ex) { + } catch (final RuntimeException ex) { failAuthCleanup(); if (ex instanceof Win32Exception) { throw new AuthenticationException("Authentication Failed", ex); @@ -206,7 +206,7 @@ public class WindowsNegotiateScheme extends AuthSchemeBase { Sspi.SECBUFFER_TOKEN, continueTokenBytes); final String targetName = getServicePrincipalName(context); response = getToken(this.sspiContext, continueTokenBuffer, targetName); - } catch (RuntimeException ex) { + } catch (final RuntimeException ex) { failAuthCleanup(); if (ex instanceof Win32Exception) { throw new AuthenticationException("Authentication Failed", ex); diff --git a/httpclient-win/src/main/java/org/apache/http/impl/client/WinHttpClients.java b/httpclient-win/src/main/java/org/apache/http/impl/client/WinHttpClients.java index 8b81fc512..396f20afb 100644 --- a/httpclient-win/src/main/java/org/apache/http/impl/client/WinHttpClients.java +++ b/httpclient-win/src/main/java/org/apache/http/impl/client/WinHttpClients.java @@ -59,7 +59,7 @@ public class WinHttpClients { if (os != null && os.contains("windows")) { try { return Sspi.MAX_TOKEN_SIZE > 0; - } catch (Exception ignore) { // Likely ClassNotFound + } catch (final Exception ignore) { // Likely ClassNotFound return false; } } 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 bd41fc62f..aa3fcec7a 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 @@ -53,7 +53,7 @@ class CloseableHttpResponseProxy implements InvocationHandler { try { CONSTRUCTOR = Proxy.getProxyClass(CloseableHttpResponseProxy.class.getClassLoader(), new Class[] { CloseableHttpResponse.class }).getConstructor(new Class[] { InvocationHandler.class }); - } catch (NoSuchMethodException ex) { + } catch (final NoSuchMethodException ex) { throw new IllegalStateException(ex); } } @@ -94,11 +94,11 @@ class CloseableHttpResponseProxy implements InvocationHandler { public static CloseableHttpResponse newProxy(final HttpResponse original) { try { return (CloseableHttpResponse) CONSTRUCTOR.newInstance(new CloseableHttpResponseProxy(original)); - } catch (InstantiationException ex) { + } catch (final InstantiationException ex) { throw new IllegalStateException(ex); - } catch (InvocationTargetException ex) { + } catch (final InvocationTargetException ex) { throw new IllegalStateException(ex); - } catch (IllegalAccessException ex) { + } catch (final IllegalAccessException ex) { throw new IllegalStateException(ex); } } diff --git a/httpclient/src/main/java/org/apache/http/client/methods/RequestBuilder.java b/httpclient/src/main/java/org/apache/http/client/methods/RequestBuilder.java index 9c00b5da6..f6cd6816b 100644 --- a/httpclient/src/main/java/org/apache/http/client/methods/RequestBuilder.java +++ b/httpclient/src/main/java/org/apache/http/client/methods/RequestBuilder.java @@ -284,7 +284,7 @@ public class RequestBuilder { if (!formParams.isEmpty()) { parameters = formParams; } - } catch (IOException ignore) { + } catch (final IOException ignore) { } } else { entity = originalEntity; diff --git a/httpclient/src/main/java/org/apache/http/client/utils/URIUtils.java b/httpclient/src/main/java/org/apache/http/client/utils/URIUtils.java index aecee1ada..72c299ef9 100644 --- a/httpclient/src/main/java/org/apache/http/client/utils/URIUtils.java +++ b/httpclient/src/main/java/org/apache/http/client/utils/URIUtils.java @@ -270,7 +270,7 @@ public class URIUtils { } try { return normalizeSyntax(resolved); - } catch (URISyntaxException ex) { + } catch (final URISyntaxException ex) { throw new IllegalArgumentException(ex); } } @@ -381,7 +381,7 @@ public class URIUtils { if (!TextUtils.isBlank(host)) { try { target = new HttpHost(host, port, scheme); - } catch (IllegalArgumentException ignore) { + } catch (final IllegalArgumentException ignore) { } } } 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 958a98a76..de18e6d58 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 @@ -279,7 +279,7 @@ public class URLEncodedUtils { Args.notNull(buf, "Char array buffer"); final TokenParser tokenParser = TokenParser.INSTANCE; final BitSet delimSet = new BitSet(); - for (char separator: separators) { + for (final char separator: separators) { delimSet.set(separator); } final ParserCursor cursor = new ParserCursor(0, buf.length()); diff --git a/httpclient/src/main/java/org/apache/http/conn/ssl/AbstractVerifier.java b/httpclient/src/main/java/org/apache/http/conn/ssl/AbstractVerifier.java index e9e9e5799..5950dff01 100644 --- a/httpclient/src/main/java/org/apache/http/conn/ssl/AbstractVerifier.java +++ b/httpclient/src/main/java/org/apache/http/conn/ssl/AbstractVerifier.java @@ -155,7 +155,7 @@ public abstract class AbstractVerifier implements X509HostnameVerifier { DefaultHostnameVerifier.normaliseAddress(host.toLowerCase(Locale.ROOT)) : host; if (subjectAltList != null) { - for (String subjectAlt: subjectAltList) { + for (final String subjectAlt: subjectAltList) { final String normalizedAltSubject = InetAddressUtils.isIPv6Address(subjectAlt) ? DefaultHostnameVerifier.normaliseAddress(subjectAlt) : subjectAlt; if (matchIdentity(normalizedHost, normalizedAltSubject, strictWithSubDomains)) { @@ -223,7 +223,7 @@ public abstract class AbstractVerifier implements X509HostnameVerifier { try { final String cn = DefaultHostnameVerifier.extractCN(subjectPrincipal); return cn != null ? new String[] { cn } : null; - } catch (SSLException ex) { + } catch (final SSLException ex) { return null; } } diff --git a/httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java b/httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java index 8b9d52659..853979199 100644 --- a/httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java +++ b/httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java @@ -262,13 +262,13 @@ public final class DefaultHostnameVerifier implements HostnameVerifier { if (value != null) { return value.toString(); } - } catch (NoSuchElementException ignore) { - } catch (NamingException ignore) { + } catch (final NoSuchElementException ignore) { + } catch (final NamingException ignore) { } } } return null; - } catch (InvalidNameException e) { + } catch (final InvalidNameException e) { throw new SSLException(subjectPrincipal + " is not a valid X500 distinguished name"); } } 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 15923e7ab..df8689b42 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 @@ -371,7 +371,7 @@ public class SSLConnectionSocketFactory implements LayeredConnectionSocketFactor // If supported protocols are not explicitly set, remove all SSL protocol versions final String[] allProtocols = sslsock.getEnabledProtocols(); final List enabledProtocols = new ArrayList(allProtocols.length); - for (String protocol: allProtocols) { + for (final String protocol: allProtocols) { if (!protocol.startsWith("SSL")) { enabledProtocols.add(protocol); } @@ -454,7 +454,7 @@ public class SSLConnectionSocketFactory implements LayeredConnectionSocketFactor } this.log.debug(" issuer alternative names: " + altNames); } - } catch (Exception ignore) { + } catch (final Exception ignore) { } } diff --git a/httpclient/src/main/java/org/apache/http/conn/util/PublicSuffixMatcher.java b/httpclient/src/main/java/org/apache/http/conn/util/PublicSuffixMatcher.java index 30c666fbb..2ec340f61 100644 --- a/httpclient/src/main/java/org/apache/http/conn/util/PublicSuffixMatcher.java +++ b/httpclient/src/main/java/org/apache/http/conn/util/PublicSuffixMatcher.java @@ -64,12 +64,12 @@ public final class PublicSuffixMatcher { Args.notNull(domainType, "Domain type"); Args.notNull(rules, "Domain suffix rules"); this.rules = new ConcurrentHashMap(rules.size()); - for (String rule: rules) { + for (final String rule: rules) { this.rules.put(rule, domainType); } this.exceptions = new ConcurrentHashMap(); if (exceptions != null) { - for (String exception: exceptions) { + for (final String exception: exceptions) { this.exceptions.put(exception, domainType); } } @@ -82,15 +82,15 @@ public final class PublicSuffixMatcher { Args.notNull(lists, "Domain suffix lists"); this.rules = new ConcurrentHashMap(); this.exceptions = new ConcurrentHashMap(); - for (PublicSuffixList list: lists) { + for (final PublicSuffixList list: lists) { final DomainType domainType = list.getType(); final List rules = list.getRules(); - for (String rule: rules) { + for (final String rule: rules) { this.rules.put(rule, domainType); } final List exceptions = list.getExceptions(); if (exceptions != null) { - for (String exception: exceptions) { + for (final String exception: exceptions) { this.exceptions.put(exception, domainType); } } diff --git a/httpclient/src/main/java/org/apache/http/conn/util/PublicSuffixMatcherLoader.java b/httpclient/src/main/java/org/apache/http/conn/util/PublicSuffixMatcherLoader.java index 3c75f9d3c..5a25b4610 100644 --- a/httpclient/src/main/java/org/apache/http/conn/util/PublicSuffixMatcherLoader.java +++ b/httpclient/src/main/java/org/apache/http/conn/util/PublicSuffixMatcherLoader.java @@ -86,7 +86,7 @@ public final class PublicSuffixMatcherLoader { if (url != null) { try { DEFAULT_INSTANCE = load(url); - } catch (IOException ex) { + } catch (final IOException ex) { // Should never happen final Log log = LogFactory.getLog(PublicSuffixMatcherLoader.class); if (log.isWarnEnabled()) { diff --git a/httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java b/httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java index 502be3cb0..ffb22b023 100644 --- a/httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java +++ b/httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java @@ -205,7 +205,7 @@ public abstract class GGSSchemeBase extends AuthSchemeBase { //final DnsResolver dnsResolver = SystemDefaultDnsResolver.INSTANCE; //hostname = dnsResolver.resolveCanonicalHostname(host.getHostName()); hostname = resolveCanonicalHostname(hostname); - } catch (UnknownHostException ignore){ + } catch (final UnknownHostException ignore){ } } if (this.stripPort) { // || host.getPort()==80 || host.getPort()==443) { diff --git a/httpclient/src/main/java/org/apache/http/impl/client/BasicAuthCache.java b/httpclient/src/main/java/org/apache/http/impl/client/BasicAuthCache.java index bd4898c5e..97dabb3d7 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/BasicAuthCache.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/BasicAuthCache.java @@ -107,7 +107,7 @@ public class BasicAuthCache implements AuthCache { out.writeObject(authScheme); out.close(); this.map.put(getKey(host), buf.toByteArray()); - } catch (IOException ex) { + } catch (final IOException ex) { if (log.isWarnEnabled()) { log.warn("Unexpected I/O error while serializing auth scheme", ex); } @@ -130,12 +130,12 @@ public class BasicAuthCache implements AuthCache { final AuthScheme authScheme = (AuthScheme) in.readObject(); in.close(); return authScheme; - } catch (IOException ex) { + } catch (final IOException ex) { if (log.isWarnEnabled()) { log.warn("Unexpected I/O error while de-serializing auth scheme", ex); } return null; - } catch (ClassNotFoundException ex) { + } catch (final ClassNotFoundException ex) { if (log.isWarnEnabled()) { log.warn("Unexpected error while de-serializing auth scheme", ex); } diff --git a/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java b/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java index 943848cb6..5dd61624e 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java @@ -1102,7 +1102,7 @@ public class HttpClientBuilder { if (!contentCompressionDisabled) { if (contentDecoderMap != null) { final RegistryBuilder b2 = RegistryBuilder.create(); - for (Map.Entry entry: contentDecoderMap.entrySet()) { + for (final Map.Entry entry: contentDecoderMap.entrySet()) { b2.register(entry.getKey(), entry.getValue()); } b.add(new ResponseContentEncoding(b2.build())); diff --git a/httpclient/src/main/java/org/apache/http/impl/client/IdleConnectionEvictor.java b/httpclient/src/main/java/org/apache/http/impl/client/IdleConnectionEvictor.java index 6bd8c8084..b95b5083b 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/IdleConnectionEvictor.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/IdleConnectionEvictor.java @@ -69,7 +69,7 @@ public final class IdleConnectionEvictor { connectionManager.closeIdleConnections(maxIdleTimeMs, TimeUnit.MILLISECONDS); } } - } catch (Exception ex) { + } catch (final Exception ex) { exception = ex; } diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/LoggingInputStream.java b/httpclient/src/main/java/org/apache/http/impl/conn/LoggingInputStream.java index d42a18329..c47e7c085 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/LoggingInputStream.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/LoggingInputStream.java @@ -59,7 +59,7 @@ class LoggingInputStream extends InputStream { wire.input(b); } return b; - } catch (IOException ex) { + } catch (final IOException ex) { wire.input("[read] I/O error: " + ex.getMessage()); throw ex; } @@ -75,7 +75,7 @@ class LoggingInputStream extends InputStream { wire.input(b, 0, bytesRead); } return bytesRead; - } catch (IOException ex) { + } catch (final IOException ex) { wire.input("[read] I/O error: " + ex.getMessage()); throw ex; } @@ -91,7 +91,7 @@ class LoggingInputStream extends InputStream { wire.input(b, off, bytesRead); } return bytesRead; - } catch (IOException ex) { + } catch (final IOException ex) { wire.input("[read] I/O error: " + ex.getMessage()); throw ex; } @@ -101,7 +101,7 @@ class LoggingInputStream extends InputStream { public long skip(final long n) throws IOException { try { return super.skip(n); - } catch (IOException ex) { + } catch (final IOException ex) { wire.input("[skip] I/O error: " + ex.getMessage()); throw ex; } @@ -111,7 +111,7 @@ class LoggingInputStream extends InputStream { public int available() throws IOException { try { return in.available(); - } catch (IOException ex) { + } catch (final IOException ex) { wire.input("[available] I/O error : " + ex.getMessage()); throw ex; } @@ -136,7 +136,7 @@ class LoggingInputStream extends InputStream { public void close() throws IOException { try { in.close(); - } catch (IOException ex) { + } catch (final IOException ex) { wire.input("[close] I/O error: " + ex.getMessage()); throw ex; } diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/LoggingOutputStream.java b/httpclient/src/main/java/org/apache/http/impl/conn/LoggingOutputStream.java index c70cb1700..b292453f4 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/LoggingOutputStream.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/LoggingOutputStream.java @@ -53,7 +53,7 @@ class LoggingOutputStream extends OutputStream { public void write(final int b) throws IOException { try { wire.output(b); - } catch (IOException ex) { + } catch (final IOException ex) { wire.output("[write] I/O error: " + ex.getMessage()); throw ex; } @@ -64,7 +64,7 @@ class LoggingOutputStream extends OutputStream { try { wire.output(b); out.write(b); - } catch (IOException ex) { + } catch (final IOException ex) { wire.output("[write] I/O error: " + ex.getMessage()); throw ex; } @@ -75,7 +75,7 @@ class LoggingOutputStream extends OutputStream { try { wire.output(b, off, len); out.write(b, off, len); - } catch (IOException ex) { + } catch (final IOException ex) { wire.output("[write] I/O error: " + ex.getMessage()); throw ex; } @@ -85,7 +85,7 @@ class LoggingOutputStream extends OutputStream { public void flush() throws IOException { try { out.flush(); - } catch (IOException ex) { + } catch (final IOException ex) { wire.output("[flush] I/O error: " + ex.getMessage()); throw ex; } @@ -95,7 +95,7 @@ class LoggingOutputStream extends OutputStream { public void close() throws IOException { try { out.close(); - } catch (IOException ex) { + } catch (final IOException ex) { wire.output("[close] I/O error: " + ex.getMessage()); throw ex; } diff --git a/httpclient/src/main/java/org/apache/http/impl/cookie/AbstractCookieSpec.java b/httpclient/src/main/java/org/apache/http/impl/cookie/AbstractCookieSpec.java index 054ee90d1..1c6914a6e 100644 --- a/httpclient/src/main/java/org/apache/http/impl/cookie/AbstractCookieSpec.java +++ b/httpclient/src/main/java/org/apache/http/impl/cookie/AbstractCookieSpec.java @@ -78,7 +78,7 @@ public abstract class AbstractCookieSpec implements CookieSpec { protected AbstractCookieSpec(final CommonCookieAttributeHandler... handlers) { super(); this.attribHandlerMap = new ConcurrentHashMap(handlers.length); - for (CommonCookieAttributeHandler handler: handlers) { + for (final CommonCookieAttributeHandler handler: handlers) { this.attribHandlerMap.put(handler.getAttributeName(), handler); } } diff --git a/httpclient/src/main/java/org/apache/http/impl/cookie/LaxExpiresHandler.java b/httpclient/src/main/java/org/apache/http/impl/cookie/LaxExpiresHandler.java index de00b6bfd..82e891c98 100644 --- a/httpclient/src/main/java/org/apache/http/impl/cookie/LaxExpiresHandler.java +++ b/httpclient/src/main/java/org/apache/http/impl/cookie/LaxExpiresHandler.java @@ -153,7 +153,7 @@ public class LaxExpiresHandler extends AbstractCookieAttributeHandler implements } } } - } catch (NumberFormatException ignore) { + } catch (final NumberFormatException ignore) { throw new MalformedCookieException("Invalid 'expires' attribute: " + value); } if (!foundTime || !foundDayOfMonth || !foundMonth || !foundYear) { diff --git a/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpec.java b/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpec.java index c9f9b99d3..22d7d1dbd 100644 --- a/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpec.java +++ b/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpec.java @@ -84,7 +84,7 @@ public class RFC6265CookieSpec implements CookieSpec { super(); this.attribHandlers = handlers.clone(); this.attribHandlerMap = new ConcurrentHashMap(handlers.length); - for (CommonCookieAttributeHandler handler: handlers) { + for (final CommonCookieAttributeHandler handler: handlers) { this.attribHandlerMap.put(handler.getAttributeName().toLowerCase(Locale.ROOT), handler); } this.tokenParser = TokenParser.INSTANCE; @@ -172,7 +172,7 @@ public class RFC6265CookieSpec implements CookieSpec { attribMap.remove(ClientCookie.EXPIRES_ATTR); } - for (Map.Entry entry: attribMap.entrySet()) { + for (final Map.Entry entry: attribMap.entrySet()) { final String paramName = entry.getKey(); final String paramValue = entry.getValue(); final CookieAttributeHandler handler = this.attribHandlerMap.get(paramName); 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 7f2c42d35..5955cbede 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 @@ -100,10 +100,10 @@ class ResponseEntityProxy extends HttpEntityWrapper implements EofSensorWatcher try { this.wrappedEntity.writeTo(outstream); releaseConnection(); - } catch (IOException ex) { + } catch (final IOException ex) { abortConnection(); throw ex; - } catch (RuntimeException ex) { + } catch (final RuntimeException ex) { abortConnection(); throw ex; } finally { @@ -118,10 +118,10 @@ class ResponseEntityProxy extends HttpEntityWrapper implements EofSensorWatcher // reading trailers after the response body: wrapped.close(); releaseConnection(); - } catch (IOException ex) { + } catch (final IOException ex) { abortConnection(); throw ex; - } catch (RuntimeException ex) { + } catch (final RuntimeException ex) { abortConnection(); throw ex; } finally { @@ -144,10 +144,10 @@ class ResponseEntityProxy extends HttpEntityWrapper implements EofSensorWatcher throw ex; } } - } catch (IOException ex) { + } catch (final IOException ex) { abortConnection(); throw ex; - } catch (RuntimeException ex) { + } catch (final RuntimeException ex) { abortConnection(); throw ex; } finally { diff --git a/httpclient/src/test/java/org/apache/http/client/entity/TestGZip.java b/httpclient/src/test/java/org/apache/http/client/entity/TestGZip.java index adc53403f..f7008b88d 100644 --- a/httpclient/src/test/java/org/apache/http/client/entity/TestGZip.java +++ b/httpclient/src/test/java/org/apache/http/client/entity/TestGZip.java @@ -74,7 +74,7 @@ public class TestGZip { final OutputStream out = Mockito.mock(OutputStream.class); try { gzipe.writeTo(out); - } catch (IOException ex) { + } catch (final IOException ex) { Mockito.verify(out, Mockito.never()).close(); } } diff --git a/httpclient/src/test/java/org/apache/http/conn/ssl/TestDefaultHostnameVerifier.java b/httpclient/src/test/java/org/apache/http/conn/ssl/TestDefaultHostnameVerifier.java index 2d94e7ab6..79fc981a6 100644 --- a/httpclient/src/test/java/org/apache/http/conn/ssl/TestDefaultHostnameVerifier.java +++ b/httpclient/src/test/java/org/apache/http/conn/ssl/TestDefaultHostnameVerifier.java @@ -264,7 +264,7 @@ public class TestDefaultHostnameVerifier { try { DefaultHostnameVerifier.matchIPv6Address(host1, Arrays.asList("2001:0db8:aaaa:bbbb:cccc::10")); Assert.fail("SSLException expected"); - } catch (SSLException expected) { + } catch (final SSLException expected) { } final String host2 = "2001:0db8:aaaa:bbbb:cccc::1"; DefaultHostnameVerifier.matchIPv6Address(host2, Arrays.asList("2001:0db8:aaaa:bbbb:cccc:0:0:0001")); @@ -272,7 +272,7 @@ public class TestDefaultHostnameVerifier { try { DefaultHostnameVerifier.matchIPv6Address(host2, Arrays.asList("2001:0db8:aaaa:bbbb:cccc::10")); Assert.fail("SSLException expected"); - } catch (SSLException expected) { + } catch (final SSLException expected) { } } @@ -289,12 +289,12 @@ public class TestDefaultHostnameVerifier { try { DefaultHostnameVerifier.extractCN("blah,blah"); Assert.fail("SSLException expected"); - } catch (SSLException expected) { + } catch (final SSLException expected) { } try { DefaultHostnameVerifier.extractCN("cn,o=blah"); Assert.fail("SSLException expected"); - } catch (SSLException expected) { + } catch (final SSLException expected) { } } diff --git a/httpmime/src/main/java/org/apache/http/entity/mime/FormBodyPartBuilder.java b/httpmime/src/main/java/org/apache/http/entity/mime/FormBodyPartBuilder.java index 3fd282ad6..a04d9d6bc 100644 --- a/httpmime/src/main/java/org/apache/http/entity/mime/FormBodyPartBuilder.java +++ b/httpmime/src/main/java/org/apache/http/entity/mime/FormBodyPartBuilder.java @@ -97,7 +97,7 @@ public class FormBodyPartBuilder { Asserts.notNull(this.body, "Content body"); final Header headerCopy = new Header(); final List fields = this.header.getFields(); - for (MinimalField field: fields) { + for (final MinimalField field: fields) { headerCopy.addField(field); } if (headerCopy.getField(MIME.CONTENT_DISPOSITION) == null) {