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

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


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

commit f08b071a091b5ad16f58ace443374abcc2926a88
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