artembilan/spring-integration — comment on commit 48993a50a44d85edc299eedf431a8bd6f63d3b63
File: spring-integration-groovy/src/main/java/org/springframework/integration/groovy/VariableBindingGroovyObjectCustomizerDecorator.java line 53
By garyrussell:

Is it "safe" to replace the existing Binding here? What if there are other bindings already in place (is that even possible)?

Perhaps need to merge?

In any case, even if it's safe, we should probably refactor as...

Binding binding = (Binding) variables.remove("binding");
if (binding != null) {
((Script) goo).setBinding(binding);
} else {
binding = ((Script) goo).getBinding();
}