Merge branch 'master' into 2.0.x
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
|
||||
package org.springframework.cloud.context.scope;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
@@ -453,9 +454,10 @@ public class GenericScope implements Scope, BeanFactoryPostProcessor,
|
||||
|
||||
@Override
|
||||
public Object invoke(MethodInvocation invocation) throws Throwable {
|
||||
if (AopUtils.isEqualsMethod(invocation.getMethod())
|
||||
|| AopUtils.isToStringMethod(invocation.getMethod())
|
||||
|| AopUtils.isHashCodeMethod(invocation.getMethod())) {
|
||||
Method method = invocation.getMethod();
|
||||
if (AopUtils.isEqualsMethod(method)
|
||||
|| AopUtils.isToStringMethod(method)
|
||||
|| AopUtils.isHashCodeMethod(method)) {
|
||||
return invocation.proceed();
|
||||
}
|
||||
Object proxy = getObject();
|
||||
@@ -464,7 +466,8 @@ public class GenericScope implements Scope, BeanFactoryPostProcessor,
|
||||
try {
|
||||
if (proxy instanceof Advised) {
|
||||
Advised advised = (Advised) proxy;
|
||||
return ReflectionUtils.invokeMethod(invocation.getMethod(),
|
||||
ReflectionUtils.makeAccessible(method);
|
||||
return ReflectionUtils.invokeMethod(method,
|
||||
advised.getTargetSource().getTarget(),
|
||||
invocation.getArguments());
|
||||
}
|
||||
|
||||
@@ -161,7 +161,8 @@ public class RefreshScopeConfigurationTests {
|
||||
String message;
|
||||
|
||||
@RequestMapping("/")
|
||||
public String hello() {
|
||||
// Deliberately use package scope
|
||||
String hello() {
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user