Ver código fonte

Make some fields in TextFile final.

Change-Id: Ib918ce2dcad368a3d8ad14aa44d3a42bf0f4cb22
Reviewed-on: http://gerrit.dmdirc.com/3508
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
changes/08/3508/2
Chris Smith 10 anos atrás
pai
commit
4e6bf2d20b
1 arquivos alterados com 8 adições e 6 exclusões
  1. 8
    6
      src/com/dmdirc/util/io/TextFile.java

+ 8
- 6
src/com/dmdirc/util/io/TextFile.java Ver arquivo

@@ -40,19 +40,19 @@ public class TextFile {
40 40
     /**
41 41
      * The file we're dealing with.
42 42
      */
43
-    private Path path;
43
+    private final Path path;
44 44
     /**
45 45
      * The input stream we're dealing with.
46 46
      */
47
-    private InputStream is;
48
-    /**
49
-     * The lines we've read from the file.
50
-     */
51
-    private List<String> lines;
47
+    private final InputStream is;
52 48
     /**
53 49
      * The charset to use to read the file.
54 50
      */
55 51
     private final Charset charset;
52
+    /**
53
+     * The lines we've read from the file.
54
+     */
55
+    private List<String> lines;
56 56
 
57 57
     /**
58 58
      * Creates a new instance of TextFile for the specified file, and uses the
@@ -115,6 +115,7 @@ public class TextFile {
115 115
      */
116 116
     public TextFile(final Path path, final Charset charset) {
117 117
         this.path = path;
118
+        this.is = null;
118 119
         this.charset = charset;
119 120
     }
120 121
 
@@ -127,6 +128,7 @@ public class TextFile {
127 128
      * @since 0.6.3m1
128 129
      */
129 130
     public TextFile(final InputStream is, final Charset charset) {
131
+        this.path = null;
130 132
         this.is = is;
131 133
         this.charset = charset;
132 134
     }

Carregando…
Cancelar
Salvar