You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by xu...@apache.org on 2011/05/17 08:52:52 UTC
svn commit: r1104022 -
/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodInfoUtil.java
Author: xuhaihong
Date: Tue May 17 06:52:52 2011
New Revision: 1104022
URL: http://svn.apache.org/viewvc?rev=1104022&view=rev
Log:
Fix NPE as it might not have remote but RemoteInterfaces
Modified:
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodInfoUtil.java
Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodInfoUtil.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodInfoUtil.java?rev=1104022&r1=1104021&r2=1104022&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodInfoUtil.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodInfoUtil.java Tue May 17 06:52:52 2011
@@ -41,8 +41,8 @@ import java.lang.reflect.Method;
* @version $Rev$ $Date$
*/
public class MethodInfoUtil {
-
-
+
+
/**
* Finds the nearest java.lang.reflect.Method with the given NamedMethodInfo
* Callbacks can be private so class.getMethod() cannot be used. Searching
@@ -85,7 +85,7 @@ public class MethodInfoUtil {
}
throw noSuchMethod;
- }
+ }
public static List<Method> matchingMethods(Method signature, Class clazz) {
List<Method> list = new ArrayList<Method>();
@@ -277,14 +277,18 @@ public class MethodInfoUtil {
} else if (methodInfo.methodIntf.equals("Home")) {
methods.addAll(matchingMethods(methodInfo, beanContext.getHomeInterface()));
} else if (methodInfo.methodIntf.equals("Remote")) {
- methods.addAll(matchingMethods(methodInfo, beanContext.getRemoteInterface()));
+ if (beanContext.getRemoteInterface() != null) {
+ methods.addAll(matchingMethods(methodInfo, beanContext.getRemoteInterface()));
+ }
for (Class intf : beanContext.getBusinessRemoteInterfaces()) {
methods.addAll(matchingMethods(methodInfo, intf));
}
} else if (methodInfo.methodIntf.equals("LocalHome")) {
methods.addAll(matchingMethods(methodInfo, beanContext.getLocalHomeInterface()));
} else if (methodInfo.methodIntf.equals("Local")) {
- methods.addAll(matchingMethods(methodInfo, beanContext.getLocalInterface()));
+ if (beanContext.getLocalInterface() != null) {
+ methods.addAll(matchingMethods(methodInfo, beanContext.getLocalInterface()));
+ }
for (Class intf : beanContext.getBusinessRemoteInterfaces()) {
methods.addAll(matchingMethods(methodInfo, intf));
}
@@ -356,7 +360,7 @@ public class MethodInfoUtil {
Method method = iterator.next();
if (containerMethod(method)) iterator.remove();
}
-
+
return methods;
}