Move to constructor injection in simple configuration classes
This commit updates "simple" configuration classes to use constructor injection. Simple means that there are no optional dependencies (@Autowired(required=false) is not used), and none of the dependencies use generics. Configuration classes that are not simple will be updated in a second pass once https://jira.spring.io/browse/SPR-14015 has been fixed. See gh-5306
This commit is contained in:
@@ -28,7 +28,6 @@ import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.devtools.filewatch.ChangedFile;
|
||||
import org.springframework.boot.devtools.filewatch.FileSystemWatcher;
|
||||
import org.springframework.boot.devtools.filewatch.FileSystemWatcherFactory;
|
||||
@@ -92,8 +91,11 @@ public class ClassPathFileSystemWatcherTests {
|
||||
@Configuration
|
||||
public static class Config {
|
||||
|
||||
@Autowired
|
||||
public Environment environment;
|
||||
public final Environment environment;
|
||||
|
||||
public Config(Environment environment) {
|
||||
this.environment = environment;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ClassPathFileSystemWatcher watcher() {
|
||||
|
||||
Reference in New Issue
Block a user