You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2018/03/06 21:35:32 UTC

commons-io git commit: Refactor magic int into a constant.

Repository: commons-io
Updated Branches:
  refs/heads/master 68a73b54d -> b498cda5b


Refactor magic int into a constant.

Project: http://git-wip-us.apache.org/repos/asf/commons-io/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-io/commit/b498cda5
Tree: http://git-wip-us.apache.org/repos/asf/commons-io/tree/b498cda5
Diff: http://git-wip-us.apache.org/repos/asf/commons-io/diff/b498cda5

Branch: refs/heads/master
Commit: b498cda5bc8d834ab311a6a3415e990100d8a81a
Parents: 68a73b5
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Mar 6 14:35:28 2018 -0700
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Mar 6 14:35:28 2018 -0700

----------------------------------------------------------------------
 .../org/apache/commons/io/input/ReversedLinesFileReader.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-io/blob/b498cda5/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java b/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java
index 308e5fc..4fe9b46 100644
--- a/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java
+++ b/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java
@@ -35,6 +35,8 @@ import org.apache.commons.io.Charsets;
  */
 public class ReversedLinesFileReader implements Closeable {
 
+    private static final int DEFAULT_BLOCK_SIZE = 4096;
+    
     private final int blockSize;
     private final Charset encoding;
 
@@ -62,7 +64,7 @@ public class ReversedLinesFileReader implements Closeable {
      */
     @Deprecated
     public ReversedLinesFileReader(final File file) throws IOException {
-        this(file, 4096, Charset.defaultCharset());
+        this(file, DEFAULT_BLOCK_SIZE, Charset.defaultCharset());
     }
 
     /**
@@ -76,7 +78,7 @@ public class ReversedLinesFileReader implements Closeable {
      * @since 2.5
      */
     public ReversedLinesFileReader(final File file, final Charset charset) throws IOException {
-        this(file, 4096, charset);
+        this(file, DEFAULT_BLOCK_SIZE, charset);
     }
 
     /**