From 2a0d4338ec349f56acae2361c35e09dcef101dba Mon Sep 17 00:00:00 2001 From: AlmostFamiliar Date: Tue, 8 Aug 2023 14:39:34 +0200 Subject: [PATCH] Changed Any to be a nullable type When using "Any" calls to void methods will fail, with a cryptic error message. --- .../modules/ROOT/pages/core/aop/ataspectj/advice.adoc | 6 +++--- .../modules/ROOT/pages/core/aop/ataspectj/example.adoc | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/framework-docs/modules/ROOT/pages/core/aop/ataspectj/advice.adoc b/framework-docs/modules/ROOT/pages/core/aop/ataspectj/advice.adoc index 94adb816964c..30f2bc8dc099 100644 --- a/framework-docs/modules/ROOT/pages/core/aop/ataspectj/advice.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop/ataspectj/advice.adoc @@ -176,7 +176,7 @@ Kotlin:: @AfterReturning( pointcut = "execution(* com.xyz.dao.*.*(..))", returning = "retVal") - fun doAccessCheck(retVal: Any) { + fun doAccessCheck(retVal: Any?) { // ... } } @@ -448,7 +448,7 @@ Kotlin:: class AroundExample { @Around("execution(* com.xyz..service.*.*(..))") - fun doBasicProfiling(pjp: ProceedingJoinPoint): Any { + fun doBasicProfiling(pjp: ProceedingJoinPoint): Any? { // start stopwatch val retVal = pjp.proceed() // stop stopwatch @@ -888,7 +888,7 @@ Kotlin:: "com.xyz.CommonPointcuts.inDataAccessLayer() && " + "args(accountHolderNamePattern)") // <1> fun preProcessQueryPattern(pjp: ProceedingJoinPoint, - accountHolderNamePattern: String): Any { + accountHolderNamePattern: String): Any? { val newPattern = preProcess(accountHolderNamePattern) return pjp.proceed(arrayOf(newPattern)) } diff --git a/framework-docs/modules/ROOT/pages/core/aop/ataspectj/example.adoc b/framework-docs/modules/ROOT/pages/core/aop/ataspectj/example.adoc index 03cb9d102e9f..896086c9282c 100644 --- a/framework-docs/modules/ROOT/pages/core/aop/ataspectj/example.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop/ataspectj/example.adoc @@ -85,7 +85,7 @@ Kotlin:: } @Around("com.xyz.CommonPointcuts.businessService()") // <1> - fun doConcurrentOperation(pjp: ProceedingJoinPoint): Any { + fun doConcurrentOperation(pjp: ProceedingJoinPoint): Any? { var numAttempts = 0 var lockFailureException: PessimisticLockingFailureException do { @@ -173,7 +173,7 @@ Kotlin:: ---- @Around("execution(* com.xyz..service.*.*(..)) && " + "@annotation(com.xyz.service.Idempotent)") - fun doConcurrentOperation(pjp: ProceedingJoinPoint): Any { + fun doConcurrentOperation(pjp: ProceedingJoinPoint): Any? { // ... } ----