Skip to content

Commit f23a0a5

Browse files
committed
Inject InfoContributorProperties more precisely
Closes gh-15750
1 parent 530c7be commit f23a0a5

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/info/InfoContributorAutoConfiguration.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -52,12 +52,6 @@ public class InfoContributorAutoConfiguration {
5252
*/
5353
public static final int DEFAULT_ORDER = Ordered.HIGHEST_PRECEDENCE + 10;
5454

55-
private final InfoContributorProperties properties;
56-
57-
public InfoContributorAutoConfiguration(InfoContributorProperties properties) {
58-
this.properties = properties;
59-
}
60-
6155
@Bean
6256
@ConditionalOnEnabledInfoContributor("env")
6357
@Order(DEFAULT_ORDER)
@@ -71,8 +65,10 @@ public EnvironmentInfoContributor envInfoContributor(
7165
@ConditionalOnSingleCandidate(GitProperties.class)
7266
@ConditionalOnMissingBean
7367
@Order(DEFAULT_ORDER)
74-
public GitInfoContributor gitInfoContributor(GitProperties gitProperties) {
75-
return new GitInfoContributor(gitProperties, this.properties.getGit().getMode());
68+
public GitInfoContributor gitInfoContributor(GitProperties gitProperties,
69+
InfoContributorProperties infoContributorProperties) {
70+
return new GitInfoContributor(gitProperties,
71+
infoContributorProperties.getGit().getMode());
7672
}
7773

7874
@Bean

0 commit comments

Comments
 (0)