diff --git a/src/asciidoc/integration.adoc b/src/asciidoc/integration.adoc index 9183af48be..7e752a8cac 100644 --- a/src/asciidoc/integration.adoc +++ b/src/asciidoc/integration.adoc @@ -8506,11 +8506,11 @@ supported wrapper so the previous example can be rewritten as follows: [source,java,indent=0] [subs="verbatim,quotes"] ---- - @Cacheable(cacheNames="book", condition="#name.length() < 32", **unless="#result.hardback"**) + @Cacheable(cacheNames="book", condition="#name.length() < 32", **unless="#result?.hardback"**) public Optional findBook(String name) ---- -Note that `result` still refers to `Book` and not `Optional`. +Note that `result` still refers to `Book` and not `Optional`. Also, we are using the safe navigation operator here to accommodate the fact that the `Optional` maybe empty. [[cache-spel-context]] ===== Available caching SpEL evaluation context