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 2020/09/21 14:48:18 UTC

[commons-net] branch master updated: 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


The following commit(s) were added to refs/heads/master by this push:
     new 3819ec6  Add @SuppressWarnings.
3819ec6 is described below

commit 3819ec6d2229e39303773bec00aec5dc00cecae1
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Sep 21 10:43:39 2020 -0400

    Add @SuppressWarnings.
---
 src/main/java/org/apache/commons/net/SocketClient.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/main/java/org/apache/commons/net/SocketClient.java b/src/main/java/org/apache/commons/net/SocketClient.java
index 2be0134..0d0abbf 100644
--- a/src/main/java/org/apache/commons/net/SocketClient.java
+++ b/src/main/java/org/apache/commons/net/SocketClient.java
@@ -371,6 +371,7 @@ public abstract class SocketClient
      * @return {@code true} if the socket appears to be available for use
      * @since 3.0
      */
+    @SuppressWarnings("resource")
     public boolean isAvailable(){
         if (isConnected()) {
             try
@@ -397,7 +398,9 @@ public abstract class SocketClient
                     return false;
                 }
                 /* ignore the result, catch exceptions: */
+                // No need to close
                 _socket_.getInputStream();
+                // No need to close
                 _socket_.getOutputStream();
             }
             catch (final IOException ioex)