You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/05/26 14:49:25 UTC

[commons-net] 01/02: Remove redundant type casts and simplify

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-net.git

commit 91f4fe45f354ac07c3e1fb33a450bf0845c0ad75
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu May 26 10:49:05 2022 -0400

    Remove redundant type casts and simplify
---
 .../apache/commons/net/ftp/FTPClientConfigFunctionalTest.java  | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/test/java/org/apache/commons/net/ftp/FTPClientConfigFunctionalTest.java b/src/test/java/org/apache/commons/net/ftp/FTPClientConfigFunctionalTest.java
index 080b9397..bb549c0a 100644
--- a/src/test/java/org/apache/commons/net/ftp/FTPClientConfigFunctionalTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/FTPClientConfigFunctionalTest.java
@@ -66,15 +66,9 @@ public class FTPClientConfigFunctionalTest extends TestCase {
     private TreeSet<FTPFile> getSortedSet(final FTPFile[] files) {
         // create a TreeSet which will sort each element
         // as it is added.
-        final TreeSet<FTPFile> sorted = new TreeSet<>((o1, o2) -> {
-            final FTPFile f1 = (FTPFile) o1;
-            final FTPFile f2 = (FTPFile) o2;
-            return f1.getTimestamp().getTime().compareTo(f2.getTimestamp().getTime());
-        });
+        final TreeSet<FTPFile> sorted = new TreeSet<>((o1, o2) -> o1.getTimestamp().getTime().compareTo(o2.getTimestamp().getTime()));
 
-
-        for (final FTPFile file : files)
-        {
+        for (final FTPFile file : files) {
             // The directory contains a few additional files at the beginning
             // which aren't in the series we want. The series we want consists
             // of files named sn.dddd. This adjusts the file list to get rid