Browse Source

Fix whitespace issues in format-off code

Fix a few whitespace issues in format-off code that would
otherwise fail checkstyle.

Issue gh-8945
pull/8983/head
Phillip Webb 5 years ago committed by Rob Winch
parent
commit
ee661f7b71
  1. 4
      config/src/main/java/org/springframework/security/config/annotation/web/configurers/JeeConfigurer.java
  2. 3
      config/src/test/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurerTests.java
  3. 2
      core/src/test/java/org/springframework/security/jackson2/UserDeserializerTests.java
  4. 2
      etc/checkstyle/checkstyle-suppressions.xml
  5. 3
      web/src/main/java/org/springframework/security/web/jackson2/CookieDeserializer.java
  6. 2
      web/src/test/java/org/springframework/security/web/jackson2/DefaultSavedRequestMixinTests.java
  7. 2
      web/src/test/java/org/springframework/security/web/jackson2/PreAuthenticatedAuthenticationTokenMixinTests.java

4
config/src/main/java/org/springframework/security/config/annotation/web/configurers/JeeConfigurer.java

@ -230,8 +230,8 @@ public final class JeeConfigurer<H extends HttpSecurityBuilder<H>> extends Abstr @@ -230,8 +230,8 @@ public final class JeeConfigurer<H extends HttpSecurityBuilder<H>> extends Abstr
* @return the {@link AuthenticationUserDetailsService} to use
*/
private AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken> getUserDetailsService() {
return (this.authenticationUserDetailsService != null)
? new PreAuthenticatedGrantedAuthoritiesUserDetailsService() : this.authenticationUserDetailsService;
return (this.authenticationUserDetailsService != null) ? this.authenticationUserDetailsService
: new PreAuthenticatedGrantedAuthoritiesUserDetailsService();
}
/**

3
config/src/test/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurerTests.java

@ -349,7 +349,8 @@ public class Saml2LoginConfigurerTests { @@ -349,7 +349,8 @@ public class Saml2LoginConfigurerTests {
.authorizeRequests((authz) -> authz
.anyRequest().authenticated()
)
.saml2Login((saml2) -> {});
.saml2Login((saml2) -> {
});
// @formatter:on
}

2
core/src/test/java/org/springframework/security/jackson2/UserDeserializerTests.java

@ -45,7 +45,7 @@ public class UserDeserializerTests extends AbstractMixinTests { @@ -45,7 +45,7 @@ public class UserDeserializerTests extends AbstractMixinTests {
public static final String USER_JSON = "{"
+ "\"@class\": \"org.springframework.security.core.userdetails.User\", "
+ "\"username\": \"admin\","
+ " \"password\": "+ USER_PASSWORD +", "
+ " \"password\": " + USER_PASSWORD + ", "
+ "\"accountNonExpired\": true, "
+ "\"accountNonLocked\": true, "
+ "\"credentialsNonExpired\": true, "

2
etc/checkstyle/checkstyle-suppressions.xml

@ -3,8 +3,6 @@ @@ -3,8 +3,6 @@
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
<suppressions>
<suppress files=".*" checks="WhitespaceAfter" />
<suppress files=".*" checks="WhitespaceAround" />
<suppress files=".*" checks="JavadocMethod" />
<suppress files=".*" checks="JavadocStyle" />
<suppress files=".*" checks="JavadocTagContinuationIndentation" />

3
web/src/main/java/org/springframework/security/web/jackson2/CookieDeserializer.java

@ -57,8 +57,7 @@ class CookieDeserializer extends JsonDeserializer<Cookie> { @@ -57,8 +57,7 @@ class CookieDeserializer extends JsonDeserializer<Cookie> {
}
private JsonNode readJsonNode(JsonNode jsonNode, String field) {
return hasNonNullField(jsonNode, field) ? jsonNode.get(field)
: MissingNode.getInstance();
return hasNonNullField(jsonNode, field) ? jsonNode.get(field) : MissingNode.getInstance();
}
private boolean hasNonNullField(JsonNode jsonNode, String field) {

2
web/src/test/java/org/springframework/security/web/jackson2/DefaultSavedRequestMixinTests.java

@ -58,7 +58,7 @@ public class DefaultSavedRequestMixinTests extends AbstractMixinTests { @@ -58,7 +58,7 @@ public class DefaultSavedRequestMixinTests extends AbstractMixinTests {
// @formatter:off
private static final String REQUEST_JSON = "{" +
"\"@class\": \"org.springframework.security.web.savedrequest.DefaultSavedRequest\", "
+ "\"cookies\": "+ COOKIES_JSON +","
+ "\"cookies\": " + COOKIES_JSON + ","
+ "\"locales\": [\"java.util.ArrayList\", [\"en\"]], "
+ "\"headers\": {\"@class\": \"java.util.TreeMap\", \"x-auth-token\": [\"java.util.ArrayList\", [\"12\"]]}, "
+ "\"parameters\": {\"@class\": \"java.util.TreeMap\"},"

2
web/src/test/java/org/springframework/security/web/jackson2/PreAuthenticatedAuthenticationTokenMixinTests.java

@ -41,7 +41,7 @@ public class PreAuthenticatedAuthenticationTokenMixinTests extends AbstractMixin @@ -41,7 +41,7 @@ public class PreAuthenticatedAuthenticationTokenMixinTests extends AbstractMixin
+ "\"credentials\": \"credentials\", "
+ "\"authenticated\": true, "
+ "\"details\": null, "
+ "\"authorities\": "+ SimpleGrantedAuthorityMixinTests.AUTHORITIES_ARRAYLIST_JSON
+ "\"authorities\": " + SimpleGrantedAuthorityMixinTests.AUTHORITIES_ARRAYLIST_JSON
+ "}";
// @formatter:on

Loading…
Cancel
Save