diff --git a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/KeyHashingScheme.java b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/KeyHashingScheme.java
index 12d34cbb4..5373b4fdf 100644
--- a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/KeyHashingScheme.java
+++ b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/KeyHashingScheme.java
@@ -68,5 +68,5 @@ public interface KeyHashingScheme {
* as its key for looking up cache entries
* @return a cache key suitable for use with memcached
*/
- public String hash(String storageKey);
+ String hash(String storageKey);
}
diff --git a/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/OSGiHttpRoutePlanner.java b/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/OSGiHttpRoutePlanner.java
index 21e491710..415084fe5 100644
--- a/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/OSGiHttpRoutePlanner.java
+++ b/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/OSGiHttpRoutePlanner.java
@@ -95,7 +95,7 @@ final class OSGiHttpRoutePlanner extends DefaultRoutePlanner {
return new HostNameMatcher(name);
}
- private static interface HostMatcher {
+ private interface HostMatcher {
boolean matches(String host);
diff --git a/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/PropertiesUtils.java b/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/PropertiesUtils.java
index f0ad493ea..09fbc1a7e 100644
--- a/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/PropertiesUtils.java
+++ b/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/PropertiesUtils.java
@@ -111,7 +111,7 @@ final class PropertiesUtils {
// do nothing
}
- private static interface PropertyConverter
* This parameter expects a value of type {@link String}.
*/
- public static final String CREDENTIAL_CHARSET = "http.auth.credential-charset";
+ String CREDENTIAL_CHARSET = "http.auth.credential-charset";
/**
* Defines the order of preference for supported
@@ -57,7 +57,7 @@ public interface AuthPNames {
* a name of an authentication scheme as returned by
* {@link org.apache.http.auth.AuthScheme#getSchemeName()}.
*/
- public static final String TARGET_AUTH_PREF = "http.auth.target-scheme-pref";
+ String TARGET_AUTH_PREF = "http.auth.target-scheme-pref";
/**
* Defines the order of preference for supported
@@ -69,6 +69,6 @@ public interface AuthPNames {
* a name of an authentication scheme as returned by
* {@link org.apache.http.auth.AuthScheme#getSchemeName()}.
*/
- public static final String PROXY_AUTH_PREF = "http.auth.proxy-scheme-pref";
+ String PROXY_AUTH_PREF = "http.auth.proxy-scheme-pref";
}
diff --git a/httpclient/src/main/java/org/apache/http/client/BackoffManager.java b/httpclient/src/main/java/org/apache/http/client/BackoffManager.java
index d79b9fb52..98aecbc5a 100644
--- a/httpclient/src/main/java/org/apache/http/client/BackoffManager.java
+++ b/httpclient/src/main/java/org/apache/http/client/BackoffManager.java
@@ -43,12 +43,12 @@ public interface BackoffManager {
* using a connection should be interpreted as a
* backoff signal.
*/
- public void backOff(HttpRoute route);
+ void backOff(HttpRoute route);
/**
* Called when we have determined that the result of
* using a connection has succeeded and that we may
* probe for more connections.
*/
- public void probe(HttpRoute route);
+ void probe(HttpRoute route);
}
diff --git a/httpclient/src/main/java/org/apache/http/client/params/ClientPNames.java b/httpclient/src/main/java/org/apache/http/client/params/ClientPNames.java
index 1d8b037b8..cc8ecd57f 100644
--- a/httpclient/src/main/java/org/apache/http/client/params/ClientPNames.java
+++ b/httpclient/src/main/java/org/apache/http/client/params/ClientPNames.java
@@ -36,7 +36,7 @@ package org.apache.http.client.params;
@Deprecated
public interface ClientPNames {
- public static final String CONNECTION_MANAGER_FACTORY_CLASS_NAME = "http.connection-manager.factory-class-name";
+ String CONNECTION_MANAGER_FACTORY_CLASS_NAME = "http.connection-manager.factory-class-name";
/**
* Defines whether redirects should be handled automatically
@@ -44,7 +44,7 @@ public interface ClientPNames {
* This parameter expects a value of type {@link Boolean}.
*
* @since 4.2 */ - public static final String CONN_MANAGER_TIMEOUT = "http.conn-manager.timeout"; + String CONN_MANAGER_TIMEOUT = "http.conn-manager.timeout"; } diff --git a/httpclient/src/main/java/org/apache/http/conn/params/ConnConnectionPNames.java b/httpclient/src/main/java/org/apache/http/conn/params/ConnConnectionPNames.java index e80a907fc..a7665de3d 100644 --- a/httpclient/src/main/java/org/apache/http/conn/params/ConnConnectionPNames.java +++ b/httpclient/src/main/java/org/apache/http/conn/params/ConnConnectionPNames.java @@ -57,8 +57,7 @@ public interface ConnConnectionPNames { * @deprecated (4.1) Use custom {@link * org.apache.http.impl.conn.DefaultHttpResponseParser} implementation */ - @Deprecated - public static final String MAX_STATUS_LINE_GARBAGE = "http.connection.max-status-line-garbage"; + @Deprecated String MAX_STATUS_LINE_GARBAGE = "http.connection.max-status-line-garbage"; } diff --git a/httpclient/src/main/java/org/apache/http/conn/params/ConnManagerPNames.java b/httpclient/src/main/java/org/apache/http/conn/params/ConnManagerPNames.java index 0113ab692..1c6ac26ad 100644 --- a/httpclient/src/main/java/org/apache/http/conn/params/ConnManagerPNames.java +++ b/httpclient/src/main/java/org/apache/http/conn/params/ConnManagerPNames.java @@ -43,7 +43,7 @@ public interface ConnManagerPNames { *
* This parameter expects a value of type {@link Long}. */ - public static final String TIMEOUT = "http.conn-manager.timeout"; + String TIMEOUT = "http.conn-manager.timeout"; /** * Defines the maximum number of connections per route. @@ -53,7 +53,7 @@ public interface ConnManagerPNames { * This parameter expects a value of type {@link ConnPerRoute}. *
*/ - public static final String MAX_CONNECTIONS_PER_ROUTE = "http.conn-manager.max-per-route"; + String MAX_CONNECTIONS_PER_ROUTE = "http.conn-manager.max-per-route"; /** * Defines the maximum number of connections in total. @@ -62,6 +62,6 @@ public interface ConnManagerPNames { *
* This parameter expects a value of type {@link Integer}. */ - public static final String MAX_TOTAL_CONNECTIONS = "http.conn-manager.max-total"; + String MAX_TOTAL_CONNECTIONS = "http.conn-manager.max-total"; } diff --git a/httpclient/src/main/java/org/apache/http/conn/params/ConnRoutePNames.java b/httpclient/src/main/java/org/apache/http/conn/params/ConnRoutePNames.java index cde8fbd97..d06479418 100644 --- a/httpclient/src/main/java/org/apache/http/conn/params/ConnRoutePNames.java +++ b/httpclient/src/main/java/org/apache/http/conn/params/ConnRoutePNames.java @@ -45,7 +45,7 @@ public interface ConnRoutePNames { * This parameter expects a value of type {@link org.apache.http.HttpHost}. *
*/ - public static final String DEFAULT_PROXY = "http.route.default-proxy"; + String DEFAULT_PROXY = "http.route.default-proxy"; /** * Parameter for the local address. @@ -59,7 +59,7 @@ public interface ConnRoutePNames { * This parameter expects a value of type {@link java.net.InetAddress}. * */ - public static final String LOCAL_ADDRESS = "http.route.local-address"; + String LOCAL_ADDRESS = "http.route.local-address"; /** * Parameter for an forced route. @@ -73,7 +73,7 @@ public interface ConnRoutePNames { * {@link org.apache.http.conn.routing.HttpRoute HttpRoute}. * */ - public static final String FORCED_ROUTE = "http.route.forced-route"; + String FORCED_ROUTE = "http.route.forced-route"; } diff --git a/httpclient/src/main/java/org/apache/http/conn/routing/HttpRoute.java b/httpclient/src/main/java/org/apache/http/conn/routing/HttpRoute.java index bf843da0d..fc89444ec 100644 --- a/httpclient/src/main/java/org/apache/http/conn/routing/HttpRoute.java +++ b/httpclient/src/main/java/org/apache/http/conn/routing/HttpRoute.java @@ -212,26 +212,26 @@ public final class HttpRoute implements RouteInfo, Cloneable { } @Override - public final HttpHost getTargetHost() { + public HttpHost getTargetHost() { return this.targetHost; } @Override - public final InetAddress getLocalAddress() { + public InetAddress getLocalAddress() { return this.localAddress; } - public final InetSocketAddress getLocalSocketAddress() { + public InetSocketAddress getLocalSocketAddress() { return this.localAddress != null ? new InetSocketAddress(this.localAddress, 0) : null; } @Override - public final int getHopCount() { + public int getHopCount() { return proxyChain != null ? proxyChain.size() + 1 : 1; } @Override - public final HttpHost getHopTarget(final int hop) { + public HttpHost getHopTarget(final int hop) { Args.notNegative(hop, "Hop index"); final int hopcount = getHopCount(); Args.check(hop < hopcount, "Hop index exceeds tracked route length"); @@ -239,32 +239,32 @@ public final class HttpRoute implements RouteInfo, Cloneable { } @Override - public final HttpHost getProxyHost() { + public HttpHost getProxyHost() { return proxyChain != null && !this.proxyChain.isEmpty() ? this.proxyChain.get(0) : null; } @Override - public final TunnelType getTunnelType() { + public TunnelType getTunnelType() { return this.tunnelled; } @Override - public final boolean isTunnelled() { + public boolean isTunnelled() { return (this.tunnelled == TunnelType.TUNNELLED); } @Override - public final LayerType getLayerType() { + public LayerType getLayerType() { return this.layered; } @Override - public final boolean isLayered() { + public boolean isLayered() { return (this.layered == LayerType.LAYERED); } @Override - public final boolean isSecure() { + public boolean isSecure() { return this.secure; } @@ -277,7 +277,7 @@ public final class HttpRoute implements RouteInfo, Cloneable { * {@code false} */ @Override - public final boolean equals(final Object obj) { + public boolean equals(final Object obj) { if (this == obj) { return true; } @@ -302,7 +302,7 @@ public final class HttpRoute implements RouteInfo, Cloneable { * @return the hash code */ @Override - public final int hashCode() { + public int hashCode() { int hash = LangUtils.HASH_SEED; hash = LangUtils.hashCode(hash, this.targetHost); hash = LangUtils.hashCode(hash, this.localAddress); @@ -323,7 +323,7 @@ public final class HttpRoute implements RouteInfo, Cloneable { * @return a human-readable representation of this route */ @Override - public final String toString() { + public String toString() { final StringBuilder cab = new StringBuilder(50 + getHopCount()*30); if (this.localAddress != null) { cab.append(this.localAddress); diff --git a/httpclient/src/main/java/org/apache/http/conn/routing/HttpRouteDirector.java b/httpclient/src/main/java/org/apache/http/conn/routing/HttpRouteDirector.java index d6e9d2557..b1f4a5097 100644 --- a/httpclient/src/main/java/org/apache/http/conn/routing/HttpRouteDirector.java +++ b/httpclient/src/main/java/org/apache/http/conn/routing/HttpRouteDirector.java @@ -37,25 +37,25 @@ package org.apache.http.conn.routing; public interface HttpRouteDirector { /** Indicates that the route can not be established at all. */ - public final static int UNREACHABLE = -1; + int UNREACHABLE = -1; /** Indicates that the route is complete. */ - public final static int COMPLETE = 0; + int COMPLETE = 0; /** Step: open connection to target. */ - public final static int CONNECT_TARGET = 1; + int CONNECT_TARGET = 1; /** Step: open connection to proxy. */ - public final static int CONNECT_PROXY = 2; + int CONNECT_PROXY = 2; /** Step: tunnel through proxy to target. */ - public final static int TUNNEL_TARGET = 3; + int TUNNEL_TARGET = 3; /** Step: tunnel through proxy to other proxy. */ - public final static int TUNNEL_PROXY = 4; + int TUNNEL_PROXY = 4; /** Step: layer protocol (over tunnel). */ - public final static int LAYER_PROTOCOL = 5; + int LAYER_PROTOCOL = 5; /** @@ -69,6 +69,6 @@ public interface HttpRouteDirector { * either the next step to perform, or success, or failure. * 0 is for success, a negative value for failure. */ - public int nextStep(RouteInfo plan, RouteInfo fact); + int nextStep(RouteInfo plan, RouteInfo fact); } diff --git a/httpclient/src/main/java/org/apache/http/conn/routing/HttpRoutePlanner.java b/httpclient/src/main/java/org/apache/http/conn/routing/HttpRoutePlanner.java index 76297d45d..6efdbeff7 100644 --- a/httpclient/src/main/java/org/apache/http/conn/routing/HttpRoutePlanner.java +++ b/httpclient/src/main/java/org/apache/http/conn/routing/HttpRoutePlanner.java @@ -61,7 +61,7 @@ public interface HttpRoutePlanner { * * @throws HttpException in case of a problem */ - public HttpRoute determineRoute(HttpHost target, + HttpRoute determineRoute(HttpHost target, HttpRequest request, HttpContext context) throws HttpException; diff --git a/httpclient/src/main/java/org/apache/http/conn/routing/RouteTracker.java b/httpclient/src/main/java/org/apache/http/conn/routing/RouteTracker.java index b58aca67d..2b5baf2d0 100644 --- a/httpclient/src/main/java/org/apache/http/conn/routing/RouteTracker.java +++ b/httpclient/src/main/java/org/apache/http/conn/routing/RouteTracker.java @@ -112,7 +112,7 @@ public final class RouteTracker implements RouteInfo, Cloneable { * @param secure {@code true} if the route is secure, * {@code false} otherwise */ - public final void connectTarget(final boolean secure) { + public void connectTarget(final boolean secure) { Asserts.check(!this.connected, "Already connected"); this.connected = true; this.secure = secure; @@ -125,7 +125,7 @@ public final class RouteTracker implements RouteInfo, Cloneable { * @param secure {@code true} if the route is secure, * {@code false} otherwise */ - public final void connectProxy(final HttpHost proxy, final boolean secure) { + public void connectProxy(final HttpHost proxy, final boolean secure) { Args.notNull(proxy, "Proxy host"); Asserts.check(!this.connected, "Already connected"); this.connected = true; @@ -139,7 +139,7 @@ public final class RouteTracker implements RouteInfo, Cloneable { * @param secure {@code true} if the route is secure, * {@code false} otherwise */ - public final void tunnelTarget(final boolean secure) { + public void tunnelTarget(final boolean secure) { Asserts.check(this.connected, "No tunnel unless connected"); Asserts.notNull(this.proxyChain, "No tunnel without proxy"); this.tunnelled = TunnelType.TUNNELLED; @@ -155,7 +155,7 @@ public final class RouteTracker implements RouteInfo, Cloneable { * @param secure {@code true} if the route is secure, * {@code false} otherwise */ - public final void tunnelProxy(final HttpHost proxy, final boolean secure) { + public void tunnelProxy(final HttpHost proxy, final boolean secure) { Args.notNull(proxy, "Proxy host"); Asserts.check(this.connected, "No tunnel unless connected"); Asserts.notNull(this.proxyChain, "No tunnel without proxy"); @@ -175,7 +175,7 @@ public final class RouteTracker implements RouteInfo, Cloneable { * @param secure {@code true} if the route is secure, * {@code false} otherwise */ - public final void layerProtocol(final boolean secure) { + public void layerProtocol(final boolean secure) { // it is possible to layer a protocol over a direct connection, // although this case is probably not considered elsewhere Asserts.check(this.connected, "No layered protocol unless connected"); @@ -184,17 +184,17 @@ public final class RouteTracker implements RouteInfo, Cloneable { } @Override - public final HttpHost getTargetHost() { + public HttpHost getTargetHost() { return this.targetHost; } @Override - public final InetAddress getLocalAddress() { + public InetAddress getLocalAddress() { return this.localAddress; } @Override - public final int getHopCount() { + public int getHopCount() { int hops = 0; if (this.connected) { if (proxyChain == null) { @@ -207,7 +207,7 @@ public final class RouteTracker implements RouteInfo, Cloneable { } @Override - public final HttpHost getHopTarget(final int hop) { + public HttpHost getHopTarget(final int hop) { Args.notNegative(hop, "Hop index"); final int hopcount = getHopCount(); Args.check(hop < hopcount, "Hop index exceeds tracked route length"); @@ -222,36 +222,36 @@ public final class RouteTracker implements RouteInfo, Cloneable { } @Override - public final HttpHost getProxyHost() { + public HttpHost getProxyHost() { return (this.proxyChain == null) ? null : this.proxyChain[0]; } - public final boolean isConnected() { + public boolean isConnected() { return this.connected; } @Override - public final TunnelType getTunnelType() { + public TunnelType getTunnelType() { return this.tunnelled; } @Override - public final boolean isTunnelled() { + public boolean isTunnelled() { return (this.tunnelled == TunnelType.TUNNELLED); } @Override - public final LayerType getLayerType() { + public LayerType getLayerType() { return this.layered; } @Override - public final boolean isLayered() { + public boolean isLayered() { return (this.layered == LayerType.LAYERED); } @Override - public final boolean isSecure() { + public boolean isSecure() { return this.secure; } @@ -263,7 +263,7 @@ public final class RouteTracker implements RouteInfo, Cloneable { * @return the tracked route, or * {@code null} if nothing has been tracked so far */ - public final HttpRoute toRoute() { + public HttpRoute toRoute() { return !this.connected ? null : new HttpRoute(this.targetHost, this.localAddress, this.proxyChain, this.secure, @@ -279,7 +279,7 @@ public final class RouteTracker implements RouteInfo, Cloneable { * {@code false} */ @Override - public final boolean equals(final Object o) { + public boolean equals(final Object o) { if (o == this) { return true; } @@ -308,7 +308,7 @@ public final class RouteTracker implements RouteInfo, Cloneable { * @return the hash code */ @Override - public final int hashCode() { + public int hashCode() { int hash = LangUtils.HASH_SEED; hash = LangUtils.hashCode(hash, this.targetHost); hash = LangUtils.hashCode(hash, this.localAddress); @@ -330,7 +330,7 @@ public final class RouteTracker implements RouteInfo, Cloneable { * @return a human-readable representation of the tracked route */ @Override - public final String toString() { + public String toString() { final StringBuilder cab = new StringBuilder(50 + getHopCount()*30); cab.append("RouteTracker["); diff --git a/httpclient/src/main/java/org/apache/http/conn/scheme/Scheme.java b/httpclient/src/main/java/org/apache/http/conn/scheme/Scheme.java index 320171039..d482f3c2b 100644 --- a/httpclient/src/main/java/org/apache/http/conn/scheme/Scheme.java +++ b/httpclient/src/main/java/org/apache/http/conn/scheme/Scheme.java @@ -145,7 +145,7 @@ public final class Scheme { * * @return the default port for this scheme */ - public final int getDefaultPort() { + public int getDefaultPort() { return defaultPort; } @@ -160,7 +160,7 @@ public final class Scheme { * @deprecated (4.1) Use {@link #getSchemeSocketFactory()} */ @Deprecated - public final SocketFactory getSocketFactory() { + public SocketFactory getSocketFactory() { if (this.socketFactory instanceof SchemeSocketFactoryAdaptor) { return ((SchemeSocketFactoryAdaptor) this.socketFactory).getFactory(); } @@ -179,7 +179,7 @@ public final class Scheme { * * @since 4.1 */ - public final SchemeSocketFactory getSchemeSocketFactory() { + public SchemeSocketFactory getSchemeSocketFactory() { return this.socketFactory; } @@ -188,7 +188,7 @@ public final class Scheme { * * @return the name of this scheme, in lowercase */ - public final String getName() { + public String getName() { return name; } @@ -198,7 +198,7 @@ public final class Scheme { * @return {@code true} if layered connections are possible, * {@code false} otherwise */ - public final boolean isLayered() { + public boolean isLayered() { return layered; } @@ -211,7 +211,7 @@ public final class Scheme { * * @return the given port or the defaultPort */ - public final int resolvePort(final int port) { + public int resolvePort(final int port) { return port <= 0 ? defaultPort : port; } @@ -221,7 +221,7 @@ public final class Scheme { * @return a human-readable string description of this scheme */ @Override - public final String toString() { + public String toString() { if (stringRep == null) { final StringBuilder buffer = new StringBuilder(); buffer.append(this.name); @@ -233,7 +233,7 @@ public final class Scheme { } @Override - public final boolean equals(final Object obj) { + public boolean equals(final Object obj) { if (this == obj) { return true; } diff --git a/httpclient/src/main/java/org/apache/http/conn/scheme/SchemeRegistry.java b/httpclient/src/main/java/org/apache/http/conn/scheme/SchemeRegistry.java index d05f232e8..476a3919e 100644 --- a/httpclient/src/main/java/org/apache/http/conn/scheme/SchemeRegistry.java +++ b/httpclient/src/main/java/org/apache/http/conn/scheme/SchemeRegistry.java @@ -69,7 +69,7 @@ public final class SchemeRegistry { * @throws IllegalStateException * if the scheme with the given name is not registered */ - public final Scheme getScheme(final String name) { + public Scheme getScheme(final String name) { final Scheme found = get(name); if (found == null) { throw new IllegalStateException @@ -89,7 +89,7 @@ public final class SchemeRegistry { * @throws IllegalStateException * if a scheme with the respective name is not registered */ - public final Scheme getScheme(final HttpHost host) { + public Scheme getScheme(final HttpHost host) { Args.notNull(host, "Host"); return getScheme(host.getSchemeName()); } @@ -102,7 +102,7 @@ public final class SchemeRegistry { * @return the scheme, or * {@code null} if there is none by this name */ - public final Scheme get(final String name) { + public Scheme get(final String name) { Args.notNull(name, "Scheme name"); // leave it to the caller to use the correct name - all lowercase //name = name.toLowerCase(Locale.ENGLISH); @@ -120,7 +120,7 @@ public final class SchemeRegistry { * @return the scheme previously registered with that name, or * {@code null} if none was registered */ - public final Scheme register(final Scheme sch) { + public Scheme register(final Scheme sch) { Args.notNull(sch, "Scheme"); final Scheme old = registeredSchemes.put(sch.getName(), sch); return old; @@ -134,7 +134,7 @@ public final class SchemeRegistry { * @return the unregistered scheme, or * {@code null} if there was none */ - public final Scheme unregister(final String name) { + public Scheme unregister(final String name) { Args.notNull(name, "Scheme name"); // leave it to the caller to use the correct name - all lowercase //name = name.toLowerCase(Locale.ENGLISH); @@ -147,7 +147,7 @@ public final class SchemeRegistry { * * @return List containing registered scheme names. */ - public final List