Fix nullability warnings and javadoc-triggered package cycles

This commit is contained in:
Juergen Hoeller
2019-07-17 22:34:07 +02:00
parent 56eadff34f
commit 94e3210ae7
10 changed files with 48 additions and 38 deletions

View File

@@ -124,6 +124,7 @@ public class ScriptTemplateView extends AbstractUrlBasedView {
/**
* See {@link ScriptTemplateConfigurer#setEngineSupplier(Supplier)} documentation.
* @since 5.2
*/
public void setEngineSupplier(Supplier<ScriptEngine> engineSupplier) {
this.engineSupplier = engineSupplier;
@@ -276,8 +277,9 @@ public class ScriptTemplateView extends AbstractUrlBasedView {
}
private ScriptEngine createEngineFromSupplier() {
Assert.state(this.engineSupplier != null, "No engine supplier available");
ScriptEngine engine = this.engineSupplier.get();
if (this.renderFunction != null && engine != null) {
if (this.renderFunction != null) {
Assert.isInstanceOf(Invocable.class, engine,
"ScriptEngine must implement Invocable when 'renderFunction' is specified");
}