Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

参数注解在使用cglib的时候有bug? #26

Open
shaoyihe opened this issue Oct 15, 2015 · 0 comments
Open

参数注解在使用cglib的时候有bug? #26

shaoyihe opened this issue Oct 15, 2015 · 0 comments

Comments

@shaoyihe
Copy link

如果中间又有一个空类,就会无法读取参数注解。

public Parent{
 public void execute(Context context, @Param("id") String id) {

  }
 }

//aop增强
public Child extends Parent{

}

分析原因是com.alibaba.citrus.service.dataresolver.impl.DataResolverServiceImpl.getAnnotatedMethod(Method)中有bug,

private Method getAnnotatedMethod(Method method) {
Method annotatedMethod = method;
//这里的判断annotatedMethod 可以为空,因为它的父类可以不回空,例如Child 
    while (annotatedMethod != null && !hasAnnotations(annotatedMethod.getParameterAnnotations())) {
        annotatedMethod = getOverridenMethod(annotatedMethod);
    }
 return annotatedMethod == null ? method : annotatedMethod;
} 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant