This is an automated email from the ASF dual-hosted git repository. rmaucher pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit c817143f15567ca4288e32e39a7e32173e3ebcd6 Author: opencode <[email protected]> AuthorDate: Wed Sep 30 10:26:09 2026 +0200 Store the JASPIC isMandatory MessageInfo property as a Boolean as the specification requires rather than a String, and throw IllegalArgumentException rather than NullPointerException when null is passed to the MessageInfoImpl request/response message setters --- .../apache/catalina/authenticator/jaspic/MessageInfoImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/java/org/apache/catalina/authenticator/jaspic/MessageInfoImpl.java b/java/org/apache/catalina/authenticator/jaspic/MessageInfoImpl.java index 397307d675..c2539413a5 100644 --- a/java/org/apache/catalina/authenticator/jaspic/MessageInfoImpl.java +++ b/java/org/apache/catalina/authenticator/jaspic/MessageInfoImpl.java @@ -59,7 +59,7 @@ public class MessageInfoImpl implements MessageInfo { public MessageInfoImpl(HttpServletRequest request, HttpServletResponse response, boolean authMandatory) { this.request = request; this.response = response; - map.put(IS_MANDATORY, Boolean.toString(authMandatory)); + map.put(IS_MANDATORY, Boolean.valueOf(authMandatory)); } @Override @@ -80,8 +80,8 @@ public class MessageInfoImpl implements MessageInfo { @Override public void setRequestMessage(Object request) { if (!(request instanceof HttpServletRequest)) { - throw new IllegalArgumentException( - sm.getString("authenticator.jaspic.badRequestType", request.getClass().getName())); + String typeName = request == null ? "null" : request.getClass().getName(); + throw new IllegalArgumentException(sm.getString("authenticator.jaspic.badRequestType", typeName)); } this.request = (HttpServletRequest) request; } @@ -89,8 +89,8 @@ public class MessageInfoImpl implements MessageInfo { @Override public void setResponseMessage(Object response) { if (!(response instanceof HttpServletResponse)) { - throw new IllegalArgumentException( - sm.getString("authenticator.jaspic.badResponseType", response.getClass().getName())); + String typeName = response == null ? "null" : response.getClass().getName(); + throw new IllegalArgumentException(sm.getString("authenticator.jaspic.badResponseType", typeName)); } this.response = (HttpServletResponse) response; } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
