Currently, a SpringBootExceptionReporter is required to provide a constructor that takes a ConfigurableApplicationContext. This has two downsides:
- The constructor is required to take a context argument even if the context isn't needed.
- It makes it hard to replace the use of
spring.factorieswith a pluggable, potentially non-reflective, mechanism (#15704).
We should move to using ApplicationContextAware instead. It should be possible to do so without breaking any existing SpringBootExceptionReporter implementations (although I think it's unlikely that there are any outside of Boot itself).
Comment From: wilkinsona
We discussed this today and decided that we’d prefer to provide an abstraction that is specifically designed for resolving exception reporters.
Comment From: wilkinsona
It's not clear that the benefits on offer here justify the time it'll take to implement. The opportunity cost is too high at the moment.
Comment From: wilkinsona
The benefits remain unclear. Closing for now at least.