Inject InfoContributorProperties more precisely

Closes gh-15750
This commit is contained in:
Andy Wilkinson 2019-01-21 16:56:39 +00:00
parent 530c7bee71
commit f23a0a5969
1 changed files with 5 additions and 9 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2019 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -52,12 +52,6 @@ public class InfoContributorAutoConfiguration {
*/ */
public static final int DEFAULT_ORDER = Ordered.HIGHEST_PRECEDENCE + 10; public static final int DEFAULT_ORDER = Ordered.HIGHEST_PRECEDENCE + 10;
private final InfoContributorProperties properties;
public InfoContributorAutoConfiguration(InfoContributorProperties properties) {
this.properties = properties;
}
@Bean @Bean
@ConditionalOnEnabledInfoContributor("env") @ConditionalOnEnabledInfoContributor("env")
@Order(DEFAULT_ORDER) @Order(DEFAULT_ORDER)
@ -71,8 +65,10 @@ public class InfoContributorAutoConfiguration {
@ConditionalOnSingleCandidate(GitProperties.class) @ConditionalOnSingleCandidate(GitProperties.class)
@ConditionalOnMissingBean @ConditionalOnMissingBean
@Order(DEFAULT_ORDER) @Order(DEFAULT_ORDER)
public GitInfoContributor gitInfoContributor(GitProperties gitProperties) { public GitInfoContributor gitInfoContributor(GitProperties gitProperties,
return new GitInfoContributor(gitProperties, this.properties.getGit().getMode()); InfoContributorProperties infoContributorProperties) {
return new GitInfoContributor(gitProperties,
infoContributorProperties.getGit().getMode());
} }
@Bean @Bean