You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2020/05/30 17:14:34 UTC

[GitHub] [commons-io] mernst commented on a change in pull request #117: Prevent NullPointerException in ReversedLinesFileReader constructor

mernst commented on a change in pull request #117:
URL: https://github.com/apache/commons-io/pull/117#discussion_r432871156



##########
File path: src/test/java/org/apache/commons/io/input/ReversedLinesFileReaderTestSimple.java
##########
@@ -66,6 +67,10 @@ public void testUnsupportedEncodingBig5() throws URISyntaxException {
                 () -> new ReversedLinesFileReader(testFileEncodingBig5, IOUtils.DEFAULT_BUFFER_SIZE, "Big5").close());
     }
 
-
+    @Test
+    public void testNullEncoding() throws IOException, URISyntaxException {
+        new ReversedLinesFileReader(new File(this.getClass().getResource("/test-file-empty.bin").toURI()),
+                                    (Charset) null);
+    }

Review comment:
       @garydgregory I agree that would be a useful test, even though it is not directly related to this bug fix.
   
   I've made my best guess at how to test for the default Charset in a system-independent way.
   
   I'm not sure whether this is what you had in mind.  If not, could point me at documentation about how Commons IO prefers to test that the default Charset is being used?
   
   Thanks.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org