/** * Following AspectJ semantics, if a returning clause was specified, then the * advice is only invoked if the returned value is an instance of the given * returning type and generic type parameters, if any, match the assignment * rules. If the returning type is Object, the advice is *always* invoked. * @param returnValue the return value of the target method * @return whether to invoke the advice method for the given return value */ private boolean shouldInvokeOnReturnValueOf(Method method, @Nullable Object returnValue) { Class<?> type = getDiscoveredReturningType(); Type genericType = getDiscoveredReturningGenericType(); // If we aren't dealing with a raw type, check if generic parameters are assignable. return (matchesReturnValue(type, method, returnValue) && (genericType == null || genericType == type || TypeUtils.isAssignable(genericType, method.getGenericReturnType()))); }
/** * Following AspectJ semantics, if a returning clause was specified, then the * advice is only invoked if the returned value is an instance of the given * returning type and generic type parameters, if any, match the assignment * rules. If the returning type is Object, the advice is *always* invoked. * @param returnValue the return value of the target method * @return whether to invoke the advice method for the given return value */ private boolean shouldInvokeOnReturnValueOf(Method method, @Nullable Object returnValue) { Class<?> type = getDiscoveredReturningType(); Type genericType = getDiscoveredReturningGenericType(); // If we aren't dealing with a raw type, check if generic parameters are assignable. return (matchesReturnValue(type, method, returnValue) && (genericType == null || genericType == type || TypeUtils.isAssignable(genericType, method.getGenericReturnType()))); }
/** * Following AspectJ semantics, if a returning clause was specified, then the * advice is only invoked if the returned value is an instance of the given * returning type and generic type parameters, if any, match the assignment * rules. If the returning type is Object, the advice is *always* invoked. * @param returnValue the return value of the target method * @return whether to invoke the advice method for the given return value */ private boolean shouldInvokeOnReturnValueOf(Method method, Object returnValue) { Class<?> type = getDiscoveredReturningType(); Type genericType = getDiscoveredReturningGenericType(); // If we aren't dealing with a raw type, check if generic parameters are assignable. return (matchesReturnValue(type, method, returnValue) && (genericType == null || genericType == type || TypeUtils.isAssignable(genericType, method.getGenericReturnType()))); }