Make fields private where possible

This commit is contained in:
Phillip Webb
2014-01-21 16:21:00 -08:00
parent 0160760568
commit 43e54d38f7
169 changed files with 280 additions and 280 deletions

View File

@@ -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.

View File

@@ -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()) {

View File

@@ -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);

View File

@@ -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;

View File

@@ -229,7 +229,7 @@ public class RandomAccessDataFile implements RandomAccessData {
*/
private class FilePool {
private int size;
private final int size;
private final Semaphore available;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;