Fix nullability for JDK 25
Closes gh-18511
This commit is contained in:
+1
-1
@@ -147,7 +147,7 @@ public final class PreFilterAuthorizationMethodInterceptor implements Authorizat
|
||||
+ "' found in method.");
|
||||
}
|
||||
else {
|
||||
Object[] arguments = methodInvocation.getArguments();
|
||||
@Nullable Object[] arguments = methodInvocation.getArguments();
|
||||
Assert.state(arguments.length == 1,
|
||||
"Unable to determine the method argument for filtering. Specify the filter target.");
|
||||
filterTarget = arguments[0];
|
||||
|
||||
+3
-3
@@ -136,9 +136,9 @@ public final class PreFilterAuthorizationReactiveMethodInterceptor implements Au
|
||||
Object target = mi.getThis();
|
||||
Class<?> targetClass = (target != null) ? AopUtils.getTargetClass(target) : null;
|
||||
Method specificMethod = AopUtils.getMostSpecificMethod(mi.getMethod(), targetClass);
|
||||
String[] parameterNames = this.parameterNameDiscoverer.getParameterNames(specificMethod);
|
||||
@Nullable String @Nullable [] parameterNames = this.parameterNameDiscoverer.getParameterNames(specificMethod);
|
||||
if (parameterNames != null && parameterNames.length > 0) {
|
||||
Object[] arguments = mi.getArguments();
|
||||
@Nullable Object[] arguments = mi.getArguments();
|
||||
for (index = 0; index < parameterNames.length; index++) {
|
||||
if (name.equals(parameterNames[index])) {
|
||||
value = arguments[index];
|
||||
@@ -150,7 +150,7 @@ public final class PreFilterAuthorizationReactiveMethodInterceptor implements Au
|
||||
}
|
||||
}
|
||||
else {
|
||||
Object[] arguments = mi.getArguments();
|
||||
@Nullable Object[] arguments = mi.getArguments();
|
||||
Assert.state(arguments.length == 1,
|
||||
"Unable to determine the method argument for filtering. Specify the filter target.");
|
||||
value = arguments[0];
|
||||
|
||||
+14
-2
@@ -20,6 +20,8 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
@@ -356,13 +358,23 @@ public class JdbcUserDetailsManager extends JdbcDaoImpl
|
||||
|
||||
@Override
|
||||
public List<String> findAllGroups() {
|
||||
return requireJdbcTemplate().queryForList(this.findAllGroupsSql, String.class);
|
||||
// @formatter:off
|
||||
return requireJdbcTemplate().queryForList(this.findAllGroupsSql, String.class)
|
||||
.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
// @formatter:on
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findUsersInGroup(String groupName) {
|
||||
Assert.hasText(groupName, "groupName should have text");
|
||||
return requireJdbcTemplate().queryForList(this.findUsersInGroupSql, String.class, groupName);
|
||||
// @formatter:off
|
||||
return requireJdbcTemplate().queryForList(this.findUsersInGroupSql, String.class, groupName)
|
||||
.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
// @formatter:on
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user