You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "jsoref (via GitHub)" <gi...@apache.org> on 2023/07/25 23:08:18 UTC
[GitHub] [commons-io] jsoref commented on a diff in pull request #468: Spelling
jsoref commented on code in PR #468:
URL: https://github.com/apache/commons-io/pull/468#discussion_r1274202266
##########
src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java:
##########
@@ -410,11 +410,11 @@ public void test_reset_Exception() throws IOException {
@Test
public void test_reset_scenario1() throws IOException {
final byte[] input = "12345678900".getBytes();
- final BufferedInputStream buffis = new BufferedInputStream(new ByteArrayInputStream(input));
- buffis.read();
- buffis.mark(5);
- buffis.skip(5);
- buffis.reset();
+ final BufferedInputStream bufin = new BufferedInputStream(new ByteArrayInputStream(input));
+ bufin.read();
+ bufin.mark(5);
+ bufin.skip(5);
+ bufin.reset();
Review Comment:
This file has a whole bunch of different local variables used for `new BufferedInputStream(...)`. There does not appear to be a remotely good reason for so many different ways to spell the same variable name in a single file, but only this one bothered me enough to change it.
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L94
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L112
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L143
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L162
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L172
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L216
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L230
-- this is in the same scope as the previous one, but the previous one is effectively dead, so there's no reason not to recycle it as the next two sites do...
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L281
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L302
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L347
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L390
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L428
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L441
https://github.com/apache/commons-io/blob/318645fd97d6c31cfbce6f5a7fa83d5350e87708/src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStreamTest.java#L461
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org