|
57 | 57 | import org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite;
|
58 | 58 | import org.codehaus.groovy.runtime.callsite.StaticMetaClassSite;
|
59 | 59 | import org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite;
|
60 |
| -import org.codehaus.groovy.runtime.memoize.LRUCache; |
61 | 60 | import org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod;
|
62 | 61 | import org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl;
|
63 | 62 | import org.codehaus.groovy.runtime.metaclass.MetaMethodIndex;
|
@@ -3166,28 +3165,9 @@ private static void filterMatchingMethodForCategory(FastArray list, MetaMethod m
|
3166 | 3165 | list.add(method);
|
3167 | 3166 | }
|
3168 | 3167 |
|
3169 |
| - private static final MetaMethod NULL_METAMETHOD = new MetaMethod() { |
3170 |
| - @Override |
3171 |
| - public int getModifiers() { return 0; } |
3172 |
| - @Override |
3173 |
| - public String getName() { return ""; } |
3174 |
| - @Override |
3175 |
| - public Class getReturnType() { return null; } |
3176 |
| - @Override |
3177 |
| - public CachedClass getDeclaringClass() { return null; } |
3178 |
| - @Override |
3179 |
| - public Object invoke(Object object, Object[] arguments) { return null; } |
3180 |
| - }; |
3181 |
| - private static final LRUCache<Method, MetaMethod> METHOD_CACHE = new LRUCache<>(512); |
3182 | 3168 | private MetaMethod findMethod(Method method) {
|
3183 |
| - MetaMethod result = METHOD_CACHE.getAndPut(method, m -> { |
3184 |
| - CachedMethod cachedMethod = CachedMethod.find(m); |
3185 |
| - MetaMethod metaMethod = cachedMethod == null ? null : findMethod(cachedMethod); |
3186 |
| - if (metaMethod == null) metaMethod = NULL_METAMETHOD; |
3187 |
| - return metaMethod; |
3188 |
| - }); |
3189 |
| - if (result == NULL_METAMETHOD) result = null; |
3190 |
| - return result; |
| 3169 | + CachedMethod cachedMethod = CachedMethod.find(method); |
| 3170 | + return cachedMethod == null ? null : findMethod(cachedMethod); |
3191 | 3171 | }
|
3192 | 3172 |
|
3193 | 3173 | /**
|
|
0 commit comments