From a982fb5de04b1f00065fa30e9ba084f4e8370c9d Mon Sep 17 00:00:00 2001 From: Tran Ngoc Nhan Date: Thu, 27 Feb 2025 01:28:20 +0700 Subject: [PATCH] Simplify if condition Signed-off-by: Tran Ngoc Nhan --- .../springframework/web/filter/OncePerRequestFilter.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/web/filter/OncePerRequestFilter.java b/spring-web/src/main/java/org/springframework/web/filter/OncePerRequestFilter.java index c7b673293903..e43fff0eba00 100644 --- a/spring-web/src/main/java/org/springframework/web/filter/OncePerRequestFilter.java +++ b/spring-web/src/main/java/org/springframework/web/filter/OncePerRequestFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -126,10 +126,7 @@ private boolean skipDispatch(HttpServletRequest request) { if (isAsyncDispatch(request) && shouldNotFilterAsyncDispatch()) { return true; } - if (request.getAttribute(WebUtils.ERROR_REQUEST_URI_ATTRIBUTE) != null && shouldNotFilterErrorDispatch()) { - return true; - } - return false; + return request.getAttribute(WebUtils.ERROR_REQUEST_URI_ATTRIBUTE) != null && shouldNotFilterErrorDispatch(); } /**