From 12bfca56d617f935e0a53760bf18f300eba8a430 Mon Sep 17 00:00:00 2001 From: LiangYong <517219382@qq.com> Date: Tue, 20 Aug 2019 10:46:13 +0800 Subject: [PATCH] Remove unnecessary null check See gh-17916 --- .../boot/autoconfigure/info/ProjectInfoAutoConfiguration.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfiguration.java index 2d0148311f..044f7c3f1b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfiguration.java @@ -34,7 +34,6 @@ import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; -import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; import org.springframework.core.io.support.EncodedResource; @@ -95,12 +94,9 @@ public class ProjectInfoAutoConfiguration { static class GitResourceAvailableCondition extends SpringBootCondition { - private final ResourceLoader defaultResourceLoader = new DefaultResourceLoader(); - @Override public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { ResourceLoader loader = context.getResourceLoader(); - loader = (loader != null) ? loader : this.defaultResourceLoader; Environment environment = context.getEnvironment(); String location = environment.getProperty("spring.info.git.location"); if (location == null) {