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

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 3d6d8f410c Refactor to silence 2 new warnings with Eclipse 2024-06
3d6d8f410c is described below

commit 3d6d8f410c96771d1cb1fd70ef0c8d256f572d93
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Jun 13 18:05:39 2024 +0100

    Refactor to silence 2 new warnings with Eclipse 2024-06
    
    These are false positives but the refactoring has minimal impact and
    @SuppressWarnings would have too broad a coverage
---
 java/org/apache/catalina/startup/ExpandWar.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/startup/ExpandWar.java 
b/java/org/apache/catalina/startup/ExpandWar.java
index a100dfd2db..fe720968a9 100644
--- a/java/org/apache/catalina/startup/ExpandWar.java
+++ b/java/org/apache/catalina/startup/ExpandWar.java
@@ -251,8 +251,10 @@ public class ExpandWar {
             if (fileSrc.isDirectory()) {
                 result = copy(fileSrc, fileDest);
             } else {
-                try (FileChannel ic = (new 
FileInputStream(fileSrc)).getChannel();
-                        FileChannel oc = (new 
FileOutputStream(fileDest)).getChannel()) {
+                try (FileInputStream fis = new FileInputStream(fileSrc);
+                        FileChannel ic = (fis).getChannel();
+                        FileOutputStream fos = new FileOutputStream(fileDest);
+                        FileChannel oc = (fos).getChannel()) {
                     long size = ic.size();
                     long position = 0;
                     while (size > 0) {


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to