Skip to content

Conversation

ngocnhan-tran1996
Copy link
Contributor

Related to: #10083

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>
@@ -137,7 +137,7 @@ public void setCompilerConfiguration(CompilerConfiguration compilerConfiguration
}

@Override
protected ScriptSource getScriptSource(Message<?> message) {
protected ScriptSource getScriptSource(@Nullable Message<?> message) {
Copy link
Member

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 BeanFactory beanFactory;
private @Nullable BeanFactory beanFactory;
Copy link
Member

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

@@ -44,8 +46,8 @@ public DefaultScriptVariableGenerator(Map<String, Object> variableMap) {
this.variableMap = variableMap;
}

public Map<String, Object> generateScriptVariables(Message<?> message) {
Map<String, Object> scriptVariables = new HashMap<String, Object>();
public Map<String, Object> generateScriptVariables(@Nullable Message<?> message) {
Copy link
Member

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>
@artembilan artembilan merged commit 0254b34 into spring-projects:main Aug 11, 2025
3 checks passed
@ngocnhan-tran1996 ngocnhan-tran1996 deleted the gh-10083-scripting-module branch August 12, 2025 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants