From 29380a87a00cf40696b727474ebb17c539b72874 Mon Sep 17 00:00:00 2001 From: Tran Ngoc Nhan Date: Fri, 11 Apr 2025 23:05:03 +0700 Subject: [PATCH] Polish javadoc Signed-off-by: Tran Ngoc Nhan --- .../util/matcher/PathPatternRequestMatcher.java | 6 ++++-- .../security/web/util/matcher/RequestMatcher.java | 14 +++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/web/src/main/java/org/springframework/security/web/servlet/util/matcher/PathPatternRequestMatcher.java b/web/src/main/java/org/springframework/security/web/servlet/util/matcher/PathPatternRequestMatcher.java index c9c92c2b4b..86cc860e0f 100644 --- a/web/src/main/java/org/springframework/security/web/servlet/util/matcher/PathPatternRequestMatcher.java +++ b/web/src/main/java/org/springframework/security/web/servlet/util/matcher/PathPatternRequestMatcher.java @@ -172,7 +172,9 @@ public final class PathPatternRequestMatcher implements RequestMatcher { * *

* If you have many paths that have a common path prefix, you can use - * {@link #basePath} to reduce repetition like so: + * {@link #basePath} to reduce repetition like so: + * + *

 	 *     PathPatternRequestMatcher.Builder mvc = withDefaults().basePath("/mvc");
 	 *     http
 	 *         .authorizeHttpRequests((authorize) -> authorize
@@ -180,7 +182,7 @@ public final class PathPatternRequestMatcher implements RequestMatcher {
 	 *              .requestMatchers(mvc.matcher("/admin/**")).hasAuthority("admin")
 	 *         )
 	 *             ...
-	 * 
+	 * 
*/ public static final class Builder { diff --git a/web/src/main/java/org/springframework/security/web/util/matcher/RequestMatcher.java b/web/src/main/java/org/springframework/security/web/util/matcher/RequestMatcher.java index e6b223d977..3f81ce156b 100644 --- a/web/src/main/java/org/springframework/security/web/util/matcher/RequestMatcher.java +++ b/web/src/main/java/org/springframework/security/web/util/matcher/RequestMatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 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. @@ -38,7 +38,7 @@ public interface RequestMatcher { boolean matches(HttpServletRequest request); /** - * Returns a MatchResult for this RequestMatcher The default implementation returns + * Returns a MatchResult for this RequestMatcher. The default implementation returns * {@link Collections#emptyMap()} when {@link MatchResult#getVariables()} is invoked. * @return the MatchResult from comparing this RequestMatcher against the * HttpServletRequest @@ -50,7 +50,7 @@ public interface RequestMatcher { } /** - * The result of matching against an HttpServletRequest Contains the status, true or + * The result of matching against an HttpServletRequest contains the status, true or * false, of the match and if present, any variables extracted from the match * * @since 5.2 @@ -86,7 +86,7 @@ public interface RequestMatcher { /** * Creates an instance of {@link MatchResult} that is a match with no variables - * @return + * @return {@link MatchResult} that is a match with no variables */ public static MatchResult match() { return new MatchResult(true, Collections.emptyMap()); @@ -95,8 +95,8 @@ public interface RequestMatcher { /** * Creates an instance of {@link MatchResult} that is a match with the specified * variables - * @param variables - * @return + * @param variables the specified variables + * @return {@link MatchResult} that is a match with the specified variables */ public static MatchResult match(Map variables) { return new MatchResult(true, variables); @@ -104,7 +104,7 @@ public interface RequestMatcher { /** * Creates an instance of {@link MatchResult} that is not a match. - * @return + * @return {@link MatchResult} that is not a match */ public static MatchResult notMatch() { return new MatchResult(false, Collections.emptyMap());