Skip to content

Commit

Permalink
Refactor magic string into a constant.
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Mar 6, 2018
1 parent b498cda commit 276b282
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
*/
public class ReversedLinesFileReader implements Closeable {

private static final String EMPTY_STRING = "";
private static final int DEFAULT_BLOCK_SIZE = 4096;

private final int blockSize;
Expand Down Expand Up @@ -187,7 +188,7 @@ public String readLine() throws IOException {
}

// aligned behaviour with BufferedReader that doesn't return a last, empty line
if("".equals(line) && !trailingNewlineOfFileSkipped) {
if(EMPTY_STRING.equals(line) && !trailingNewlineOfFileSkipped) {
trailingNewlineOfFileSkipped = true;
line = readLine();
}
Expand Down

0 comments on commit 276b282

Please sign in to comment.