Author: kwright
Date: Tue Dec 17 20:31:37 2013
New Revision: 1551687

URL: http://svn.apache.org/r1551687
Log:
Fix NPE

Modified:
    
manifoldcf/branches/CONNECTORS-829/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java

Modified: 
manifoldcf/branches/CONNECTORS-829/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-829/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java?rev=1551687&r1=1551686&r2=1551687&view=diff
==============================================================================
--- 
manifoldcf/branches/CONNECTORS-829/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java
 (original)
+++ 
manifoldcf/branches/CONNECTORS-829/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java
 Tue Dec 17 20:31:37 2013
@@ -1813,7 +1813,7 @@ public class ThrottledFetcher
       return protocol.hashCode() +
         server.hashCode() +
         (port * 31) +
-        authentication.hashCode() +
+        ((authentication==null)?0:authentication.hashCode()) +
         ((trustStoreString==null)?0:trustStoreString.hashCode()) +
         ((proxyHost==null)?0:proxyHost.hashCode()) +
         (proxyPort * 29) +
@@ -1828,9 +1828,18 @@ public class ThrottledFetcher
         return false;
       ConnectionPoolKey other = (ConnectionPoolKey)o;
       if (!server.equals(other.server) ||
-        port != other.port ||
-        !authentication.equals(other.authentication))
+        port != other.port)
         return false;
+      if (authentication == null || other.authentication == null)
+      {
+        if (authentication != other.authentication)
+          return false;
+      }
+      else
+      {
+        if (!authentication.equals(other.authentication))
+          return false;
+      }
       if (trustStoreString == null || other.trustStoreString == null)
       {
         if (trustStoreString != other.trustStoreString)


Reply via email to