You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2022/06/10 12:37:30 UTC

[tomcat] branch main updated: Fix SpotBugs warning. setLastMofified() failure is an error

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 4ed41b49a4 Fix SpotBugs warning. setLastMofified() failure is an error
4ed41b49a4 is described below

commit 4ed41b49a4e6506ec30eaae6d96be008c6606572
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Jun 10 13:36:56 2022 +0100

    Fix SpotBugs warning. setLastMofified() failure is an error
---
 java/org/apache/tomcat/buildutil/RepeatableArchive.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/buildutil/RepeatableArchive.java b/java/org/apache/tomcat/buildutil/RepeatableArchive.java
index 1348ee64c9..a6442f8138 100644
--- a/java/org/apache/tomcat/buildutil/RepeatableArchive.java
+++ b/java/org/apache/tomcat/buildutil/RepeatableArchive.java
@@ -120,7 +120,9 @@ public class RepeatableArchive extends Task {
                         }
                     }
 
-                    archive.setLastModified(lastModified.toMillis());
+                    if (!archive.setLastModified(lastModified.toMillis())) {
+                        throw new BuildException("setLastModified failed for [" + archive.getAbsolutePath() + "]");
+                    }
                     Files.delete(oldArchive.toPath());
                 } catch (IOException ioe) {
                     throw new BuildException(ioe);


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