commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oglu...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient HttpClient.java
Date Mon, 24 Feb 2003 19:12:06 GMT
oglueck     2003/02/24 11:12:06

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        HttpClient.java
  Log:
  clean up catch clause
  
  Revision  Changes    Path
  1.70      +9 -14     jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java
  
  Index: HttpClient.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- HttpClient.java	21 Feb 2003 13:48:09 -0000	1.69
  +++ HttpClient.java	24 Feb 2003 19:12:06 -0000	1.70
  @@ -552,11 +552,6 @@
           );
   
           try {
  -            // Catch all possible exceptions to make sure to release the 
  -            // connection, as although the user may call 
  -            // Method->releaseConnection(), the method doesn't know about the
  -            // connection until HttpMethod.execute() is called.
  -            
               method.setStrictMode(strictMode);
           
               if (!connection.isOpen()) {
  @@ -567,12 +562,12 @@
                       method = new ConnectMethod(method);
                   }
               }
  -        } catch (IOException e) {
  -            connection.releaseConnection();
  -            throw e;
  -        } catch (RuntimeException e) {
  +        } finally {
  +            // make sure to release the 
  +            // connection, as although the user may call 
  +            // Method->releaseConnection(), the method doesn't know about the
  +            // connection until HttpMethod.execute() is called.
               connection.releaseConnection();
  -            throw e;
           }
           
           return method.execute(state, connection);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message