Skip to content

Commit afc35b1

Browse files
committed
Remove javadoc warnings for spring-security-ldap
Replace deprecated <tt> tags with {@code} and fix unresolvable {@link javax.naming.*} references to {@code} across the ldap module. Closes gh-18457 Signed-off-by: hanweiwei <duzielww@163.com>
1 parent 1455798 commit afc35b1

24 files changed

Lines changed: 61 additions & 61 deletions

ldap/src/main/java/org/springframework/security/ldap/DefaultLdapUsernameToDnMapper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
import org.springframework.ldap.support.LdapNameBuilder;
2222

2323
/**
24-
* This implementation appends a name component to the <tt>userDnBase</tt> context using
25-
* the <tt>usernameAttributeName</tt> property. So if the <tt>uid</tt> attribute is used
26-
* to store the username, and the base DN is <tt>cn=users</tt> and we are creating a new
27-
* user called "sam", then the DN will be <tt>uid=sam,cn=users</tt>.
24+
* This implementation appends a name component to the {@code userDnBase} context using
25+
* the {@code usernameAttributeName} property. So if the {@code uid} attribute is used
26+
* to store the username, and the base DN is {@code cn=users} and we are creating a new
27+
* user called "sam", then the DN will be {@code uid=sam,cn=users}.
2828
*
2929
* @author Luke Taylor
3030
*/

ldap/src/main/java/org/springframework/security/ldap/DefaultSpringSecurityContextSource.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@
3434
import org.springframework.util.Assert;
3535

