Skip to content

Consider logging classcast exceptions caused by lambdas at trace level #22834

@philwebb

Description

@philwebb

See spring-projects/spring-boot#16631 for background.

Currently lambda based listeners get debug logging if they don't accept the argument type. For example:

java.lang.ClassCastException: class org.springframework.boot.context.event.ApplicationReadyEvent cannot be cast to class org.springframework.boot.devtools.classpath.ClassPathChangedEvent (org.springframework.boot.context.event.ApplicationReadyEvent and org.springframework.boot.devtools.classpath.ClassPathChangedEvent are in unnamed module of loader 'app')
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)

I wonder if trace level logging might be more appropriate.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions