Merge pull request #17916 from kioyong

* pr/17916:
  Remove unnecessary null check

Closes gh-17916
pull/17947/head
Stephane Nicoll 5 years ago
commit 28e1b90735

@ -34,7 +34,6 @@ import org.springframework.context.annotation.ConditionContext;
import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader; import org.springframework.core.io.ResourceLoader;
import org.springframework.core.io.support.EncodedResource; import org.springframework.core.io.support.EncodedResource;
@ -95,12 +94,9 @@ public class ProjectInfoAutoConfiguration {
static class GitResourceAvailableCondition extends SpringBootCondition { static class GitResourceAvailableCondition extends SpringBootCondition {
private final ResourceLoader defaultResourceLoader = new DefaultResourceLoader();
@Override @Override
public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) {
ResourceLoader loader = context.getResourceLoader(); ResourceLoader loader = context.getResourceLoader();
loader = (loader != null) ? loader : this.defaultResourceLoader;
Environment environment = context.getEnvironment(); Environment environment = context.getEnvironment();
String location = environment.getProperty("spring.info.git.location"); String location = environment.getProperty("spring.info.git.location");
if (location == null) { if (location == null) {

Loading…
Cancel
Save