Minor polishing

- Refactor conditional clause
This commit is contained in:
Ilayaperumal Gopinathan
2017-03-30 11:55:31 +05:30
parent ab9cf91803
commit 6592c1a8cd

View File

@@ -278,10 +278,8 @@ public class StreamListenerAnnotationBeanPostProcessor
break;
}
}
if (arguments[parameterIndex] == null) {
if (parameterType.isAssignableFrom(targetBean.getClass())) {
arguments[parameterIndex] = targetBean;
}
if (arguments[parameterIndex] == null && parameterType.isAssignableFrom(targetBean.getClass())) {
arguments[parameterIndex] = targetBean;
}
Assert.notNull(arguments[parameterIndex], "Cannot convert argument " + parameterIndex + " of " + method
+ "from " + targetBean.getClass() + " to " + parameterType);