@Nullable private JCacheOperation<?> computeCacheOperation(Method method, @Nullable Class<?> targetClass) { // Don't allow no-public methods as required. if (allowPublicMethodsOnly() && !Modifier.isPublic(method.getModifiers())) { return null; } // The method may be on an interface, but we need attributes from the target class. // If the target class is null, the method will be unchanged. Method specificMethod = AopUtils.getMostSpecificMethod(method, targetClass); // First try is the method in the target class. JCacheOperation<?> operation = findCacheOperation(specificMethod, targetClass); if (operation != null) { return operation; } if (specificMethod != method) { // Fallback is to look at the original method. operation = findCacheOperation(method, targetClass); if (operation != null) { return operation; } } return null; }
@Nullable private JCacheOperation<?> computeCacheOperation(Method method, @Nullable Class<?> targetClass) { // Don't allow no-public methods as required. if (allowPublicMethodsOnly() && !Modifier.isPublic(method.getModifiers())) { return null; } // The method may be on an interface, but we need attributes from the target class. // If the target class is null, the method will be unchanged. Method specificMethod = AopUtils.getMostSpecificMethod(method, targetClass); // First try is the method in the target class. JCacheOperation<?> operation = findCacheOperation(specificMethod, targetClass); if (operation != null) { return operation; } if (specificMethod != method) { // Fallback is to look at the original method. operation = findCacheOperation(method, targetClass); if (operation != null) { return operation; } } return null; }
private JCacheOperation<?> computeCacheOperation(Method method, Class<?> targetClass) { // Don't allow no-public methods as required. if (allowPublicMethodsOnly() && !Modifier.isPublic(method.getModifiers())) { return null; } // The method may be on an interface, but we need attributes from the target class. // If the target class is null, the method will be unchanged. Method specificMethod = ClassUtils.getMostSpecificMethod(method, targetClass); // If we are dealing with method with generic parameters, find the original method. specificMethod = BridgeMethodResolver.findBridgedMethod(specificMethod); // First try is the method in the target class. JCacheOperation<?> operation = findCacheOperation(specificMethod, targetClass); if (operation != null) { return operation; } if (specificMethod != method) { // Fallback is to look at the original method. operation = findCacheOperation(method, targetClass); if (operation != null) { return operation; } } return null; }