Fix checkstyle

Issue gh-18530
This commit is contained in:
Robert Winch 2026-02-23 15:15:29 -06:00
parent d5ba9dcada
commit 53300be8d7
No known key found for this signature in database
3 changed files with 11 additions and 14 deletions

View File

@ -125,8 +125,7 @@ class AuthorizationFilterParser implements BeanDefinitionParser {
for (Element interceptMessage : interceptMessages) {
String accessExpression = interceptMessage.getAttribute(ATT_ACCESS);
if (!StringUtils.hasText(accessExpression)) {
parserContext.getReaderContext()
.error("access attribute cannot be empty or null", interceptMessage);
parserContext.getReaderContext().error("access attribute cannot be empty or null", interceptMessage);
continue;
}
BeanDefinitionBuilder authorizationManager = BeanDefinitionBuilder

View File

@ -144,8 +144,7 @@ public class FilterInvocationSecurityMetadataSourceParser implements BeanDefinit
String access = urlElt.getAttribute(ATT_ACCESS);
String path = urlElt.getAttribute(ATT_PATTERN);
if (!StringUtils.hasText(access)) {
parserContext.getReaderContext()
.error("access attribute cannot be empty or null", urlElt);
parserContext.getReaderContext().error("access attribute cannot be empty or null", urlElt);
continue;
}
String matcherRef = urlElt.getAttribute(HttpSecurityBeanDefinitionParser.ATT_REQUEST_MATCHER_REF);

View File

@ -343,8 +343,8 @@ public class InterceptUrlConfigTests {
@Test
public void configWhenInterceptUrlMissingAccessThenException() {
assertThatExceptionOfType(BeanDefinitionParsingException.class)
.isThrownBy(() -> this.spring.configLocations(this.xml("MissingAccess")).autowire())
.withMessageContaining("access attribute cannot be empty or null");
.isThrownBy(() -> this.spring.configLocations(this.xml("MissingAccess")).autowire())
.withMessageContaining("access attribute cannot be empty or null");
}
/**
@ -353,8 +353,8 @@ public class InterceptUrlConfigTests {
@Test
public void configWhenInterceptUrlEmptyAccessThenException() {
assertThatExceptionOfType(BeanDefinitionParsingException.class)
.isThrownBy(() -> this.spring.configLocations(this.xml("EmptyAccess")).autowire())
.withMessageContaining("access attribute cannot be empty or null");
.isThrownBy(() -> this.spring.configLocations(this.xml("EmptyAccess")).autowire())
.withMessageContaining("access attribute cannot be empty or null");
}
/**
@ -362,8 +362,7 @@ public class InterceptUrlConfigTests {
*/
@Test
public void configWhenInterceptUrlValidAccessThenLoads() {
assertThatNoException()
.isThrownBy(() -> this.spring.configLocations(this.xml("ValidAccess")).autowire());
assertThatNoException().isThrownBy(() -> this.spring.configLocations(this.xml("ValidAccess")).autowire());
}
/**
@ -372,8 +371,8 @@ public class InterceptUrlConfigTests {
@Test
public void configWhenUseAuthorizationManagerFalseAndMissingAccessThenException() {
assertThatExceptionOfType(BeanDefinitionParsingException.class)
.isThrownBy(() -> this.spring.configLocations(this.xml("MissingAccessLegacy")).autowire())
.withMessageContaining("access attribute cannot be empty or null");
.isThrownBy(() -> this.spring.configLocations(this.xml("MissingAccessLegacy")).autowire())
.withMessageContaining("access attribute cannot be empty or null");
}
/**
@ -382,8 +381,8 @@ public class InterceptUrlConfigTests {
@Test
public void configWhenUseAuthorizationManagerFalseAndEmptyAccessThenException() {
assertThatExceptionOfType(BeanDefinitionParsingException.class)
.isThrownBy(() -> this.spring.configLocations(this.xml("EmptyAccessLegacy")).autowire())
.withMessageContaining("access attribute cannot be empty or null");
.isThrownBy(() -> this.spring.configLocations(this.xml("EmptyAccessLegacy")).autowire())
.withMessageContaining("access attribute cannot be empty or null");
}
private static RequestPostProcessor adminCredentials() {