Skip to content

Commit 5d656d3

Browse files
author
songjialin
committed
代理工厂
1 parent 487830f commit 5d656d3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.github.yungyu16.spring</groupId>
77
<artifactId>spring-boot-starter-proxy</artifactId>
8-
<version>1.1.0</version>
8+
<version>1.1.1</version>
99
<name>${project.artifactId}</name>
1010
<description>将不可实例化的Interface动态代理后注册到Spring容器以便IOC,用于便捷的生成Local Stub</description>
1111
<url>https://github.com/yungyu16/version-maven-plugin.git</url>

src/main/java/com/github/yungyu16/spring/stub/StubBeanPostProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.springframework.beans.factory.BeanFactory;
88
import org.springframework.beans.factory.BeanFactoryAware;
99
import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter;
10-
import org.springframework.core.annotation.AnnotatedElementUtils;
10+
import org.springframework.core.annotation.AnnotationUtils;
1111

1212
/**
1313
* CreatedDate: 2020/11/24
@@ -19,7 +19,7 @@ public class StubBeanPostProcessor extends InstantiationAwareBeanPostProcessorAd
1919
@Override
2020
@SuppressWarnings("all")
2121
public Object postProcessBeforeInstantiation(Class<?> type, String name) throws BeansException {
22-
ProxyStub proxyStub = AnnotatedElementUtils.getMergedAnnotation(type, ProxyStub.class);
22+
ProxyStub proxyStub = AnnotationUtils.getAnnotation(type, ProxyStub.class);
2323
if (proxyStub == null) {
2424
return null;
2525
}

src/main/java/com/github/yungyu16/spring/stub/proxy/DefaultStubProxyFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class DefaultStubProxyFactory implements StubProxyFactory, BeanFactoryAwa
2828
public <T> T createProxy(Class<T> stubInterface, ProxyStub stubAnnotation) {
2929
AbstractInvocationDispatcher invocationDispatcher = getInvocationDispatcher(stubInterface, stubAnnotation);
3030
Class annotationType = invocationDispatcher.getAnnotationType();
31-
Annotation annotation = AnnotationUtils.findAnnotation(stubInterface, annotationType);
31+
Annotation annotation = AnnotationUtils.getAnnotation(stubInterface, annotationType);
3232
AbstractInvocationDispatcher.StubProxyContext<?> stubProxyContext = AbstractInvocationDispatcher.StubProxyContext.valueOf(stubInterface, annotation);
3333
return (T) Proxy.newProxyInstance(ClassUtils.getDefaultClassLoader(), collectProxyInterface(stubInterface), StubInvocationHandler.newInstance(stubProxyContext, invocationDispatcher));
3434
}

0 commit comments

Comments
 (0)