Advised a = (Advised) object; if (!a.isProxyTargetClass()) { Class<?>[] possibleInterfaces = a.getProxiedInterfaces(); for (Class<?> possibleInterface : possibleInterfaces) { try {
Advised a = (Advised) object; if (!a.isProxyTargetClass()) { Class<?>[] possibleInterfaces = a.getProxiedInterfaces(); for (Class<?> possibleInterface : possibleInterfaces) { try {
private Class<?> getTargetClass(Object targetObject) { Class<?> targetClass = targetObject.getClass(); if (AopUtils.isAopProxy(targetObject)) { targetClass = AopUtils.getTargetClass(targetObject); if (targetClass == targetObject.getClass()) { try { // Maybe a proxy with no target - e.g. gateway Class<?>[] interfaces = ((Advised) targetObject).getProxiedInterfaces(); if (interfaces.length == 1) { targetClass = interfaces[0]; } } catch (Exception e) { logger.debug("Exception trying to extract interface", e); } } } else if (org.springframework.util.ClassUtils.isCglibProxyClass(targetClass) || targetClass.getSimpleName().contains("$MockitoMock$")) { Class<?> superClass = targetObject.getClass().getSuperclass(); if (!Object.class.equals(superClass)) { targetClass = superClass; } } return targetClass; }
Class<?>[] proxiedInterfaces = ((Advised) bean).getProxiedInterfaces(); for (Class<?> iface : proxiedInterfaces) { try {
final AtomicReference<Method> targetMethod = new AtomicReference<>(); final AtomicReference<Class<?>> targetClass = new AtomicReference<>(); Class<?>[] interfaces = ((Advised) targetObject).getProxiedInterfaces(); for (Class<?> clazz : interfaces) { ReflectionUtils.doWithMethods(clazz, method1 -> {
Class<?>[] proxiedInterfaces = ((Advised) bean).getProxiedInterfaces(); for (Class<?> iface : proxiedInterfaces) { try {
Class<?>[] proxiedInterfaces = ((Advised) bean).getProxiedInterfaces(); for (Class<?> iface : proxiedInterfaces) { try {
Class<?>[] proxiedInterfaces = ((Advised) bean).getProxiedInterfaces(); for (Class<?> iface : proxiedInterfaces) { try {
private Class<?> getTargetClass(Object targetObject) { Class<?> targetClass = targetObject.getClass(); if (AopUtils.isAopProxy(targetObject)) { targetClass = AopUtils.getTargetClass(targetObject); if (targetClass == targetObject.getClass()) { try { // Maybe a proxy with no target - e.g. gateway Class<?>[] interfaces = ((Advised) targetObject).getProxiedInterfaces(); if (interfaces != null && interfaces.length == 1) { targetClass = interfaces[0]; } } catch (Exception e) { if (logger.isDebugEnabled()) { logger.debug("Exception trying to extract interface", e); } } } } else if (org.springframework.util.ClassUtils.isCglibProxyClass(targetClass) || targetClass.getSimpleName().contains("$MockitoMock$")) { Class<?> superClass = targetObject.getClass().getSuperclass(); if (!Object.class.equals(superClass)) { targetClass = superClass; } } return targetClass; }
private Class<?> getTargetClass(Object targetObject) { Class<?> targetClass = targetObject.getClass(); if (AopUtils.isAopProxy(targetObject)) { targetClass = AopUtils.getTargetClass(targetObject); if (targetClass == targetObject.getClass()) { try { // Maybe a proxy with no target - e.g. gateway Class<?>[] interfaces = ((Advised) targetObject).getProxiedInterfaces(); if (interfaces != null && interfaces.length == 1) { targetClass = interfaces[0]; } } catch (Exception e) { if (logger.isDebugEnabled()) { logger.debug("Exception trying to extract interface", e); } } } } else if (org.springframework.util.ClassUtils.isCglibProxyClass(targetClass)) { Class<?> superClass = targetObject.getClass().getSuperclass(); if (!Object.class.equals(superClass)) { targetClass = superClass; } } return targetClass; }
private Class<?> getTargetClass(Object targetObject) { Class<?> targetClass = targetObject.getClass(); if (AopUtils.isAopProxy(targetObject)) { targetClass = AopUtils.getTargetClass(targetObject); if (targetClass == targetObject.getClass()) { try { // Maybe a proxy with no target - e.g. gateway Class<?>[] interfaces = ((Advised) targetObject).getProxiedInterfaces(); if (interfaces != null && interfaces.length == 1) { targetClass = interfaces[0]; } } catch (Exception e) { if (logger.isDebugEnabled()) { logger.debug("Exception trying to extract interface", e); } } } } else if (org.springframework.util.ClassUtils.isCglibProxyClass(targetClass)) { Class<?> superClass = targetObject.getClass().getSuperclass(); if (!Object.class.equals(superClass)) { targetClass = superClass; } } return targetClass; }
final AtomicReference<Method> targetMethod = new AtomicReference<>(); final AtomicReference<Class<?>> targetClass = new AtomicReference<>(); Class<?>[] interfaces = ((Advised) targetObject).getProxiedInterfaces(); for (Class<?> clazz : interfaces) { ReflectionUtils.doWithMethods(clazz, method1 -> {
Advised a = (Advised) object; if (!a.isProxyTargetClass()) { Class<?>[] possibleInterfaces = a.getProxiedInterfaces(); for (Class<?> possibleInterface : possibleInterfaces) { try {
Advised a = (Advised) object; if (!a.isProxyTargetClass()) { Class<?>[] possibleInterfaces = a.getProxiedInterfaces(); for (Class<?> possibleInterface : possibleInterfaces) { try {