From f836efb912a56450eb62ba665100f72a41f56537 Mon Sep 17 00:00:00 2001 From: tugjg Date: Sat, 31 Aug 2024 14:31:02 -0400 Subject: [PATCH 1/2] Address unnecessary method invocation Closes gh-15714 --- .../config/annotation/web/AbstractRequestMatcherRegistry.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistry.java b/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistry.java index 169815dbce..e9a9144aac 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistry.java +++ b/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistry.java @@ -628,7 +628,7 @@ public abstract class AbstractRequestMatcherRegistry { public boolean matches(HttpServletRequest request) { String name = request.getHttpServletMapping().getServletName(); ServletRegistration registration = this.servletContext.getServletRegistration(name); - Assert.notNull(registration, computeErrorMessage(this.servletContext.getServletRegistrations().values())); + Assert.notNull(registration, () -> computeErrorMessage(this.servletContext.getServletRegistrations().values())); try { Class clazz = Class.forName(registration.getClassName()); return DispatcherServlet.class.isAssignableFrom(clazz); From 97cefa6830b16f6229e05c32e9c40bf38b28df72 Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Tue, 3 Sep 2024 15:33:16 -0600 Subject: [PATCH 2/2] Update Formatting Issue gh-15714 --- .../config/annotation/web/AbstractRequestMatcherRegistry.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistry.java b/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistry.java index e9a9144aac..c9ed6220d6 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistry.java +++ b/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistry.java @@ -628,7 +628,8 @@ public abstract class AbstractRequestMatcherRegistry { public boolean matches(HttpServletRequest request) { String name = request.getHttpServletMapping().getServletName(); ServletRegistration registration = this.servletContext.getServletRegistration(name); - Assert.notNull(registration, () -> computeErrorMessage(this.servletContext.getServletRegistrations().values())); + Assert.notNull(registration, + () -> computeErrorMessage(this.servletContext.getServletRegistrations().values())); try { Class clazz = Class.forName(registration.getClassName()); return DispatcherServlet.class.isAssignableFrom(clazz);