cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [17/48] cxf git commit: Some HttpsURLConnectionFactory changes
Date Wed, 29 Jun 2016 22:44:15 GMT
Some HttpsURLConnectionFactory changes


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/189b6643
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/189b6643
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/189b6643

Branch: refs/heads/master-jaxrs-2.1
Commit: 189b6643d30eab4d79a0f7722c9277e76e92a1fd
Parents: f32d804
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Mon Jun 20 16:45:13 2016 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Mon Jun 20 16:45:13 2016 +0100

----------------------------------------------------------------------
 .../https/HttpsURLConnectionFactory.java        | 29 ++++++--------------
 1 file changed, 9 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/189b6643/rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java
b/rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java
index 0d02d6b..63226b4 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java
@@ -46,7 +46,6 @@ import org.apache.cxf.configuration.jsse.TLSClientParameters;
  * This HttpsURLConnectionFactory implements the HttpURLConnectionFactory
  * for using the given SSL Policy to configure TLS connections for "https:"
  * URLs.
- * 
  */
 public class HttpsURLConnectionFactory {
     
@@ -78,13 +77,10 @@ public class HttpsURLConnectionFactory {
      * 
      * 
      * @param proxy This parameter is non-null if connection should be proxied.
-     * @param url   The target URL. This parameter must be an https url.
+     * @param url   The target URL.
      * 
-     * @return The HttpsURLConnection for the given URL.
-     * @throws IOException This exception is thrown if 
-     *         the "url" is not "https" or other IOException
-     *         is thrown. 
-     *                     
+     * @return The HttpURLConnection for the given URL.
+     * @throws IOException
      */
     public HttpURLConnection createConnection(TLSClientParameters tlsClientParameters, 
             Proxy proxy, URL url) throws IOException {
@@ -99,21 +95,14 @@ public class HttpsURLConnectionFactory {
                 tlsClientParameters = new TLSClientParameters();
             }
 
-            Exception ex = null;
             try {
                 decorateWithTLS(tlsClientParameters, connection);
-            } catch (Exception e) {
-                ex = e;
-            } finally {
-                if (ex != null) {
-                    if (ex instanceof IOException) {
-                        throw (IOException) ex;
-                    }
-                    // use exception.initCause(ex) to be java 5 compatible
-                    IOException ioException = new IOException("Error while initializing secure
socket");
-                    ioException.initCause(ex);
-                    throw ioException;
+            } catch (Throwable ex) {
+                if (ex instanceof IOException) {
+                    throw (IOException) ex;
                 }
+                IOException ioException = new IOException("Error while initializing secure
socket", ex);
+                throw ioException;
             }
         }
 
@@ -230,7 +219,7 @@ public class HttpsURLConnectionFactory {
                     }
                     return;
                 } 
-                //if we cannot set the SSLSocketFactor, we're in serious trouble.
+                //if we cannot set the SSLSocketFactory, we're in serious trouble.
                 throw new IllegalArgumentException("Error decorating connection class " 
                         + connection.getClass().getName(), ex);
             }


Mime
View raw message