ddeschenes-1 commented on code in PR #618:
URL: https://github.com/apache/commons-compress/pull/618#discussion_r1864226900
##########
src/test/java/org/apache/commons/compress/compressors/gzip/GzipParametersTest.java:
##########
@@ -46,4 +50,33 @@ public void testToString() {
gzipParameters.setOS(GzipParameters.OS.Z_SYSTEM);
assertTrue(gzipParameters.toString().contains("Z_SYSTEM"));
}
+
+ @ParameterizedTest
+ @CsvSource({ //@formatter:off
+ " , helloworld, true",
+ " , hello�world, true",
+ " , hello\0world, false",
+ "ISO-8859-1, helloworld, true",
+ "ISO-8859-1, hello�world, true",
+ "ISO-8859-1, hello\0world, false",
+ "UTF-8 , helloworld, true",
+ "UTF-8 , hello�world, true",
+ "UTF-8 , hello\0world, false",
+ "UTF-16BE , helloworld, false",
+ })//@formatter:on
+ public void testIllegalCommentOrFileName(String charset, String text,
boolean shouldPass) {
Review Comment:
This is a polluting practice that should never be enforced.
There are IDE warnings to catch assignment to method parameters, for those
who care; even PMD can be set to warn on AvoidReassigningParameters. There is
no justification for polluting the code with final, or generating a warning
from a missing final if it is not even assigned anywhere.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]