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

remm pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 3e6ff3d085 Throw an ISE instead of return null
3e6ff3d085 is described below

commit 3e6ff3d08516484ad0d4ad17463cb54de4340630
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 34ad65cab6..1db37ba354 100644
--- a/java/org/apache/catalina/startup/LocalStrings.properties
+++ b/java/org/apache/catalina/startup/LocalStrings.properties
@@ -139,6 +139,7 @@ tomcat.baseDirMakeFail=Unable to create the directory [{0}] 
to use as the base d
 tomcat.baseDirNotDir=The location [{0}] specified for the base directory is 
not a directory
 tomcat.defaultMimeTypeMappingsFail=Unable to load the default MIME types
 tomcat.homeDirMakeFail=Unable to create the directory [{0}] to use as the home 
directory
+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 ef7023ea16..135bbc32df 100644
--- a/java/org/apache/catalina/startup/Tomcat.java
+++ b/java/org/apache/catalina/startup/Tomcat.java
@@ -377,7 +377,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