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

remm 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 58c3841f40 Throw an ISE instead of return null
58c3841f40 is described below

commit 58c3841f4097cd12f033c75773c9a581efff7202
Author: remm <r...@apache.org>
AuthorDate: Tue Jan 16 16:38:13 2024 +0100

    Throw an ISE instead of return null
    
    Found by coverity.
---
 java/org/apache/catalina/startup/LocalStrings.properties | 1 +
 java/org/apache/catalina/startup/Tomcat.java             | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/startup/LocalStrings.properties 
b/java/org/apache/catalina/startup/LocalStrings.properties
index 2f3cbde545..918345ed22 100644
--- a/java/org/apache/catalina/startup/LocalStrings.properties
+++ b/java/org/apache/catalina/startup/LocalStrings.properties
@@ -157,6 +157,7 @@ tomcat.homeDirMakeFail=Unable to create the directory [{0}] 
to use as the home d
 tomcat.invalidCommandLine=Invalid command line arguments [{0}]
 tomcat.noContextClass=Failed to instantiate context class [{0}] for host [{1}] 
and url [{2}]
 tomcat.noContextXml=Unable to determine web application context.xml [{0}]
+tomcat.noWrapper=Failed to create wrapper
 
 userConfig.database=Exception loading user database
 userConfig.deploy=Deploying web application for user [{0}]
diff --git a/java/org/apache/catalina/startup/Tomcat.java 
b/java/org/apache/catalina/startup/Tomcat.java
index bac2421ed9..0eeb85efb4 100644
--- a/java/org/apache/catalina/startup/Tomcat.java
+++ b/java/org/apache/catalina/startup/Tomcat.java
@@ -386,7 +386,7 @@ public class Tomcat {
         // will do class for name and set init params
         Wrapper sw = ctx.createWrapper();
         if (sw == null) {
-            return null;
+            throw new IllegalStateException(sm.getString("tomcat.noWrapper"));
         }
         sw.setServletClass(servletClass);
         sw.setName(servletName);


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

Reply via email to