garydgregory commented on a change in pull request #115:
URL: https://github.com/apache/commons-io/pull/115#discussion_r432843971
##########
File path: src/main/java/org/apache/commons/io/file/Counters.java
##########
@@ -245,7 +245,7 @@ public BigInteger getBigInteger() {
@Override
public Long getLong() {
- return Long.valueOf(value);
+ return value;
Review comment:
See other comment.
##########
File path: src/main/java/org/apache/commons/io/file/Counters.java
##########
@@ -92,8 +92,8 @@ public int hashCode() {
@Override
public String toString() {
- return String.format("%,d files, %,d directories, %,d bytes",
Long.valueOf(fileCounter.get()),
- Long.valueOf(directoryCounter.get()),
Long.valueOf(byteCounter.get()));
+ return String.format("%,d files, %,d directories, %,d bytes",
fileCounter.get(),
+ directoryCounter.get(), byteCounter.get());
Review comment:
Same comment as in your other PR. Let's leave boxing and unboxing as
obvious since we are in a low level library and I prefer to see where this
happens so we can think about consequences of creating objects.
##########
File path:
src/test/java/org/apache/commons/io/filefilter/FileFilterTestCase.java
##########
@@ -1406,7 +1406,7 @@ public void testFilterListNullParameters() {
final IOFileFilter filter = FileFilterUtils.trueFileFilter();
try {
- FileFilterUtils.filterList(filter, Arrays.asList((File) null));
+ FileFilterUtils.filterList(filter,
Collections.singletonList((File) null));
Review comment:
It is worth testing both kinds?
##########
File path: src/main/java/org/apache/commons/io/file/Counters.java
##########
@@ -135,7 +135,7 @@ public BigInteger getBigInteger() {
@Override
public Long getLong() {
- return Long.valueOf(value.longValueExact());
+ return value.longValueExact();
Review comment:
See other comment.
----------------------------------------------------------------
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:
[email protected]