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 2024/06/16 13:03:14 UTC
(commons-net) 22/26: Add @SuppressWarnings
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 b635d604fdd20b52dcb6774dcd614addce0e34f4
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jun 16 08:41:32 2024 -0400
Add @SuppressWarnings
---
.../java/org/apache/commons/net/examples/nntp/ArticleReader.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/commons/net/examples/nntp/ArticleReader.java b/src/main/java/org/apache/commons/net/examples/nntp/ArticleReader.java
index b7872a0f..736ccc4f 100644
--- a/src/main/java/org/apache/commons/net/examples/nntp/ArticleReader.java
+++ b/src/main/java/org/apache/commons/net/examples/nntp/ArticleReader.java
@@ -19,6 +19,7 @@ package org.apache.commons.net.examples.nntp;
import java.io.BufferedReader;
import java.io.IOException;
+import java.io.PrintWriter;
import java.net.SocketException;
import org.apache.commons.net.PrintCommandListener;
@@ -44,7 +45,9 @@ public class ArticleReader {
final String articleSpec = args.length >= 3 ? args[2] : null;
final NNTPClient client = new NNTPClient();
- client.addProtocolCommandListener(new PrintCommandListener(Util.newPrintWriter(System.out), true));
+ @SuppressWarnings("resource")
+ final PrintWriter printWriter = Util.newPrintWriter(System.out);
+ client.addProtocolCommandListener(new PrintCommandListener(printWriter, true));
client.connect(hostname);
if (args.length == 5) { // Optional auth