|
@@ -182,7 +182,7 @@ public class JdbcDaoImpl extends JdbcDaoSupport implements UserDetailsService, M
|
|
@Override
|
|
@Override
|
|
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
|
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
|
List<UserDetails> users = loadUsersByUsername(username);
|
|
List<UserDetails> users = loadUsersByUsername(username);
|
|
- if (users.size() == 0) {
|
|
|
|
|
|
+ if (users.isEmpty()) {
|
|
this.logger.debug("Query returned no results for user '" + username + "'");
|
|
this.logger.debug("Query returned no results for user '" + username + "'");
|
|
throw new UsernameNotFoundException(this.messages.getMessage("JdbcDaoImpl.notFound",
|
|
throw new UsernameNotFoundException(this.messages.getMessage("JdbcDaoImpl.notFound",
|
|
new Object[] { username }, "Username {0} not found"));
|
|
new Object[] { username }, "Username {0} not found"));
|
|
@@ -197,7 +197,7 @@ public class JdbcDaoImpl extends JdbcDaoSupport implements UserDetailsService, M
|
|
}
|
|
}
|
|
List<GrantedAuthority> dbAuths = new ArrayList<>(dbAuthsSet);
|
|
List<GrantedAuthority> dbAuths = new ArrayList<>(dbAuthsSet);
|
|
addCustomAuthorities(user.getUsername(), dbAuths);
|
|
addCustomAuthorities(user.getUsername(), dbAuths);
|
|
- if (dbAuths.size() == 0) {
|
|
|
|
|
|
+ if (dbAuths.isEmpty()) {
|
|
this.logger.debug("User '" + username + "' has no authorities and will be treated as 'not found'");
|
|
this.logger.debug("User '" + username + "' has no authorities and will be treated as 'not found'");
|
|
throw new UsernameNotFoundException(this.messages.getMessage("JdbcDaoImpl.noAuthority",
|
|
throw new UsernameNotFoundException(this.messages.getMessage("JdbcDaoImpl.noAuthority",
|
|
new Object[] { username }, "User {0} has no GrantedAuthority"));
|
|
new Object[] { username }, "User {0} has no GrantedAuthority"));
|