Fix WhitespaceAfterCheck Checkstyle check
This commit is contained in:
+5
-5
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -149,7 +149,7 @@ public abstract class AbstractPreAuthenticatedProcessingFilter extends GenericFi
|
||||
return false;
|
||||
}
|
||||
|
||||
if(logger.isDebugEnabled()) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Pre-authenticated principal has changed to " + principal + " and will be reauthenticated");
|
||||
}
|
||||
return true;
|
||||
@@ -205,7 +205,7 @@ public abstract class AbstractPreAuthenticatedProcessingFilter extends GenericFi
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!principalChanged(request, currentUser)) {
|
||||
if (!principalChanged(request, currentUser)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ public abstract class AbstractPreAuthenticatedProcessingFilter extends GenericFi
|
||||
authResult, this.getClass()));
|
||||
}
|
||||
|
||||
if(authenticationSuccessHandler != null) {
|
||||
if (authenticationSuccessHandler != null) {
|
||||
authenticationSuccessHandler.onAuthenticationSuccess(request, response, authResult);
|
||||
}
|
||||
}
|
||||
@@ -262,7 +262,7 @@ public abstract class AbstractPreAuthenticatedProcessingFilter extends GenericFi
|
||||
}
|
||||
request.setAttribute(WebAttributes.AUTHENTICATION_EXCEPTION, failed);
|
||||
|
||||
if(authenticationFailureHandler != null) {
|
||||
if (authenticationFailureHandler != null) {
|
||||
authenticationFailureHandler.onAuthenticationFailure(request, response, failed);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -295,7 +295,7 @@ public class DefaultLoginPageGeneratingFilter extends GenericFilterBean {
|
||||
|
||||
private String renderHiddenInputs(HttpServletRequest request) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for(Map.Entry<String, String> input : this.resolveHiddenInputs.apply(request).entrySet()) {
|
||||
for (Map.Entry<String, String> input : this.resolveHiddenInputs.apply(request).entrySet()) {
|
||||
sb.append("<input name=\"").append(input.getKey()).append("\" type=\"hidden\" value=\"").append(input.getValue()).append("\" />\n");
|
||||
}
|
||||
return sb.toString();
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ public class DefaultLogoutPageGeneratingFilter extends OncePerRequestFilter {
|
||||
|
||||
private String renderHiddenInputs(HttpServletRequest request) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for(Map.Entry<String, String> input : this.resolveHiddenInputs.apply(request).entrySet()) {
|
||||
for (Map.Entry<String, String> input : this.resolveHiddenInputs.apply(request).entrySet()) {
|
||||
sb.append("<input name=\"").append(input.getKey()).append("\" type=\"hidden\" value=\"").append(input.getValue()).append("\" />\n");
|
||||
}
|
||||
return sb.toString();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -58,7 +58,7 @@ class FirewalledResponse extends HttpServletResponseWrapper {
|
||||
|
||||
@Override
|
||||
public void addCookie(Cookie cookie) {
|
||||
if(cookie != null) {
|
||||
if (cookie != null) {
|
||||
validateCrlf(SET_COOKIE_HEADER, cookie.getName());
|
||||
validateCrlf(SET_COOKIE_HEADER, cookie.getValue());
|
||||
validateCrlf(SET_COOKIE_HEADER, cookie.getPath());
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -83,7 +83,7 @@ public final class XFrameOptionsHeaderWriter implements HeaderWriter {
|
||||
public void writeHeaders(HttpServletRequest request, HttpServletResponse response) {
|
||||
if (XFrameOptionsMode.ALLOW_FROM.equals(frameOptionsMode)) {
|
||||
String allowFromValue = this.allowFromStrategy.getAllowFromValue(request);
|
||||
if(XFrameOptionsMode.DENY.getMode().equals(allowFromValue)) {
|
||||
if (XFrameOptionsMode.DENY.getMode().equals(allowFromValue)) {
|
||||
response.setHeader(XFRAME_OPTIONS_HEADER, XFrameOptionsMode.DENY.getMode());
|
||||
} else if (allowFromValue != null) {
|
||||
response.setHeader(XFRAME_OPTIONS_HEADER,
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 the original author or authors.
|
||||
* Copyright 2015-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -61,7 +61,7 @@ class PreAuthenticatedAuthenticationTokenDeserializer extends JsonDeserializer<P
|
||||
Boolean authenticated = readJsonNode(jsonNode, "authenticated").asBoolean();
|
||||
JsonNode principalNode = readJsonNode(jsonNode, "principal");
|
||||
Object principal = null;
|
||||
if(principalNode.isObject()) {
|
||||
if (principalNode.isObject()) {
|
||||
principal = mapper.readValue(principalNode.traverse(mapper), Object.class);
|
||||
} else {
|
||||
principal = principalNode.asText();
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -67,7 +67,7 @@ public class CsrfRequestDataValueProcessor implements RequestDataValueProcessor
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
CsrfToken token = exchange.getAttribute(DEFAULT_CSRF_ATTR_NAME);
|
||||
if(token == null) {
|
||||
if (token == null) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
return Collections.singletonMap(token.getParameterName(), token.getToken());
|
||||
|
||||
+1
-1
@@ -492,7 +492,7 @@ public class DefaultSavedRequest implements SavedRequest {
|
||||
|
||||
public DefaultSavedRequest build() {
|
||||
DefaultSavedRequest savedRequest = new DefaultSavedRequest(this);
|
||||
if(!ObjectUtils.isEmpty(this.cookies)) {
|
||||
if (!ObjectUtils.isEmpty(this.cookies)) {
|
||||
for (SavedCookie cookie : this.cookies) {
|
||||
savedRequest.addCookie(cookie.getCookie());
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -46,11 +46,11 @@ public class DefaultServerRedirectStrategy implements ServerRedirectStrategy {
|
||||
}
|
||||
|
||||
private URI createLocation(ServerWebExchange exchange, URI location) {
|
||||
if(!this.contextRelative) {
|
||||
if (!this.contextRelative) {
|
||||
return location;
|
||||
}
|
||||
String url = location.toASCIIString();
|
||||
if(url.startsWith("/")) {
|
||||
if (url.startsWith("/")) {
|
||||
String context = exchange.getRequest().getPath().contextPath().value();
|
||||
return URI.create(context + url);
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -46,7 +46,7 @@ public class ServerHttpBasicAuthenticationConverter implements
|
||||
ServerHttpRequest request = exchange.getRequest();
|
||||
|
||||
String authorization = request.getHeaders().getFirst(HttpHeaders.AUTHORIZATION);
|
||||
if(authorization == null || !authorization.toLowerCase().startsWith("basic ")) {
|
||||
if (authorization == null || !authorization.toLowerCase().startsWith("basic ")) {
|
||||
return Mono.empty();
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class ServerHttpBasicAuthenticationConverter implements
|
||||
String decodedAuthz = new String(decodedCredentials);
|
||||
String[] userParts = decodedAuthz.split(":");
|
||||
|
||||
if(userParts.length != 2) {
|
||||
if (userParts.length != 2) {
|
||||
return Mono.empty();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -52,7 +52,7 @@ public class WebSessionServerSecurityContextRepository
|
||||
public Mono<Void> save(ServerWebExchange exchange, SecurityContext context) {
|
||||
return exchange.getSession()
|
||||
.doOnNext(session -> {
|
||||
if(context == null) {
|
||||
if (context == null) {
|
||||
session.getAttributes().remove(this.springSecurityContextAttrName);
|
||||
} else {
|
||||
session.getAttributes().put(this.springSecurityContextAttrName, context);
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -43,7 +43,7 @@ public class StaticServerHttpHeadersWriter implements ServerHttpHeadersWriter {
|
||||
public Mono<Void> writeHttpHeaders(ServerWebExchange exchange) {
|
||||
HttpHeaders headers = exchange.getResponse().getHeaders();
|
||||
boolean containsOneHeaderToAdd = Collections.disjoint(headers.keySet(), this.headersToAdd.keySet());
|
||||
if(containsOneHeaderToAdd) {
|
||||
if (containsOneHeaderToAdd) {
|
||||
this.headersToAdd.forEach((name, values) -> {
|
||||
headers.put(name, values);
|
||||
});
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -108,7 +108,7 @@ public class XXssProtectionServerHttpHeadersWriter implements ServerHttpHeadersW
|
||||
if (!enabled) {
|
||||
return "0";
|
||||
}
|
||||
if(!block) {
|
||||
if (!block) {
|
||||
return "1";
|
||||
}
|
||||
return "1 ; mode=block";
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -61,12 +61,12 @@ public final class PathPatternParserServerWebExchangeMatcher implements ServerWe
|
||||
@Override
|
||||
public Mono<MatchResult> matches(ServerWebExchange exchange) {
|
||||
ServerHttpRequest request = exchange.getRequest();
|
||||
if(this.method != null && !this.method.equals(request.getMethod())) {
|
||||
if (this.method != null && !this.method.equals(request.getMethod())) {
|
||||
return MatchResult.notMatch();
|
||||
}
|
||||
PathContainer path = request.getPath().pathWithinApplication();
|
||||
boolean match = this.pattern.matches(path);
|
||||
if(!match) {
|
||||
if (!match) {
|
||||
return MatchResult.notMatch();
|
||||
}
|
||||
Map<String, String> pathVariables = this.pattern.matchAndExtract(path).getUriVariables();
|
||||
|
||||
@@ -137,7 +137,7 @@ public final class UrlUtils {
|
||||
* defined in RFC 1738.
|
||||
*/
|
||||
public static boolean isAbsoluteUrl(String url) {
|
||||
if(url == null) {
|
||||
if (url == null) {
|
||||
return false;
|
||||
}
|
||||
final Pattern ABSOLUTE_URL = Pattern.compile("\\A[a-z0-9.+-]+://.*",
|
||||
|
||||
Reference in New Issue
Block a user