From 940fa68372356b700aa77d47bc8b522a9cbe4b57 Mon Sep 17 00:00:00 2001 From: mguessan Date: Mon, 8 Dec 2008 12:53:55 +0000 Subject: [PATCH] Fix SSLProtocolSocketFactory equals and hashCode to allow pooling git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@216 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- .../http/DavGatewaySSLProtocolSocketFactory.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/java/davmail/http/DavGatewaySSLProtocolSocketFactory.java b/src/java/davmail/http/DavGatewaySSLProtocolSocketFactory.java index 75fea66f..8f297b7e 100644 --- a/src/java/davmail/http/DavGatewaySSLProtocolSocketFactory.java +++ b/src/java/davmail/http/DavGatewaySSLProtocolSocketFactory.java @@ -96,4 +96,20 @@ public class DavGatewaySSLProtocolSocketFactory extends SSLProtocolSocketFactory throw new IOException(e+" "+e.getMessage()); } } + + /** + * All instances of SSLProtocolSocketFactory are the same. + */ + @Override + public boolean equals(Object obj) { + return ((obj != null) && obj.getClass().equals(this.getClass())); + } + + /** + * All instances of SSLProtocolSocketFactory have the same hash code. + */ + @Override + public int hashCode() { + return this.getClass().hashCode(); + } }