@Override protected Constructor<?> getConstructor(Class<?> clazz, Object[] args) { String key = getConstructorKey(clazz, args); Constructor<?> cached = constructorsByClassAndArgs.get(key); if (cached == noConstructor) return null; if (cached != null) return cached; Constructor<?> constructor = handleConstructorCacheMiss(clazz, args); if (constructor == null) { constructorsByClassAndArgs.put(key, noConstructor); } else { constructorsByClassAndArgs.put(key, constructor); } return constructor; }
@Override protected Class<?> getClass(String className) { Class<?> cached = classCache.get(className); if (cached == NotExisting.class) return null; if (cached != null) return cached; Class<?> k = handleClassCacheMiss(className); if (k == null) { classCache.put(className, NotExisting.class); } else { classCache.put(className, k); } return k; }
@Override protected Method findMatchingMethod(String methodName, Object instance, Object... args) { MethodKey key = new MethodKey(instance.getClass(), methodName, args.length); Method cached = methodsByNameAndArgs.get(key); if (cached == noMethod) return null; if (cached != null) return cached; Method method = handleMethodCacheMiss(methodName, instance, args); if (method == null) { methodsByNameAndArgs.put(key, noMethod); } else { methodsByNameAndArgs.put(key, method); } return method; }
@Override protected Method findMatchingMethod(String methodName, Object instance, Object... args) { MethodKey key = new MethodKey(instance.getClass(), methodName, args.length); Method cached = methodsByNameAndArgs.get(key); if (cached == noMethod) return null; if (cached != null) return cached; Method method = handleMethodCacheMiss(methodName, instance, args); if (method == null) { methodsByNameAndArgs.put(key, noMethod); } else { methodsByNameAndArgs.put(key, method); } return method; }
@Override protected Constructor<?> getConstructor(Class<?> clazz, Object[] args) { String key = getConstructorKey(clazz, args); Constructor<?> cached = constructorsByClassAndArgs.get(key); if (cached == noConstructor) return null; if (cached != null) return cached; Constructor<?> constructor = handleConstructorCacheMiss(clazz, args); if (constructor == null) { constructorsByClassAndArgs.put(key, noConstructor); } else { constructorsByClassAndArgs.put(key, constructor); } return constructor; }
@Override protected Class<?> getClass(String className) { Class<?> cached = classCache.get(className); if (cached == NotExisting.class) return null; if (cached != null) return cached; Class<?> k = handleClassCacheMiss(className); if (k == null) { classCache.put(className, NotExisting.class); } else { classCache.put(className, k); } return k; }