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 2021/01/17 15:28:21 UTC

[commons-net] branch master updated (4d4f05d -> 2578939)

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

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


    from 4d4f05d  Use isEmpty().
     new 30fe35d  Use isEmpty().
     new 2578939  Better local name.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/commons/net/examples/mail/IMAPExportMbox.java   | 10 +++++-----
 .../java/org/apache/commons/net/examples/nntp/PostMessage.java |  4 ++--
 src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java    |  2 +-
 .../org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java   |  2 +-
 src/main/java/org/apache/commons/net/telnet/Telnet.java        |  2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)


[commons-net] 01/02: Use isEmpty().

Posted by gg...@apache.org.
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 30fe35d032c550d9295616538cf16b07bb9023c1
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jan 17 10:28:02 2021 -0500

    Use isEmpty().
---
 src/main/java/org/apache/commons/net/examples/nntp/PostMessage.java   | 4 ++--
 src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java           | 2 +-
 .../java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java     | 2 +-
 src/main/java/org/apache/commons/net/telnet/Telnet.java               | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/commons/net/examples/nntp/PostMessage.java b/src/main/java/org/apache/commons/net/examples/nntp/PostMessage.java
index ed4db38..5f4c0b8 100644
--- a/src/main/java/org/apache/commons/net/examples/nntp/PostMessage.java
+++ b/src/main/java/org/apache/commons/net/examples/nntp/PostMessage.java
@@ -114,11 +114,11 @@ public final class PostMessage
 
             references = stdin.readLine();
 
-            if (organization != null && organization.length() > 0) {
+            if (organization != null && !organization.isEmpty()) {
                 header.addHeaderField("Organization", organization);
             }
 
-            if (references != null && references.length() > 0) {
+            if (references != null && !references.isEmpty()) {
                 header.addHeaderField("References", references);
             }
 
diff --git a/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java b/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java
index 207fcab..b51d046 100644
--- a/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java
+++ b/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java
@@ -209,7 +209,7 @@ public class FTPHTTPClient extends FTPClient {
         final List<String> response = new ArrayList<>();
         final BufferedReader reader = new BufferedReader(new InputStreamReader(input, getCharset()));
 
-        for (String line = reader.readLine(); line != null && line.length() > 0; line = reader.readLine()) {
+        for (String line = reader.readLine(); line != null && !line.isEmpty(); line = reader.readLine()) {
             response.add(line);
         }
 
diff --git a/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java b/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java
index 389d8b2..7dce7db 100644
--- a/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java
+++ b/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java
@@ -376,7 +376,7 @@ public class MVSFTPEntryParser extends ConfigurableFTPFileEntryParserImpl {
          * safe context, for example from a memberlist, where the regex for some
          * reason fails. Then just assign the name field of FTPFile.
          */
-        if (entry != null && entry.trim().length() > 0) {
+        if (entry != null && !entry.trim().isEmpty()) {
             file.setRawListing(entry);
             final String name = entry.split(" ")[0];
             file.setName(name);
diff --git a/src/main/java/org/apache/commons/net/telnet/Telnet.java b/src/main/java/org/apache/commons/net/telnet/Telnet.java
index 257fa01..17658d8 100644
--- a/src/main/java/org/apache/commons/net/telnet/Telnet.java
+++ b/src/main/java/org/apache/commons/net/telnet/Telnet.java
@@ -441,7 +441,7 @@ class Telnet extends SocketClient
             /* TERMINAL-TYPE option (start)*/
             if (option == TERMINAL_TYPE)
             {
-                if (terminalType != null && terminalType.length() > 0)
+                if (terminalType != null && !terminalType.isEmpty())
                 {
                     acceptNewState = true;
                 }


[commons-net] 02/02: Better local name.

Posted by gg...@apache.org.
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 25789394b4671864a0476f3a381538a667cf6121
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jan 17 10:28:16 2021 -0500

    Better local name.
---
 .../org/apache/commons/net/examples/mail/IMAPExportMbox.java   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/commons/net/examples/mail/IMAPExportMbox.java b/src/main/java/org/apache/commons/net/examples/mail/IMAPExportMbox.java
index 1ba0754..cdf6c30 100644
--- a/src/main/java/org/apache/commons/net/examples/mail/IMAPExportMbox.java
+++ b/src/main/java/org/apache/commons/net/examples/mail/IMAPExportMbox.java
@@ -204,12 +204,12 @@ public final class IMAPExportMbox
             chunkListener = new MboxListener(
                 new BufferedWriter(new FileWriter(mbox, false)), eol, printHash, printMarker, checkSequence);
         } else {
-            final File mbox = new File(file);
-            if (mbox.exists() && mbox.length() > 0) {
-                throw new IOException("mailbox file: " + mbox + " already exists and is non-empty!");
+            final File mboxFile = new File(file);
+            if (mboxFile.exists() && mboxFile.length() > 0) {
+                throw new IOException("mailbox file: " + mboxFile + " already exists and is non-empty!");
             }
-            System.out.println("Creating file " + mbox);
-            chunkListener = new MboxListener(new BufferedWriter(new FileWriter(mbox)), eol, printHash, printMarker, checkSequence);
+            System.out.println("Creating file " + mboxFile);
+            chunkListener = new MboxListener(new BufferedWriter(new FileWriter(mboxFile)), eol, printHash, printMarker, checkSequence);
         }
 
         final String path = uri.getPath();