See https://github.com/spring-projects/spring-boot/pull/12153#issuecomment-367364125. It makes the code cleaner as well I think.