This is an automated email from the ASF dual-hosted git repository.

amccright pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new 64f2803  Handle UndeclaredThrowableException/NoSuchFieldException in 
JDK 12+
64f2803 is described below

commit 64f28032da4c509ecfa1661351f83672b6691664
Author: Andy McCright <[email protected]>
AuthorDate: Thu Mar 14 11:16:12 2019 -0500

    Handle UndeclaredThrowableException/NoSuchFieldException in JDK 12+
---
 .../main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java    | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git 
a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java 
b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
index 203b169..a92111b 100644
--- 
a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
+++ 
b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
@@ -202,14 +202,12 @@ public class ClientProxyImpl extends AbstractClient 
implements
                         }
                         MethodHandle mh = lookup.unreflectSpecial(m, 
declaringClass).bindTo(o);
                         return params != null && params.length > 0 ? 
mh.invokeWithArguments(params) : mh.invoke();
-                    } catch (IllegalAccessException e) {
-                        try {
+                    } catch (Throwable t) {
+                        try { // try using built-in JDK 9+ API for invoking 
default method
                             return 
invokeDefaultMethodUsingPrivateLookup(declaringClass, o, m, params);
                         } catch (final NoSuchMethodException ex) {
-                            throw new WrappedException(e);
+                            throw new WrappedException(t);
                         }
-                    } catch (Throwable t) {
-                        throw new WrappedException(t);
                     }
                 }
             });

Reply via email to