From 84bcd0eb1e43f296bffddce1b4da000f1ca40209 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Mon, 27 Jul 2020 09:06:33 -0700 Subject: [PATCH] Improve deprecated exception message Update the exception message so that it includes the class name of the implementation. See gh-22497 --- .../boot/context/config/ConfigFileApplicationListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java index bc20ee1f2bf..cc77d3afb85 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java @@ -192,8 +192,8 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor, @Override public void onApplicationEvent(ApplicationEvent event) { - throw new IllegalStateException( - "ConfigFileApplicationListener is deprecated and can only be used as an EnvironmentPostProcessor"); + throw new IllegalStateException("ConfigFileApplicationListener [" + getClass().getName() + + "] is deprecated and can only be used as an EnvironmentPostProcessor"); } @Override