From cc04621dc272ac11af954305421729766a819851 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 13 Oct 2016 12:27:47 +0100 Subject: [PATCH 1/2] Assign an order to OnResourceCondition Closes gh-7145 --- .../boot/autoconfigure/condition/OnResourceCondition.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnResourceCondition.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnResourceCondition.java index 40fd970e0b..b36627dd1b 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnResourceCondition.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnResourceCondition.java @@ -22,6 +22,8 @@ import java.util.List; import org.springframework.boot.autoconfigure.condition.ConditionMessage.Style; import org.springframework.context.annotation.Condition; import org.springframework.context.annotation.ConditionContext; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.io.ResourceLoader; import org.springframework.core.type.AnnotatedTypeMetadata; @@ -34,6 +36,7 @@ import org.springframework.util.MultiValueMap; * @author Dave Syer * @see ConditionalOnResource */ +@Order(Ordered.HIGHEST_PRECEDENCE + 20) class OnResourceCondition extends SpringBootCondition { private final ResourceLoader defaultResourceLoader = new DefaultResourceLoader(); From 7968c6b548d7efb9ed22c8e4f152b2c5160ffc71 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 13 Oct 2016 12:29:35 +0100 Subject: [PATCH 2/2] Assign on order to OnPropertyCondition Closes gh-7144 --- .../boot/autoconfigure/condition/OnPropertyCondition.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnPropertyCondition.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnPropertyCondition.java index ed77ccedd4..e2d5176334 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnPropertyCondition.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnPropertyCondition.java @@ -26,7 +26,9 @@ import org.springframework.boot.autoconfigure.condition.ConditionMessage.Style; import org.springframework.boot.bind.RelaxedPropertyResolver; import org.springframework.context.annotation.Condition; import org.springframework.context.annotation.ConditionContext; +import org.springframework.core.Ordered; import org.springframework.core.annotation.AnnotationAttributes; +import org.springframework.core.annotation.Order; import org.springframework.core.env.PropertyResolver; import org.springframework.core.type.AnnotatedTypeMetadata; import org.springframework.util.Assert; @@ -43,6 +45,7 @@ import org.springframework.util.StringUtils; * @since 1.1.0 * @see ConditionalOnProperty */ +@Order(Ordered.HIGHEST_PRECEDENCE + 40) class OnPropertyCondition extends SpringBootCondition { @Override