-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Apply NullAbility to scripting module #10293
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
Apply NullAbility to scripting module #10293
Conversation
Related to: spring-projects#10083 Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
…ource` Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
|
|
||
| @Override | ||
| protected ScriptSource getScriptSource(Message<?> message) { | ||
| protected ScriptSource getScriptSource(@Nullable Message<?> message) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's fix ScriptExecutingMessageSource instead providing a fake message instance!
The MessageProcessor cotnract is to not accept null for the message argument.
That could be a static final property in the ScriptExecutingMessageSource with byte[0] as payload.
| private @Nullable ClassLoader beanClassLoader; | ||
|
|
||
| private BeanFactory beanFactory; | ||
| private @Nullable BeanFactory beanFactory; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both of these should be NullAway.Init
|
|
||
| public Map<String, Object> generateScriptVariables(Message<?> message) { | ||
| Map<String, Object> scriptVariables = new HashMap<String, Object>(); | ||
| public Map<String, Object> generateScriptVariables(@Nullable Message<?> message) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After fixing ScriptExecutingMessageSource many of these @Nullable on message would go away.
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Related to: #10083