Browse files

Fixes for issues #11,12,13 contributed by tstockwell.

	modified:   src/kilim/mirrors/CachedClassMirrors.java
	modified:   src/kilim/mirrors/Detector.java
  • Loading branch information...
1 parent 42c65b3 commit 125d6f88cd37a3a396fd36d3a1b18e2e4a70c0f7 @sriram-srinivasan sriram-srinivasan committed Oct 28, 2012
Showing with 10 additions and 5 deletions.
  1. +2 −1 src/kilim/mirrors/CachedClassMirrors.java
  2. +8 −4 src/kilim/mirrors/Detector.java
View
3 src/kilim/mirrors/CachedClassMirrors.java
@@ -105,7 +105,8 @@ public int hashCode() {
@Override
public MethodMirror[] getDeclaredMethods() {
- return declaredMethods;
+ return (declaredMethods == null) ?
+ new MethodMirror[0] : declaredMethods;
}
@Override
View
12 src/kilim/mirrors/Detector.java
@@ -118,10 +118,14 @@ private MethodMirror findPausableMethod(String className, String methodName, Str
if (cl == null) return null;
for (MethodMirror om : cl.getDeclaredMethods()) {
- if (om.getName().equals(methodName) && om.getMethodDescriptor().equals(desc)) {
- if (om.isBridge())
- continue;
- return om;
+ if (om.getName().equals(methodName)) {
+ // when comparing descriptors only compare arguments, not return types
+ String omDesc= om.getMethodDescriptor();
+
+ if (omDesc.substring(0,omDesc.indexOf(")")).equals(desc.substring(0,desc.indexOf(")")))) {
+ if (om.isBridge()) continue;
+ return om;
+ }
}
}

0 comments on commit 125d6f8

Please sign in to comment.