From 34902f5a021ca8e5009881edc2231d55dc378a41 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Sat, 29 Oct 2022 09:27:37 +0200 Subject: [PATCH] Fix possible type pollution in ConditionEvaluationReport See gh-32916 --- .../autoconfigure/condition/ConditionEvaluationReport.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java index 849ead280b..a7b1410dce 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,6 @@ import java.util.SortedMap; import java.util.TreeMap; import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.context.annotation.Condition; import org.springframework.context.annotation.ConditionContext; @@ -167,7 +166,7 @@ public final class ConditionEvaluationReport { * @return the {@link ConditionEvaluationReport} or {@code null} */ public static ConditionEvaluationReport find(BeanFactory beanFactory) { - if (beanFactory != null && beanFactory instanceof ConfigurableBeanFactory) { + if (beanFactory != null && beanFactory instanceof ConfigurableListableBeanFactory) { return ConditionEvaluationReport.get((ConfigurableListableBeanFactory) beanFactory); } return null;