Index: HttpMultiClient.java
===================================================================
RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMultiClient.java,v
retrieving revision 1.1
diff -u -r1.1 HttpMultiClient.java
--- HttpMultiClient.java	22 Feb 2002 19:24:23 -0000	1.1
+++ HttpMultiClient.java	10 Mar 2002 06:48:52 -0000
@@ -67,10 +67,15 @@
 import org.apache.commons.httpclient.log.*;
 
 /**
+ *
  * An Http user-agent that supports multiple connections
  * to Http servers.
  *
  * @author Marc A. Saegesser
+ * @author Sean C. Sullivan
+ *
+ * @see HttpClient
+ *
  */
 public class HttpMultiClient
 {
@@ -87,6 +92,9 @@
 
     /**
      * No-args constructor.
+     *
+     * HttpMultiClient objects will have strictMode enabled by default.
+     *
      */
     public HttpMultiClient()
     {
@@ -96,6 +104,9 @@
      * Set the shared state.
      *
      * @param state - the new shared state
+     *
+     * @see #getState()
+     *
      */
     public void setState(HttpSharedState state)
     {
@@ -106,10 +117,14 @@
      * Get the shared state
      *
      * @return the shared state
+     *
+     * @see #setState(HttpSharedState)
+     *
      */
     public HttpSharedState getState()
     {
-        if(state == null){
+        if (state == null)
+        {
             state = new HttpSharedState();
         }
 
@@ -118,6 +133,10 @@
 
     /**
      *
+     * @param strictMode <code>true</code> if strict mode should be used
+     *
+     * @see #isStrictMode()
+     *
      */
     public void setStrictMode(boolean strictMode)
     {
@@ -126,6 +145,10 @@
 
     /**
      *
+     * @return <code>true</code> if strict mode being used
+     *
+     * @see #setStrictMode(boolean)
+     *
      */
     public boolean isStrictMode()
     {
@@ -133,31 +156,55 @@
     }
 
     /**
-     * Execute the given {@link HttpMethod} using my current
+     *
+     * Execute the given {@link HttpUrlMethod} using my current
      * {@link HttpConnection connection} and {@link HttpState}.
      *
-     * @param method the {@link HttpMethod} to execute
+     * @param method the {@link HttpMethod} to execute. Must be non-null.
      * @return the method's response code
      *
      * @throws IOException if an I/O error occurs
      * @throws HttpException if a protocol exception occurs
+     *
      */
     public int executeMethod(HttpUrlMethod method) throws IOException, HttpException
     {
+
+        if (null == method)
+        {
+            throw new NullPointerException("method parameter");
+        }
+
         HttpConnection connection = mgr.getConnection(method.getUrl());
         
         int status = 0;
 
         method.setStrictMode(strictMode);
 
-        status = method.execute(getState(),connection);
-        mgr.releaseConnection(connection);
+        try
+        {
+            status = method.execute(getState(),connection);
+        }
+        catch (java.io.IOException ex)
+        {
+	    throw ex;
+        }
+        catch (HttpException ex)
+        {
+	    throw ex;
+        }
+        finally
+        {
+            mgr.releaseConnection(connection);
+        }
 
-        if(status == 301 || status == 302 || 
-           status == 303 || status == 307){
+        if (status == 301 || status == 302 || 
+           status == 303 || status == 307)
+        {
             Header header = method.getResponseHeader("Location");
             String url = header.getValue();
-            if(url == null){
+            if (url == null)
+            {
                 log.error("HttpMultiClient.executeMethod:  Received redirect without Location header.");
                 throw new HttpException("Received redirect without Location header.");
             }

