Author: nickarls
Date: 2009-12-03 02:18:13 -0500 (Thu, 03 Dec 2009)
New Revision: 5200
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/EnterpriseBeanProxyMethodHandler.java
core/trunk/impl/src/main/java/org/jboss/weld/util/Reflections.java
Log:
Don't swallow exceptions in EJB proxy method handler
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/EnterpriseBeanProxyMethodHandler.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/EnterpriseBeanProxyMethodHandler.java 2009-12-02
22:07:31 UTC (rev 5199)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/EnterpriseBeanProxyMethodHandler.java 2009-12-03
07:18:13 UTC (rev 5200)
@@ -120,7 +120,7 @@
Class<?> businessInterface = getBusinessInterface(method);
Object proxiedInstance = reference.getBusinessObject(businessInterface);
Method proxiedMethod = Reflections.lookupMethod(method, proxiedInstance);
- Object returnValue = Reflections.invokeAndWrap(proxiedMethod, proxiedInstance,
args);
+ Object returnValue = Reflections.invoke(proxiedMethod, proxiedInstance, args);
log.trace(CALL_PROXIED_METHOD, method, proxiedInstance, args, returnValue);
return returnValue;
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/Reflections.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/Reflections.java 2009-12-02 22:07:31
UTC (rev 5199)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/Reflections.java 2009-12-03 07:18:13
UTC (rev 5200)
@@ -536,8 +536,7 @@
{
try
{
- method.setAccessible(true);
- return method.invoke(instance, parameters);
+ return invoke(method, instance, parameters);
}
catch (IllegalArgumentException e)
{
@@ -553,6 +552,12 @@
}
}
+ public static Object invoke(Method method, Object instance, Object... parameters)
throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
+ {
+ ensureAccessible(method);
+ return method.invoke(instance, parameters);
+ }
+
public static Object invokeAndWrap(String methodName, Object instance, Object...
parameters)
{
Class<?>[] parameterTypes = new Class<?>[parameters.length];
Show replies by date