Skip to content

Commit 88369cd

Browse files
ngocnhan-tran1996jzheaux
authored andcommitted
Polish
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
1 parent c9bbf37 commit 88369cd

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

core/src/main/java/org/springframework/security/provisioning/JdbcUserDetailsManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ public void setUserCache(UserCache userCache) {
605605
* set this to {@code true} to enable password updates.
606606
* @param enableUpdatePassword {@code true} to enable password updates, {@code false}
607607
* otherwise.
608+
* @since 7.0
608609
*/
609610
public void setEnableUpdatePassword(boolean enableUpdatePassword) {
610611
this.enableUpdatePassword = enableUpdatePassword;
@@ -626,6 +627,7 @@ private void validateAuthorities(Collection<? extends GrantedAuthority> authorit
626627
/**
627628
* Conditionally updates password based on the setting from
628629
* {@link #setEnableUpdatePassword(boolean)}. {@inheritDoc}
630+
* @since 7.0
629631
*/
630632
@Override
631633
public UserDetails updatePassword(UserDetails user, String newPassword) {

core/src/test/java/org/springframework/security/provisioning/JdbcUserDetailsManagerTests.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,9 @@ public void findGroupMembersReturnsCorrectData() {
285285
}
286286

287287
@Test
288-
@SuppressWarnings("unchecked")
289288
public void createGroupInsertsCorrectData() {
290289
this.manager.createGroup("TEST_GROUP", AuthorityUtils.createAuthorityList("ROLE_X", "ROLE_Y"));
291-
List roles = this.template.queryForList("select ga.authority from groups g, group_authorities ga "
290+
List<?> roles = this.template.queryForList("select ga.authority from groups g, group_authorities ga "
292291
+ "where ga.group_id = g.id " + "and g.group_name = 'TEST_GROUP'");
293292
assertThat(roles).hasSize(2);
294293
}
@@ -367,7 +366,7 @@ public void updateUserDoesNotSaveAuthoritiesIfEnableAuthoritiesIsFalse() {
367366

368367
// SEC-2166
369368
@Test
370-
public void createNewAuthenticationUsesNullPasswordToKeepPassordsSave() {
369+
public void createNewAuthenticationUsesNullPasswordToKeepPasswordSave() {
371370
insertJoe();
372371
UsernamePasswordAuthenticationToken currentAuth = UsernamePasswordAuthenticationToken.authenticated("joe", null,
373372
AuthorityUtils.createAuthorityList("ROLE_USER"));
@@ -443,9 +442,9 @@ private void insertJoe() {
443442
this.cache.putUserInCache(joe);
444443
}
445444

446-
private class MockUserCache implements UserCache {
445+
private static class MockUserCache implements UserCache {
447446

448-
private Map<String, UserDetails> cache = new HashMap<>();
447+
private final Map<String, UserDetails> cache = new HashMap<>();
449448

450449
@Override
451450
public UserDetails getUserFromCache(String username) {

0 commit comments

Comments
 (0)