3636
/**
37-
* ContextSource implementation which uses Spring LDAP's <tt>LdapContextSource</tt> as a
37+
* ContextSource implementation which uses Spring LDAP's {@code LdapContextSource} as a
3838
* base class. Used internally by the Spring Security LDAP namespace configuration.
3939
* <p>
40-
* From Spring Security 3.0, Spring LDAP 1.3 is used and the <tt>ContextSource</tt>
40+
* From Spring Security 3.0, Spring LDAP 1.3 is used and the {@code ContextSource}
4141
* interface provides support for binding with a username and password. As a result,
42-
* Spring LDAP <tt>ContextSource</tt> implementations such as <tt>LdapContextSource</tt>
42+
* Spring LDAP {@code ContextSource} implementations such as {@code LdapContextSource}
4343
* may be used directly with Spring Security.
4444
* <p>
4545
* Spring LDAP 1.3 doesn't have JVM-level LDAP connection pooling enabled by default. This
46-
* class sets the <tt>pooled</tt> property to true, but customizes the
47-
* {@link DirContextAuthenticationStrategy} used to disable pooling when the <tt>DN</tt>
48-
* doesn't match the <tt>userDn</tt> property. This prevents pooling for calls to
46+
* class sets the {@code pooled} property to true, but customizes the
47+
* {@link DirContextAuthenticationStrategy} used to disable pooling when the {@code DN}
48+
* doesn't match the {@code userDn} property. This prevents pooling for calls to
4949
* {@link #getContext(String, String)} to authenticate as specific users.
5050
*
5151
* @author Luke Taylor

ldap/src/main/java/org/springframework/security/ldap/LdapUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public static String convertPasswordToString(Object passObj) {
125125
/**
126126
* Works out the root DN for an LDAP URL.
127127
* <p>
128-
* For example, the URL <tt>ldap://monkeymachine:11389/dc=springframework,dc=org</tt>
128+
* For example, the URL {@code ldap://monkeymachine:11389/dc=springframework,dc=org}
129129
* has the root DN "dc=springframework,dc=org".
130130
* </p>
131131
* @param url the LDAP URL
@@ -151,7 +151,7 @@ public static String parseRootDnFromUrl(String url) {
151151
/**
152152
* Parses the supplied LDAP URL.
153153
* @param url the URL (e.g.
154-
* <tt>ldap://monkeymachine:11389/dc=springframework,dc=org</tt>).
154+
* {@code ldap://monkeymachine:11389/dc=springframework,dc=org}).
155155
* @return the URI object created from the URL
156156
* @throws IllegalArgumentException if the URL is null, empty or the URI syntax is
157157
* invalid.

ldap/src/main/java/org/springframework/security/ldap/SpringSecurityLdapTemplate.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public Set<Map<String, List<String>>> searchForMultipleAttributeValues(String ba
203203

204204
/**
205205
* Returns the DN for the context representing this LDAP record. By default this is
206-
* using {@link javax.naming.Context#getNameInNamespace()} instead of
206+
* using {@code Context#getNameInNamespace()} instead of
207207
* {@link org.springframework.ldap.core.DirContextAdapter#getDn()} since the latter
208208
* returns a partial DN if a base has been specified.
209209
* @param adapter - the Context to extract the DN from
@@ -249,7 +249,7 @@ private void extractStringAttributeValues(DirContextAdapter adapter, Map<String,
249249
* Performs a search, with the requirement that the search shall return a single
250250
* directory entry, and uses the supplied mapper to create the object from that entry.
251251
* <p>
252-
* Ignores <tt>PartialResultException</tt> if thrown, for compatibility with Active
252+
* Ignores {@code PartialResultException} if thrown, for compatibility with Active
253253
* Directory (see {@link LdapTemplate#setIgnorePartialResultException(boolean)}).
254254
* @param base the search base, relative to the base context supplied by the context
255255
* source.

ldap/src/main/java/org/springframework/security/ldap/authentication/AbstractLdapAuthenticationProvider.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ protected abstract Collection<? extends GrantedAuthority> loadUserAuthorities(Di
9595
* Creates the final {@code Authentication} object which will be returned from the
9696
* {@code authenticate} method.
9797
* @param authentication the original authentication request token
98-
* @param user the <tt>UserDetails</tt> instance returned by the configured
99-
* <tt>UserDetailsContextMapper</tt>.
98+
* @param user the {@code UserDetails} instance returned by the configured
99+
* {@code UserDetailsContextMapper}.
100100
* @return the Authentication object for the fully authenticated user.
101101
*/
102102
protected Authentication createSuccessfulAuthentication(UsernamePasswordAuthenticationToken authentication,
@@ -149,12 +149,12 @@ public void setAuthoritiesMapper(GrantedAuthoritiesMapper authoritiesMapper) {
149149
}
150150

151151
/**
152-
* Allows a custom strategy to be used for creating the <tt>UserDetails</tt> which
153-
* will be stored as the principal in the <tt>Authentication</tt> returned by the
152+
* Allows a custom strategy to be used for creating the {@code UserDetails} which
153+
* will be stored as the principal in the {@code Authentication} returned by the
154154
* {@link #createSuccessfulAuthentication(org.springframework.security.authentication.UsernamePasswordAuthenticationToken, org.springframework.security.core.userdetails.UserDetails)}
155155
* method.
156156
* @param userDetailsContextMapper the strategy instance. If not set, defaults to a
157-
* simple <tt>LdapUserDetailsMapper</tt>.
157+
* simple {@code LdapUserDetailsMapper}.
158158
*/
159159
public void setUserDetailsContextMapper(UserDetailsContextMapper userDetailsContextMapper) {
160160
Assert.notNull(userDetailsContextMapper, "UserDetailsContextMapper must not be null");

ldap/src/main/java/org/springframework/security/ldap/authentication/AbstractLdapAuthenticator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ protected ContextSource getContextSource() {
8686

8787
/**
8888
* Builds list of possible DNs for the user, worked out from the
89-
* <tt>userDnPatterns</tt> property.
89+
* {@code userDnPatterns} property.
9090
* @param username the user's login name
91-
* @return the list of possible DN matches, empty if <tt>userDnPatterns</tt> wasn't
91+
* @return the list of possible DN matches, empty if {@code userDnPatterns} wasn't
9292
* set.
9393
*/
9494
protected List<String> getUserDns(String username) {

ldap/src/main/java/org/springframework/security/ldap/authentication/LdapAuthenticationProvider.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@
9595
*
9696
* <p>
9797
* This would set up the provider to access an LDAP server with URL
98-
* <tt>ldap://monkeymachine:389/dc=springframework,dc=org</tt>. Authentication will be
98+
* {@code ldap://monkeymachine:389/dc=springframework,dc=org}. Authentication will be
9999
* performed by attempting to bind with the DN
100-
* <tt>uid=&lt;user-login-name&gt;,ou=people,dc=springframework,dc=org</tt>. After
100+
* {@code uid=&lt;user-login-name&gt;,ou=people,dc=springframework,dc=org}. After
101101
* successful authentication, roles will be assigned to the user by searching under the DN
102-
* <tt>ou=groups,dc=springframework,dc=org</tt> with the default filter
103-
* <tt>(member=&lt;user's-DN&gt;)</tt>. The role name will be taken from the "ou"
102+
* {@code ou=groups,dc=springframework,dc=org} with the default filter
103+
* {@code (member=&lt;user's-DN&gt;)}. The role name will be taken from the "ou"
104104
* attribute of each match.
105105
* <p>
106106
* The authenticate method will reject empty passwords outright. LDAP servers may allow an

ldap/src/main/java/org/springframework/security/ldap/authentication/ad/ActiveDirectoryAuthenticationException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
/**
2424
* <p>
25-
* Thrown as a translation of an {@link javax.naming.AuthenticationException} when
25+
* Thrown as a translation of a {@code javax.naming.AuthenticationException} when
2626
* attempting to authenticate against Active Directory using
2727
* {@link ActiveDirectoryLdapAuthenticationProvider}. Typically this error is wrapped by
2828
* an {@link AuthenticationException} since it does not provide a user friendly message.

ldap/src/main/java/org/springframework/security/ldap/authentication/package-info.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
* The LDAP authentication provider package. Interfaces are provided for both
1919
* authentication and retrieval of user roles from an LDAP server.
2020
* <p>
21-
* The main provider class is <tt>LdapAuthenticationProvider</tt>. This is configured with
22-
* an <tt>LdapAuthenticator</tt> instance and an <tt>LdapAuthoritiesPopulator</tt>. The
21+
* The main provider class is {@code LdapAuthenticationProvider}. This is configured with
22+
* an {@code LdapAuthenticator} instance and an {@code LdapAuthoritiesPopulator}. The
2323
* latter is used to obtain the list of roles for the user.
2424
*/
2525
@NullMarked

ldap/src/main/java/org/springframework/security/ldap/ppolicy/PasswordPolicyAwareContextSource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
import org.springframework.security.ldap.DefaultSpringSecurityContextSource;
2929

3030
/**
31-
* Extended version of the <tt>DefaultSpringSecurityContextSource</tt> which adds support
31+
* Extended version of the {@code DefaultSpringSecurityContextSource} which adds support
3232
* for the use of {@link PasswordPolicyControl} to make use of user account data stored in
3333
* the directory.
3434
* <p>
35-
* When binding with specific username (not the <tt>userDn</tt>) property it will connect
35+
* When binding with specific username (not the {@code userDn}) property it will connect
3636
* first as the userDn, then reconnect as the user in order to retrieve any
3737
* password-policy control sent with the response, even if an exception occurs.
3838
*

0 commit comments

Comments
 (0)