Add missing @Override markers

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@617233 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2008-01-31 20:38:04 +00:00
parent 2cc2818642
commit 9b592fd961
48 changed files with 203 additions and 101 deletions

View File

@ -228,6 +228,7 @@ public class AuthScope {
/**
* @see java.lang.Object#equals(Object)
*/
@Override
public boolean equals(Object o) {
if (o == null) {
return false;
@ -249,6 +250,7 @@ public class AuthScope {
/**
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
if (this.scheme != null) {
@ -276,6 +278,7 @@ public class AuthScope {
/**
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
int hash = LangUtils.HASH_SEED;
hash = LangUtils.hashCode(hash, this.host);

View File

@ -130,6 +130,7 @@ public class UsernamePasswordCredentials implements Credentials {
*
* @return the username:password formed string
*/
@Override
public String toString() {
StringBuffer result = new StringBuffer();
result.append(this.userName);
@ -143,6 +144,7 @@ public class UsernamePasswordCredentials implements Credentials {
*
* @return The hash code including user name and password.
*/
@Override
public int hashCode() {
int hash = LangUtils.HASH_SEED;
hash = LangUtils.hashCode(hash, this.userName);
@ -158,6 +160,7 @@ public class UsernamePasswordCredentials implements Credentials {
*
* @return <code>true</code> if the object is equivalent.
*/
@Override
public boolean equals(Object o) {
if (o == null) return false;
if (this == o) return true;

View File

@ -132,6 +132,7 @@ public class AuthState {
}
@Override
public String toString() {
StringBuilder buffer = new StringBuilder();
buffer.append("auth scope [");

View File

@ -73,6 +73,7 @@ public class HttpGet extends HttpRequestBase {
setURI(new URI(uri));
}
@Override
public String getMethod() {
return METHOD_NAME;
}

View File

@ -73,6 +73,7 @@ public class HttpHead extends HttpRequestBase {
setURI(new URI(uri));
}
@Override
public String getMethod() {
return METHOD_NAME;
}

View File

@ -78,6 +78,7 @@ public class HttpOptions extends HttpRequestBase {
setURI(new URI(uri));
}
@Override
public String getMethod() {
return METHOD_NAME;
}

View File

@ -77,6 +77,7 @@ public class HttpPost extends HttpEntityEnclosingRequestBase {
setURI(new URI(uri));
}
@Override
public String getMethod() {
return METHOD_NAME;
}

View File

@ -69,6 +69,7 @@ public class HttpPut extends HttpEntityEnclosingRequestBase {
setURI(new URI(uri));
}
@Override
public String getMethod() {
return METHOD_NAME;
}

View File

@ -72,6 +72,7 @@ public class HttpTrace extends HttpRequestBase {
setURI(new URI(uri));
}
@Override
public String getMethod() {
return METHOD_NAME;
}

View File

@ -78,6 +78,7 @@ public class UrlEncodedFormEntity extends AbstractHttpEntity {
return new ByteArrayInputStream(this.content);
}
@Override
public Header getContentType() {
return new BasicHeader(HTTP.CONTENT_TYPE, FORM_URL_ENCODED_CONTENT_TYPE);
}

View File

@ -86,12 +86,14 @@ public class BasicManagedEntity extends HttpEntityWrapper
// non-javadoc, see interface HttpEntity
@Override
public boolean isRepeatable() {
return false;
}
// non-javadoc, see interface HttpEntity
@Override
public InputStream getContent() throws IOException {
return new EofSensorInputStream(wrappedEntity.getContent(), this);
@ -99,6 +101,7 @@ public class BasicManagedEntity extends HttpEntityWrapper
// non-javadoc, see interface HttpEntity
@Override
public void consumeContent() throws IOException {
if (managedConn == null)

View File

@ -131,6 +131,7 @@ public class EofSensorInputStream extends InputStream
// non-javadoc, see base class InputStream
@Override
public int read() throws IOException {
int l = -1;
@ -149,6 +150,7 @@ public class EofSensorInputStream extends InputStream
// non-javadoc, see base class InputStream
@Override
public int read(byte[] b, int off, int len) throws IOException {
int l = -1;
@ -167,6 +169,7 @@ public class EofSensorInputStream extends InputStream
// non-javadoc, see base class InputStream
@Override
public int read(byte[] b) throws IOException {
int l = -1;
@ -184,6 +187,7 @@ public class EofSensorInputStream extends InputStream
// non-javadoc, see base class InputStream
@Override
public int available() throws IOException {
int a = 0; // not -1
@ -202,6 +206,7 @@ public class EofSensorInputStream extends InputStream
// non-javadoc, see base class InputStream
@Override
public void close() throws IOException {
// tolerate multiple calls to close()
selfClosed = true;

View File

@ -157,6 +157,7 @@ public final class PlainSocketFactory implements SocketFactory {
*
* @return iff the argument is this object
*/
@Override
public boolean equals(Object obj) {
return (obj == this);
}
@ -166,6 +167,7 @@ public final class PlainSocketFactory implements SocketFactory {
* All instances of this class have the same hash code.
* There is only one instance of this class.
*/
@Override
public int hashCode() {
return PlainSocketFactory.class.hashCode();
}

View File

@ -168,6 +168,7 @@ public final class Scheme {
*
* @return a human-readable string description of this scheme
*/
@Override
public final String toString() {
if (stringRep == null) {
StringBuilder buffer = new StringBuilder();
@ -187,6 +188,7 @@ public final class Scheme {
*
* @return <code>true</code> iff the argument is equal to this scheme
*/
@Override
public final boolean equals(Object obj) {
if (obj == null) return false;
if (this == obj) return true;
@ -206,6 +208,7 @@ public final class Scheme {
*
* @return the hash code
*/
@Override
public int hashCode() {
int hash = LangUtils.HASH_SEED;
hash = LangUtils.hashCode(hash, this.defaultPort);

View File

@ -427,6 +427,7 @@ public final class HttpRoute implements Cloneable {
* @return <code>true</code> if the argument is the same route,
* <code>false</code>
*/
@Override
public final boolean equals(Object o) {
if (o == this)
return true;
@ -465,6 +466,7 @@ public final class HttpRoute implements Cloneable {
*
* @return the hash code
*/
@Override
public final int hashCode() {
int hc = this.targetHost.hashCode();
@ -492,6 +494,7 @@ public final class HttpRoute implements Cloneable {
*
* @return a human-readable representation of this route
*/
@Override
public final String toString() {
StringBuilder cab = new StringBuilder(50 + getHopCount()*30);
@ -522,6 +525,7 @@ public final class HttpRoute implements Cloneable {
// default implementation of clone() is sufficient
@Override
public Object clone() throws CloneNotSupportedException {
return super.clone();
}

View File

@ -393,6 +393,7 @@ public final class RouteTracker implements Cloneable {
* @return <code>true</code> if the argument is the same tracked route,
* <code>false</code>
*/
@Override
public final boolean equals(Object o) {
if (o == this)
return true;
@ -435,6 +436,7 @@ public final class RouteTracker implements Cloneable {
*
* @return the hash code
*/
@Override
public final int hashCode() {
int hc = this.targetHost.hashCode();
@ -464,6 +466,7 @@ public final class RouteTracker implements Cloneable {
*
* @return a human-readable representation of the tracked route
*/
@Override
public final String toString() {
StringBuilder cab = new StringBuilder(50 + getHopCount()*30);
@ -496,6 +499,7 @@ public final class RouteTracker implements Cloneable {
// default implementation of clone() is sufficient
@Override
public Object clone() throws CloneNotSupportedException {
return super.clone();
}

View File

@ -46,6 +46,7 @@ public class AllowAllHostnameVerifier extends AbstractVerifier {
// Allow everything - so never blowup.
}
@Override
public final String toString() {
return "ALLOW_ALL";
}

View File

@ -54,6 +54,7 @@ public class BrowserCompatHostnameVerifier extends AbstractVerifier {
verify(host, cns, subjectAlts, false);
}
@Override
public final String toString() {
return "BROWSER_COMPATIBLE";
}

View File

@ -61,6 +61,7 @@ public class StrictHostnameVerifier extends AbstractVerifier {
verify(host, cns, subjectAlts, true);
}
@Override
public final String toString() {
return "STRICT";
}

View File

@ -88,6 +88,7 @@ public final class CookieOrigin {
return this.secure;
}
@Override
public String toString() {
StringBuilder buffer = new StringBuilder();
buffer.append("[");

View File

@ -89,6 +89,7 @@ public class BasicScheme extends RFC2617Scheme {
* @throws MalformedChallengeException is thrown if the authentication challenge
* is malformed
*/
@Override
public void processChallenge(
final Header header) throws MalformedChallengeException {
super.processChallenge(header);

View File

@ -120,6 +120,7 @@ public class DigestScheme extends RFC2617Scheme {
* @throws MalformedChallengeException is thrown if the authentication challenge
* is malformed
*/
@Override
public void processChallenge(
final Header header) throws MalformedChallengeException {
super.processChallenge(header);

View File

@ -147,6 +147,7 @@ public class BasicCookieStore implements CookieStore {
return removed;
}
@Override
public String toString() {
return cookies.toString();
}

View File

@ -128,6 +128,7 @@ public class BasicCredentialsProvider implements CredentialsProvider {
return matchCredentials(this.credMap, authscope);
}
@Override
public String toString() {
return credMap.toString();
}

View File

@ -121,6 +121,7 @@ public class DefaultHttpClient extends AbstractHttpClient {
}
@Override
protected HttpParams createHttpParams() {
HttpParams params = new BasicHttpParams();
HttpProtocolParams.setVersion(params,
@ -142,6 +143,7 @@ public class DefaultHttpClient extends AbstractHttpClient {
}
@Override
protected ClientConnectionManager createClientConnectionManager() {
SchemeRegistry registry = new SchemeRegistry();
registry.register(
@ -175,16 +177,19 @@ public class DefaultHttpClient extends AbstractHttpClient {
}
@Override
protected HttpContext createHttpContext() {
return new SyncBasicHttpContext(null);
}
@Override
protected ConnectionReuseStrategy createConnectionReuseStrategy() {
return new DefaultConnectionReuseStrategy();
}
@Override
protected AuthSchemeRegistry createAuthSchemeRegistry() {
AuthSchemeRegistry registry = new AuthSchemeRegistry();
registry.register(
@ -197,6 +202,7 @@ public class DefaultHttpClient extends AbstractHttpClient {
}
@Override
protected CookieSpecRegistry createCookieSpecRegistry() {
CookieSpecRegistry registry = new CookieSpecRegistry();
registry.register(
@ -218,6 +224,7 @@ public class DefaultHttpClient extends AbstractHttpClient {
}
@Override
protected BasicHttpProcessor createHttpProcessor() {
BasicHttpProcessor httpproc = new BasicHttpProcessor();
httpproc.addInterceptor(new RequestDefaultHeaders());
@ -238,36 +245,43 @@ public class DefaultHttpClient extends AbstractHttpClient {
}
@Override
protected HttpRequestRetryHandler createHttpRequestRetryHandler() {
return new DefaultHttpRequestRetryHandler();
}
@Override
protected RedirectHandler createRedirectHandler() {
return new DefaultRedirectHandler();
}
@Override
protected AuthenticationHandler createTargetAuthenticationHandler() {
return new DefaultTargetAuthenticationHandler();
}
@Override
protected AuthenticationHandler createProxyAuthenticationHandler() {
return new DefaultProxyAuthenticationHandler();
}
@Override
protected CookieStore createCookieStore() {
return new BasicCookieStore();
}
@Override
protected CredentialsProvider createCredentialsProvider() {
return new BasicCredentialsProvider();
}
@Override
protected void populateContext(final HttpContext context) {
context.setAttribute(
ClientContext.AUTHSCHEME_REGISTRY,
@ -285,6 +299,7 @@ public class DefaultHttpClient extends AbstractHttpClient {
// non-javadoc, see base class AbstractHttpClient
@Override
protected HttpRoutePlanner createHttpRoutePlanner() {
return new DefaultHttpRoutePlanner(getConnectionManager());
}

View File

@ -97,6 +97,7 @@ public class DefaultClientConnection extends SocketHttpClientConnection
// non-javadoc, see interface OperatedClientConnection
@Override
public final Socket getSocket() {
return super.getSocket(); // base class attribute
}
@ -119,6 +120,7 @@ public class DefaultClientConnection extends SocketHttpClientConnection
*
* @throws IOException in case of a problem
*/
@Override
public void shutdown() throws IOException {
LOG.debug("Connection shut down");
@ -131,12 +133,14 @@ public class DefaultClientConnection extends SocketHttpClientConnection
} // shutdown
@Override
public void close() throws IOException {
LOG.debug("Connection closed");
super.close();
}
@Override
protected SessionInputBuffer createSessionInputBuffer(
final Socket socket,
int buffersize,
@ -152,6 +156,7 @@ public class DefaultClientConnection extends SocketHttpClientConnection
}
@Override
protected SessionOutputBuffer createSessionOutputBuffer(
final Socket socket,
int buffersize,
@ -167,6 +172,7 @@ public class DefaultClientConnection extends SocketHttpClientConnection
}
@Override
protected HttpMessageParser createResponseParser(
final SessionInputBuffer buffer,
final HttpResponseFactory responseFactory,
@ -229,6 +235,7 @@ public class DefaultClientConnection extends SocketHttpClientConnection
} // update
@Override
public HttpResponse receiveResponseHeader() throws HttpException, IOException {
HttpResponse response = super.receiveResponseHeader();
if (HEADERS_LOG.isDebugEnabled()) {
@ -242,6 +249,7 @@ public class DefaultClientConnection extends SocketHttpClientConnection
}
@Override
public void sendRequestHeader(HttpRequest request) throws HttpException, IOException {
super.sendRequestHeader(request);
if (HEADERS_LOG.isDebugEnabled()) {

View File

@ -70,6 +70,7 @@ public class DefaultResponseParser extends AbstractMessageParser {
}
@Override
protected HttpMessage parseHead(
final SessionInputBuffer sessionBuffer) throws IOException, HttpException {
// clear the buffer

View File

@ -374,6 +374,7 @@ public class SingleClientConnManager implements ClientConnectionManager {
// non-javadoc, see base AbstractPoolEntry
@Override
protected ClientConnectionOperator getOperator() {
return SingleClientConnManager.this.connOperator;
}

View File

@ -82,6 +82,7 @@ public class BasicPoolEntry extends AbstractPoolEntry {
// non-javadoc, see base AbstractPoolEntry
@Override
protected ClientConnectionOperator getOperator() {
return this.connOperator;
}

View File

@ -78,6 +78,7 @@ public class BasicPooledConnAdapter extends AbstractPooledConnAdapter {
// non-javadoc, see base class
@Override
protected void detach() {
// override needed only to make method visible in this package
super.detach();

View File

@ -208,6 +208,7 @@ public class ConnPoolByRoute extends AbstractConnPool {
// non-javadoc, see base class AbstractConnPool
@Override
public BasicPoolEntry getEntry(HttpRoute route,
long timeout, TimeUnit tunit,
ClientConnectionOperator operator)
@ -310,6 +311,7 @@ public class ConnPoolByRoute extends AbstractConnPool {
// non-javadoc, see base class AbstractConnPool
@Override
public void freeEntry(BasicPoolEntry entry) {
HttpRoute route = entry.getPlannedRoute();
@ -494,6 +496,7 @@ public class ConnPoolByRoute extends AbstractConnPool {
// non-javadoc, see base class AbstractConnPool
@Override
protected void handleLostEntry(HttpRoute route) {
try {
@ -566,6 +569,7 @@ public class ConnPoolByRoute extends AbstractConnPool {
//@@@ revise this cleanup stuff
//@@@ move method to base class when deleteEntry() is fixed
// non-javadoc, see base class AbstractConnPool
@Override
public void deleteClosedConnections() {
try {
@ -587,6 +591,7 @@ public class ConnPoolByRoute extends AbstractConnPool {
// non-javadoc, see base class AbstractConnPool
@Override
public void shutdown() {
try {

View File

@ -131,6 +131,7 @@ public class RefQueueWorker implements Runnable {
*
* @return a descriptive string for this worker
*/
@Override
public String toString() {
return "RefQueueWorker::" + this.workerThread;
}

View File

@ -311,6 +311,7 @@ public class BasicClientCookie implements SetCookie, ClientCookie {
return this.attribs.get(name) != null;
}
@Override
public String toString() {
StringBuilder buffer = new StringBuilder();
buffer.append("[version: ");

View File

@ -58,6 +58,7 @@ public class BasicClientCookie2 extends BasicClientCookie implements SetCookie2
super(name, value);
}
@Override
public int[] getPorts() {
return this.ports;
}
@ -66,6 +67,7 @@ public class BasicClientCookie2 extends BasicClientCookie implements SetCookie2
this.ports = ports;
}
@Override
public String getCommentURL() {
return this.commentURL;
}
@ -78,10 +80,12 @@ public class BasicClientCookie2 extends BasicClientCookie implements SetCookie2
this.discard = discard;
}
@Override
public boolean isPersistent() {
return !this.discard && super.isPersistent();
}
@Override
public boolean isExpired(final Date date) {
return this.discard || super.isExpired(date);
}

View File

@ -49,6 +49,7 @@ public class BasicSecureHandler extends AbstractCookieAttributeHandler {
cookie.setSecure(true);
}
@Override
public boolean match(final Cookie cookie, final CookieOrigin origin) {
if (cookie == null) {
throw new IllegalArgumentException("Cookie may not be null");

View File

@ -216,6 +216,7 @@ public final class DateUtils {
private static final ThreadLocal<SoftReference<Map<String, SimpleDateFormat>>>
THREADLOCAL_FORMATS = new ThreadLocal<SoftReference<Map<String, SimpleDateFormat>>>() {
@Override
protected SoftReference<Map<String, SimpleDateFormat>> initialValue() {
return new SoftReference<Map<String, SimpleDateFormat>>(
new HashMap<String, SimpleDateFormat>());

View File

@ -42,6 +42,7 @@ public class NetscapeDomainHandler extends BasicDomainHandler {
super();
}
@Override
public void validate(final Cookie cookie, final CookieOrigin origin)
throws MalformedCookieException {
super.validate(cookie, origin);
@ -88,7 +89,8 @@ public class NetscapeDomainHandler extends BasicDomainHandler {
return false;
}
public boolean match(Cookie cookie, CookieOrigin origin) {
@Override
public boolean match(Cookie cookie, CookieOrigin origin) {
if (cookie == null) {
throw new IllegalArgumentException("Cookie may not be null");
}

View File

@ -112,6 +112,7 @@ public class RFC2109Spec extends CookieSpecBase {
return parse(elems, origin);
}
@Override
public void validate(final Cookie cookie, final CookieOrigin origin)
throws MalformedCookieException {
if (cookie == null) {

View File

@ -60,6 +60,7 @@ public class RFC2109VersionHandler extends AbstractCookieAttributeHandler {
}
}
@Override
public void validate(final Cookie cookie, final CookieOrigin origin)
throws MalformedCookieException {
if (cookie == null) {

View File

@ -91,6 +91,7 @@ public class RFC2965Spec extends RFC2109Spec {
return cookie;
}
@Override
public List<Cookie> parse(
final Header header,
CookieOrigin origin) throws MalformedCookieException {
@ -149,6 +150,7 @@ public class RFC2965Spec extends RFC2109Spec {
return cookies;
}
@Override
public void validate(final Cookie cookie, CookieOrigin origin)
throws MalformedCookieException {
if (cookie == null) {
@ -161,6 +163,7 @@ public class RFC2965Spec extends RFC2109Spec {
super.validate(cookie, origin);
}
@Override
public boolean match(final Cookie cookie, CookieOrigin origin) {
if (cookie == null) {
throw new IllegalArgumentException("Cookie may not be null");
@ -175,6 +178,7 @@ public class RFC2965Spec extends RFC2109Spec {
/**
* Adds valid Port attribute value, e.g. "8000,8001,8002"
*/
@Override
protected void formatCookieAsVer(final CharArrayBuffer buffer,
final Cookie cookie, int version) {
super.formatCookieAsVer(buffer, cookie, version);
@ -237,10 +241,12 @@ public class RFC2965Spec extends RFC2109Spec {
}
}
@Override
public int getVersion() {
return 1;
}
@Override
public Header getVersionHeader() {
CharArrayBuffer buffer = new CharArrayBuffer(40);
buffer.append(SM.COOKIE2);

View File

@ -89,6 +89,7 @@ public class ExecReqThread extends GetConnThread {
* This method is invoked when the thread is started.
* It invokes the base class implementation.
*/
@Override
public void run() {
super.run(); // obtain connection
if (connection == null)

View File

@ -68,6 +68,7 @@ public class GetConnThread extends Thread {
/**
* This method is executed when the thread is started.
*/
@Override
public void run() {
try {
connection = conn_manager.getConnection

View File

@ -63,6 +63,7 @@ public class AwaitThread extends Thread {
/**
* This method is executed when the thread is started.
*/
@Override
public void run() {
try {
wait_lock.lock();

View File

@ -81,6 +81,7 @@ public class TestDumbHelpers extends TestCase {
}
@Override
protected void setUp() {
supportedSchemes = new SchemeRegistry();
SocketFactory sf = PlainSocketFactory.getSocketFactory();

View File

@ -252,6 +252,7 @@ public class LocalTestServer {
}
@Override
public String toString() {
ServerSocket ssock = servicedSocket; // avoid synchronization
StringBuffer sb = new StringBuffer(80);

View File

@ -109,6 +109,7 @@ public abstract class ServerTestBase extends TestCase {
*
* @throws Exception in case of a problem
*/
@Override
protected void setUp() throws Exception {
if (defaultParams == null) {
@ -159,6 +160,7 @@ public abstract class ServerTestBase extends TestCase {
*
* @see #setUp setUp()
*/
@Override
protected void tearDown() throws Exception {
localServer.stop();
}

View File

@ -51,6 +51,7 @@ public class SecureSocketFactoryMockup extends SocketFactoryMockup
// don't implement equals and hashcode, all instances are different!
@Override
public String toString() {
return "SecureSocketFactoryMockup." + mockup_name;
}

View File

@ -57,6 +57,7 @@ public class SocketFactoryMockup implements SocketFactory {
// don't implement equals and hashcode, all instances are different!
@Override
public String toString() {
return "SocketFactoryMockup." + mockup_name;
}