This is an automated email from the ASF dual-hosted git repository.
remm 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 daa4e108a1 Fix NPE and sync the stat
daa4e108a1 is described below
commit daa4e108a18ce7ac9625b79dce99e5fa17dd0a1d
Author: remm <[email protected]>
AuthorDate: Thu Sep 14 10:27:58 2023 +0200
Fix NPE and sync the stat
Found by coverity.
---
java/org/apache/catalina/startup/HostConfig.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/catalina/startup/HostConfig.java
b/java/org/apache/catalina/startup/HostConfig.java
index 001beb5ae2..97d77a33df 100644
--- a/java/org/apache/catalina/startup/HostConfig.java
+++ b/java/org/apache/catalina/startup/HostConfig.java
@@ -344,7 +344,7 @@ public class HostConfig implements LifecycleListener {
* @return 0L if no application with that name is deployed, or the instant
* on which the application was deployed
*/
- public long getDeploymentTime(String name) {
+ public synchronized long getDeploymentTime(String name) {
DeployedApplication app = deployed.get(name);
if (app == null) {
return 0L;
@@ -1188,6 +1188,9 @@ public class HostConfig implements LifecycleListener {
// Should not be null as we test above if this is a directory
String[] migrationCandidates = legacyAppBase.list();
+ if (migrationCandidates == null) {
+ return;
+ }
for (String migrationCandidate : migrationCandidates) {
File source = new File(legacyAppBase, migrationCandidate);
File destination = new File(appBase, migrationCandidate);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]