Make fields final
Closes gh-33537
This commit is contained in:
@@ -71,7 +71,7 @@ public class ImagePackager extends Packager {
|
||||
*/
|
||||
private static class DelegatingJarWriter extends AbstractJarWriter {
|
||||
|
||||
private BiConsumer<ZipEntry, EntryWriter> exporter;
|
||||
private final BiConsumer<ZipEntry, EntryWriter> exporter;
|
||||
|
||||
DelegatingJarWriter(BiConsumer<ZipEntry, EntryWriter> exporter) {
|
||||
this.exporter = exporter;
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public class JavaExecutable {
|
||||
|
||||
private File file;
|
||||
private final File file;
|
||||
|
||||
public JavaExecutable() {
|
||||
String javaHome = System.getProperty("java.home");
|
||||
|
||||
@@ -37,7 +37,7 @@ public class RunProcess {
|
||||
|
||||
private static final long JUST_ENDED_LIMIT = 500;
|
||||
|
||||
private File workingDirectory;
|
||||
private final File workingDirectory;
|
||||
|
||||
private final String[] command;
|
||||
|
||||
|
||||
@@ -722,9 +722,9 @@ abstract class AbstractPackagerTests<P extends Packager> {
|
||||
|
||||
private static final Layer DEFAULT_LAYER = new Layer("default");
|
||||
|
||||
private Set<Layer> layers = new LinkedHashSet<>();
|
||||
private final Set<Layer> layers = new LinkedHashSet<>();
|
||||
|
||||
private Map<String, Layer> libraries = new HashMap<>();
|
||||
private final Map<String, Layer> libraries = new HashMap<>();
|
||||
|
||||
TestLayers() {
|
||||
this.layers.add(DEFAULT_LAYER);
|
||||
|
||||
@@ -30,7 +30,7 @@ import static org.mockito.Mockito.mock;
|
||||
*/
|
||||
class ImplicitLayerResolverTests {
|
||||
|
||||
private Layers layers = Layers.IMPLICIT;
|
||||
private final Layers layers = Layers.IMPLICIT;
|
||||
|
||||
@Test
|
||||
void iteratorReturnsLayers() {
|
||||
|
||||
@@ -60,7 +60,7 @@ class SizeCalculatingEntryWriterTests {
|
||||
|
||||
private static class TestEntryWriter implements EntryWriter {
|
||||
|
||||
private byte[] bytes;
|
||||
private final byte[] bytes;
|
||||
|
||||
TestEntryWriter(int size) {
|
||||
this.bytes = new byte[size];
|
||||
|
||||
Reference in New Issue
Block a user