Browse Source

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 years ago
parent
commit
4e6bf2d20b
1 changed files with 8 additions and 6 deletions
  1. 8
    6
      src/com/dmdirc/util/io/TextFile.java

+ 8
- 6
src/com/dmdirc/util/io/TextFile.java View File

40
     /**
40
     /**
41
      * The file we're dealing with.
41
      * The file we're dealing with.
42
      */
42
      */
43
-    private Path path;
43
+    private final Path path;
44
     /**
44
     /**
45
      * The input stream we're dealing with.
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
      * The charset to use to read the file.
49
      * The charset to use to read the file.
54
      */
50
      */
55
     private final Charset charset;
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
      * Creates a new instance of TextFile for the specified file, and uses the
58
      * Creates a new instance of TextFile for the specified file, and uses the
115
      */
115
      */
116
     public TextFile(final Path path, final Charset charset) {
116
     public TextFile(final Path path, final Charset charset) {
117
         this.path = path;
117
         this.path = path;
118
+        this.is = null;
118
         this.charset = charset;
119
         this.charset = charset;
119
     }
120
     }
120
 
121
 
127
      * @since 0.6.3m1
128
      * @since 0.6.3m1
128
      */
129
      */
129
     public TextFile(final InputStream is, final Charset charset) {
130
     public TextFile(final InputStream is, final Charset charset) {
131
+        this.path = null;
130
         this.is = is;
132
         this.is = is;
131
         this.charset = charset;
133
         this.charset = charset;
132
     }
134
     }

Loading…
Cancel
Save