Make fields final

Closes gh-33537
This commit is contained in:
Moritz Halbritter
2022-12-16 14:28:44 +01:00
parent 216d15997a
commit 725337f976
285 changed files with 445 additions and 437 deletions

View File

@@ -35,9 +35,9 @@ import org.springframework.util.StringUtils;
@ConfigurationProperties(prefix = "spring.devtools")
public class DevToolsProperties {
private Restart restart = new Restart();
private final Restart restart = new Restart();
private Livereload livereload = new Livereload();
private final Livereload livereload = new Livereload();
@NestedConfigurationProperty
private final RemoteDevToolsProperties remote = new RemoteDevToolsProperties();

View File

@@ -46,9 +46,9 @@ public class RemoteDevToolsProperties {
*/
private String secretHeaderName = DEFAULT_SECRET_HEADER_NAME;
private Restart restart = new Restart();
private final Restart restart = new Restart();
private Proxy proxy = new Proxy();
private final Proxy proxy = new Proxy();
public String getContextPath() {
return this.contextPath;

View File

@@ -39,7 +39,7 @@ public class ClassPathFileSystemWatcher implements InitializingBean, DisposableB
private final FileSystemWatcher fileSystemWatcher;
private ClassPathRestartStrategy restartStrategy;
private final ClassPathRestartStrategy restartStrategy;
private ApplicationContext applicationContext;

View File

@@ -43,7 +43,7 @@ class DirectorySnapshot {
private final Date time;
private Set<FileSnapshot> files;
private final Set<FileSnapshot> files;
/**
* Create a new {@link DirectorySnapshot} for the given directory.

View File

@@ -237,7 +237,7 @@ public class FileSystemWatcher {
private Map<File, DirectorySnapshot> directories;
private SnapshotStateRepository snapshotStateRepository;
private final SnapshotStateRepository snapshotStateRepository;
private Watcher(AtomicInteger remainingScans, List<FileChangeListener> listeners, FileFilter triggerFilter,
long pollInterval, long quietPeriod, Map<File, DirectorySnapshot> directories,

View File

@@ -139,7 +139,7 @@ public class RemoteClientConfiguration implements InitializingBean {
private final String remoteUrl;
private ExecutorService executor = Executors.newSingleThreadExecutor();
private final ExecutorService executor = Executors.newSingleThreadExecutor();
LiveReloadConfiguration(DevToolsProperties properties, ClientHttpRequestFactory clientHttpRequestFactory,
@Value("${remoteUrl}") String remoteUrl) {

View File

@@ -106,7 +106,7 @@ public class Restarter {
private boolean enabled = true;
private URL[] initialUrls;
private final URL[] initialUrls;
private final String mainClassName;

View File

@@ -113,7 +113,7 @@ public class HttpTunnelConnection implements TunnelConnection {
private boolean open = true;
private AtomicLong requestSeq = new AtomicLong();
private final AtomicLong requestSeq = new AtomicLong();
public TunnelChannel(WritableByteChannel incomingChannel, Closeable closeable) {
this.forwarder = new HttpTunnelPayloadForwarder(incomingChannel);

View File

@@ -214,7 +214,7 @@ public class HttpTunnelServer {
private boolean closed;
private AtomicLong responseSeq = new AtomicLong();
private final AtomicLong responseSeq = new AtomicLong();
private long lastHttpRequestTime;
@@ -364,7 +364,7 @@ public class HttpTunnelServer {
private final ServerHttpResponse response;
private ServerHttpAsyncRequestControl async;
private final ServerHttpAsyncRequestControl async;
private volatile boolean complete = false;

View File

@@ -31,7 +31,7 @@ import org.springframework.util.Assert;
*/
public class HttpTunnelServerHandler implements Handler {
private HttpTunnelServer server;
private final HttpTunnelServer server;
/**
* Create a new {@link HttpTunnelServerHandler} instance.