Browse files

Accidentally left out part from the last commit :-(

  • Loading branch information...
1 parent faa1d81 commit b6ec4b01fe052938b94e0123266077d6d7ffc2b9 @szegedi committed Jul 26, 2012
Showing with 9 additions and 10 deletions.
  1. +9 −10 src/main/java/org/dynalang/dynalink/beans/AbstractJavaLinker.java
View
19 src/main/java/org/dynalang/dynalink/beans/AbstractJavaLinker.java
@@ -242,18 +242,17 @@ private GuardedInvocation createGuardedDynamicMethodInvocation(CallSiteDescripto
private MethodHandle getDynamicMethodInvocation(CallSiteDescriptor callSiteDescriptor,
LinkerServices linkerServices, String methodName, Map<String, DynamicMethod> methodMap)
throws ClassNotFoundException {
- DynamicMethod dynaMethod = methodMap.get(methodName);
- if(dynaMethod == null) {
- dynaMethod = getExplicitSignatureDynamicMethod(callSiteDescriptor, linkerServices, methodName, methodMap);
- if(dynaMethod == null) {
- return null;
- }
- }
- return dynaMethod.getInvocation(callSiteDescriptor, linkerServices);
+ final DynamicMethod dynaMethod = getDynamicMethod(methodName, methodMap);
+ return dynaMethod != null ? dynaMethod.getInvocation(callSiteDescriptor, linkerServices) : null;
+ }
+
+ private DynamicMethod getDynamicMethod(String methodName, Map<String, DynamicMethod> methodMap)
+ throws ClassNotFoundException {
+ final DynamicMethod dynaMethod = methodMap.get(methodName);
+ return dynaMethod != null ? dynaMethod : getExplicitSignatureDynamicMethod(methodName, methodMap);
}
- private DynamicMethod getExplicitSignatureDynamicMethod(CallSiteDescriptor callSiteDescriptor,
- LinkerServices linkerServices, String methodName, Map<String, DynamicMethod> methodsMap)
+ private DynamicMethod getExplicitSignatureDynamicMethod(String methodName, Map<String, DynamicMethod> methodsMap)
throws ClassNotFoundException {
// What's below is meant to support the "name(type, type, ...)" syntax that programmers can use in a method name
// to manually pin down an exact overloaded variant. This is not usually required, as the overloaded method

0 comments on commit b6ec4b0

Please sign in to comment.