@ -27,6 +27,7 @@ import org.springframework.boot.context.event.ApplicationReadyEvent;
@@ -27,6 +27,7 @@ import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationContext ;
import org.springframework.context.ApplicationContextAware ;
import org.springframework.context.ApplicationListener ;
import org.springframework.util.Assert ;
/ * *
* An { @link ApplicationListener } that logs the delta of condition evaluation across
@ -50,7 +51,8 @@ class ConditionEvaluationDeltaLoggingListener
@@ -50,7 +51,8 @@ class ConditionEvaluationDeltaLoggingListener
return ;
}
ConditionEvaluationReport report = event . getApplicationContext ( ) . getBean ( ConditionEvaluationReport . class ) ;
ConditionEvaluationReport previousReport = previousReports . get ( event . getApplicationContext ( ) . getId ( ) ) ;
String contextId = event . getApplicationContext ( ) . getId ( ) ;
ConditionEvaluationReport previousReport = previousReports . get ( contextId ) ;
if ( previousReport ! = null ) {
ConditionEvaluationReport delta = report . getDelta ( previousReport ) ;
if ( ! delta . getConditionAndOutcomesBySource ( ) . isEmpty ( ) | | ! delta . getExclusions ( ) . isEmpty ( )
@ -64,7 +66,8 @@ class ConditionEvaluationDeltaLoggingListener
@@ -64,7 +66,8 @@ class ConditionEvaluationDeltaLoggingListener
logger . info ( "Condition evaluation unchanged" ) ;
}
}
previousReports . put ( event . getApplicationContext ( ) . getId ( ) , report ) ;
Assert . state ( contextId ! = null , "'contextId' must not be null" ) ;
previousReports . put ( contextId , report ) ;
}
@Override