In this line( https://github.com/spring-projects/spring-boot/blob/47516b50c39bd6ea924a1f6720ce6d4a71088651/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/tomcat/TomcatMetricsBinder.java#L72 ), it directly return the context.getManager() without check if the context is null or not. So is it because it will return Context in all the cases?

Comment From: snicoll

@liulixiang1988 Yes, but considering the logic of the related method, an additional if check won't hurt.