RFR 8156801: java/net/httpclient/security/Driver.java failed with RuntimeException: Non zero return value

Pavel Rappo pavel.rappo at oracle.com
Thu May 12 14:05:42 UTC 2016


Hi Michael,

Is there any reason why you don't throw the wrapped `Throwable` unconditionally? 
Thanks.

@@ -144,14 +144,11 @@
         }
     }
 
-    static Object getProxy(int port, boolean b) throws Exception {
+    static Object getProxy(int port, boolean b) throws Throwable {
         try {
             return proxyConstructor.newInstance(port, b);
         } catch (InvocationTargetException e) {
-            Throwable t = e.getTargetException();
-            if (t instanceof BindException)
-                throw (BindException) t;
-            throw e;
+            throw e.getCause();
         }
     }
 
@@ -331,7 +328,7 @@
         } catch (BindException e) {
             System.out.println("Bind failed");
             throw e;
-        } catch (Exception ee) {
+        } catch (Throwable ee) {
             throw new RuntimeException(ee);
         }
         System.out.println("Proxy port = " + proxyPort);

> On 12 May 2016, at 14:43, Michael McMahon <michael.x.mcmahon at oracle.com> wrote:
> 
> This test is still failing intermittently. The reason is that one of the places where BindException
> can be thrown is called by reflection. So, the exception is wrapped in an InvocationTargetException
> and needs to be unwrapped.
> 
> http://cr.openjdk.java.net/~michaelm/8156801/webrev.1/
> 
> Thanks,
> Michael



More information about the net-dev mailing list