Make fields private where possible
This commit is contained in:
@@ -26,9 +26,9 @@ import java.lang.reflect.Method;
|
||||
*/
|
||||
public class MainMethodRunner implements Runnable {
|
||||
|
||||
private String mainClassName;
|
||||
private final String mainClassName;
|
||||
|
||||
private String[] args;
|
||||
private final String[] args;
|
||||
|
||||
/**
|
||||
* Create a new {@link MainMethodRunner} instance.
|
||||
|
||||
@@ -76,7 +76,7 @@ import org.springframework.boot.loader.util.SystemPropertyUtils;
|
||||
*/
|
||||
public class PropertiesLauncher extends Launcher {
|
||||
|
||||
private Logger logger = Logger.getLogger(Launcher.class.getName());
|
||||
private final Logger logger = Logger.getLogger(Launcher.class.getName());
|
||||
|
||||
/**
|
||||
* Properties key for main class
|
||||
@@ -125,7 +125,7 @@ public class PropertiesLauncher extends Launcher {
|
||||
|
||||
private List<String> paths = new ArrayList<String>(DEFAULT_PATHS);
|
||||
|
||||
private Properties properties = new Properties();
|
||||
private final Properties properties = new Properties();
|
||||
|
||||
public PropertiesLauncher() {
|
||||
if (!isDebug()) {
|
||||
|
||||
@@ -50,7 +50,7 @@ public class ExplodedArchive extends Archive {
|
||||
private static final AsciiBytes MANIFEST_ENTRY_NAME = new AsciiBytes(
|
||||
"META-INF/MANIFEST.MF");
|
||||
|
||||
private File root;
|
||||
private final File root;
|
||||
|
||||
private Map<AsciiBytes, Entry> entries = new LinkedHashMap<AsciiBytes, Entry>();
|
||||
|
||||
@@ -200,7 +200,7 @@ public class ExplodedArchive extends Archive {
|
||||
*/
|
||||
private static class FileNotFoundURLConnection extends URLConnection {
|
||||
|
||||
private String name;
|
||||
private final String name;
|
||||
|
||||
public FileNotFoundURLConnection(URL url, String name) {
|
||||
super(url);
|
||||
|
||||
@@ -34,9 +34,9 @@ import org.springframework.boot.loader.AsciiBytes;
|
||||
*/
|
||||
public class FilteredArchive extends Archive {
|
||||
|
||||
private Archive parent;
|
||||
private final Archive parent;
|
||||
|
||||
private EntryFilter filter;
|
||||
private final EntryFilter filter;
|
||||
|
||||
public FilteredArchive(Archive parent, EntryFilter filter) {
|
||||
this.parent = parent;
|
||||
|
||||
@@ -229,7 +229,7 @@ public class RandomAccessDataFile implements RandomAccessData {
|
||||
*/
|
||||
private class FilePool {
|
||||
|
||||
private int size;
|
||||
private final int size;
|
||||
|
||||
private final Semaphore available;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public final class JarEntryData {
|
||||
|
||||
private final JarFile source;
|
||||
|
||||
private byte[] header;
|
||||
private final byte[] header;
|
||||
|
||||
private AsciiBytes name;
|
||||
|
||||
@@ -47,7 +47,7 @@ public final class JarEntryData {
|
||||
|
||||
private final AsciiBytes comment;
|
||||
|
||||
private long localHeaderOffset;
|
||||
private final long localHeaderOffset;
|
||||
|
||||
private RandomAccessData data;
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ public class JarFile extends java.util.jar.JarFile implements Iterable<JarEntryD
|
||||
|
||||
private final RandomAccessDataFile rootFile;
|
||||
|
||||
private RandomAccessData data;
|
||||
private final RandomAccessData data;
|
||||
|
||||
private final String name;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class JarURLConnection extends java.net.JarURLConnection {
|
||||
|
||||
private static final String JAR_URL_PREFIX = "jar:file:";
|
||||
|
||||
private JarFile jarFile;
|
||||
private final JarFile jarFile;
|
||||
|
||||
private JarEntryData jarEntryData;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.net.URLStreamHandler;
|
||||
*/
|
||||
class JarURLStreamHandler extends URLStreamHandler {
|
||||
|
||||
private JarFile jarFile;
|
||||
private final JarFile jarFile;
|
||||
|
||||
public JarURLStreamHandler(JarFile jarFile) {
|
||||
this.jarFile = jarFile;
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.hamcrest.TypeSafeMatcher;
|
||||
*/
|
||||
public class ByteArrayStartsWith extends TypeSafeMatcher<byte[]> {
|
||||
|
||||
private byte[] bytes;
|
||||
private final byte[] bytes;
|
||||
|
||||
public ByteArrayStartsWith(byte[] bytes) {
|
||||
this.bytes = bytes;
|
||||
|
||||
Reference in New Issue
Block a user