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 144a82c312a3e318c357268e42f2c942d1611b47
Author: Gary Gregory <[email protected]>
AuthorDate: Mon Sep 18 11:24:29 2023 -0400

    Use Objects.toString()
---
 src/main/java/org/apache/commons/net/nntp/NewGroupsOrNewsQuery.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/net/nntp/NewGroupsOrNewsQuery.java 
b/src/main/java/org/apache/commons/net/nntp/NewGroupsOrNewsQuery.java
index c8a848df..1199d8fa 100644
--- a/src/main/java/org/apache/commons/net/nntp/NewGroupsOrNewsQuery.java
+++ b/src/main/java/org/apache/commons/net/nntp/NewGroupsOrNewsQuery.java
@@ -18,6 +18,7 @@
 package org.apache.commons.net.nntp;
 
 import java.util.Calendar;
+import java.util.Objects;
 
 /**
  * The NewGroupsOrNewsQuery class. This is used to issue NNTP NEWGROUPS and 
NEWNEWS queries, implemented by
@@ -196,7 +197,7 @@ public final class NewGroupsOrNewsQuery {
      * @return The list of distributions, which may be null if no 
distributions have been specified.
      */
     public String getDistributions() {
-        return distributions == null ? null : distributions.toString();
+        return Objects.toString(distributions, null);
     }
 
     /**
@@ -205,7 +206,7 @@ public final class NewGroupsOrNewsQuery {
      * @return The list of newsgroups, which may be null if no newsgroups have 
been specified.
      */
     public String getNewsgroups() {
-        return newsgroups == null ? null : newsgroups.toString();
+        return Objects.toString(newsgroups, null);
     }
 
     /**

Reply via email to