Commit 16222270 authored by Dave Syer's avatar Dave Syer

Improve reporting of SpEL condition matching

parent 20bede21
...@@ -38,6 +38,7 @@ public class OnExpressionCondition extends SpringBootCondition { ...@@ -38,6 +38,7 @@ public class OnExpressionCondition extends SpringBootCondition {
String expression = (String) metadata.getAnnotationAttributes( String expression = (String) metadata.getAnnotationAttributes(
ConditionalOnExpression.class.getName()).get("value"); ConditionalOnExpression.class.getName()).get("value");
String rawExpression = expression;
if (!expression.startsWith("#{")) { if (!expression.startsWith("#{")) {
// For convenience allow user to provide bare expression with no #{} wrapper // For convenience allow user to provide bare expression with no #{} wrapper
expression = "#{" + expression + "}"; expression = "#{" + expression + "}";
...@@ -58,7 +59,7 @@ public class OnExpressionCondition extends SpringBootCondition { ...@@ -58,7 +59,7 @@ public class OnExpressionCondition extends SpringBootCondition {
if (metadata instanceof ClassMetadata) { if (metadata instanceof ClassMetadata) {
message.append(" on " + ((ClassMetadata) metadata).getClassName()); message.append(" on " + ((ClassMetadata) metadata).getClassName());
} }
message.append(": " + expression); message.append(": " + rawExpression);
return new ConditionOutcome(result, message.toString()); return new ConditionOutcome(result, message.toString());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment