This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 0721c0704f Refactor to silence 2 new warnings with Eclipse 2024-06
0721c0704f is described below
commit 0721c0704f95c0fbc5a205fd42d36222fac9e9f4
Author: Mark Thomas <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]