From b00f98fccf11bdcf8353f47fecb2933d556969c4 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 12 Dec 2018 13:04:51 +0100 Subject: [PATCH] Revised SimpleEvaluationContext example Issue: SPR-17581 --- src/asciidoc/core-expressions.adoc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/asciidoc/core-expressions.adoc b/src/asciidoc/core-expressions.adoc index bb68284dc0..20eeab5c21 100644 --- a/src/asciidoc/core-expressions.adoc +++ b/src/asciidoc/core-expressions.adoc @@ -232,11 +232,10 @@ being placed in it. A simple example: Simple simple = new Simple(); simple.booleanList.add(true); - SimpleEvaluationContext context = SimpleEvaluationContext().create(); - - // false is passed in here as a string. SpEL and the conversion service will - // correctly recognize that it needs to be a Boolean and convert it + EvaluationContext context = SimpleEvaluationContext.forReadOnlyDataBinding().build(); + // "false" is passed in here as a String. SpEL and the conversion service + // will recognize that it needs to be a Boolean and convert it accordingly. parser.parseExpression("booleanList[0]").setValue(context, simple, "false"); // b will be false