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-vfs.git

commit 72d4fdd615cf819ecefaddb211b2c2fa58bd9262
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sun Jul 21 14:56:29 2024 -0400

    Avoid PMD 7 error by convention
---
 .../java/org/apache/commons/vfs2/provider/url/UrlFileObject.java    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/url/UrlFileObject.java
 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/url/UrlFileObject.java
index 0d3776da..df09a5b8 100644
--- 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/url/UrlFileObject.java
+++ 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/url/UrlFileObject.java
@@ -75,7 +75,7 @@ public class UrlFileObject extends 
AbstractFileObject<UrlFileSystem> {
     @Override
     protected long doGetContentSize() throws Exception {
         final URLConnection conn = url.openConnection();
-        try (InputStream in = conn.getInputStream()) {
+        try (InputStream unused = conn.getInputStream()) {
             return conn.getContentLength();
         }
     }
@@ -94,7 +94,7 @@ public class UrlFileObject extends 
AbstractFileObject<UrlFileSystem> {
     @Override
     protected long doGetLastModifiedTime() throws Exception {
         final URLConnection conn = url.openConnection();
-        try (InputStream in = conn.getInputStream()) {
+        try (InputStream unused = conn.getInputStream()) {
             return conn.getLastModified();
         }
     }
@@ -107,7 +107,7 @@ public class UrlFileObject extends 
AbstractFileObject<UrlFileSystem> {
         try {
             // Attempt to connect & check status
             final URLConnection conn = url.openConnection();
-            try (InputStream in = conn.getInputStream()) {
+            try (InputStream unused = conn.getInputStream()) {
                 if (conn instanceof HttpURLConnection) {
                     final int status = ((HttpURLConnection) 
conn).getResponseCode();
                     // 200 is good, maybe add more later...

Reply via email to