Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Kotlin Any to be a nullable type in AOP refdoc examples #31015

Conversation

pstrsr
Copy link
Contributor

@pstrsr pstrsr commented Aug 9, 2023

When using "Any" as return type, as suggested by the documentation example, in a @Around-Aspect calls to void methods with pjp.proceed() will fail, with a cryptic NullPointerException error:

java.lang.NullPointerException: pjp.proceed() must not be null

I have made an example project to showcase this behavior:
spring-aop-docs-bug

When using "Any" calls to void methods will fail, with a cryptic error message.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Aug 9, 2023
@sdeleuze sdeleuze self-assigned this Aug 10, 2023
@sdeleuze sdeleuze added type: documentation A documentation task theme: kotlin An issue related to Kotlin support and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Aug 10, 2023
@sdeleuze sdeleuze added this to the 6.0.12 milestone Aug 10, 2023
@sdeleuze sdeleuze changed the title Changed Kotlin Any to be a nullable type in aop doc examples Change Kotlin Any to be a nullable type in AOP refdoc examples Aug 10, 2023
sdeleuze pushed a commit to sdeleuze/spring-framework that referenced this pull request Aug 10, 2023
This commit changes Any to Any? in ProceedingJoinPoint
Kotlin examples in order to be consistent with Java
and avoid a "NullPointerException: pjp.proceed() must
not be null" error.

See spring-projectsgh-31015
@sdeleuze sdeleuze closed this in 0c15be0 Aug 10, 2023
@sdeleuze
Copy link
Contributor

Merged with additional similar changes, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: kotlin An issue related to Kotlin support type: documentation A documentation task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants