Skip to content

Conversation

@laijianbin
Copy link
Contributor

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [SCB-XXX] Fixes bug in ApproximateQuantiles, where you replace SCB-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean install to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 86.193% when pulling 4500a3d on laijianbin:null into 6aadae0 on apache:master.

// aop后,新的实例的父类可能是原class,也可能只是个proxy,父类不是原class
// 所以,需要先取出原class,再取标注
Class<?> beanCls = BeanUtils.getImplClassFromBean(bean);
if(beanCls == null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when will this happened?
if happened, just ignore it Silently?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

org.springframework.aop.TargetClassAware.getTargetClass(),this method return the target Class, or null if not known. more detail, reference https://issues.apache.org/jira/browse/SCB-737?filter=-1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if got null, maybe will cause to lost schema definition
so need to print a warn log at least.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a example or test case showing how this will happen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liubao68 ,you can reference this blog http://3ms.huawei.com/km/groups/3618383/blogs/details/5589591
To resolve this problem, I just need to add a warn log will be ok?

Copy link
Contributor

@liubao68 liubao68 Oct 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, fine. When users defined bean using EnableBatchProcessing, they will not set bean implementation class. So beans annotated with @RestSchema should not do this. In this situation, I think we do not need add a log just like we do not add a log for others beans not annotated with @RestSchema

@laijianbin laijianbin changed the title [SCB-718]Avoid null point exception [SCB-737]Avoid null point exception Oct 8, 2018
@liubao68 liubao68 merged commit ad72e23 into apache:master Oct 11, 2018
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

Successfully merging this pull request may close these issues.

4 participants