From 82bf60400a8765502e172d38dc808b5e7bb505c7 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Fri, 19 Dec 2014 14:52:56 -0800 Subject: [PATCH] Fix OnPropertyCondition no havingValue message See gh-2193 --- .../boot/autoconfigure/condition/OnPropertyCondition.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 122e6715caa..cd8822d218c 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 @@ -87,7 +87,7 @@ class OnPropertyCondition extends SpringBootCondition { + expandNames(prefix, missingProperties) + " "); } if (!nonMatchingProperties.isEmpty()) { - String expected = havingValue == null ? "!false" : havingValue; + String expected = StringUtils.hasLength(havingValue) ? havingValue : "!false"; message.append("expected '").append(expected).append("' for properties ") .append(expandNames(prefix, nonMatchingProperties)); }