Apply SingleSpaceSeparator Checkstyle module

This commit also fixes its violations.

Closes gh-31469
This commit is contained in:
Johnny Lim
2023-10-22 00:10:45 +09:00
committed by Sam Brannen
parent 8a05661707
commit 64e9fcad53
164 changed files with 229 additions and 226 deletions

View File

@@ -245,7 +245,7 @@ class DefaultServerResponseBuilder implements ServerResponse.BodyBuilder {
return initBuilder(producer, BodyInserters.fromProducer(producer, elementTypeRef));
}
private <T> Mono<ServerResponse> initBuilder(T entity, BodyInserter<T, ReactiveHttpOutputMessage> inserter) {
private <T> Mono<ServerResponse> initBuilder(T entity, BodyInserter<T, ReactiveHttpOutputMessage> inserter) {
return new DefaultEntityResponseBuilder<>(entity, inserter)
.status(this.statusCode)
.headers(this.headers)

View File

@@ -1200,7 +1200,7 @@ public abstract class RequestPredicates {
@Override
public String toString() {
return method() + " " + path();
return method() + " " + path();
}
}

View File

@@ -901,7 +901,7 @@ public abstract class RouterFunctions {
* @return this builder
*/
Builder onError(Predicate<? super Throwable> predicate,
BiFunction<? super Throwable, ServerRequest, Mono<ServerResponse>> responseProvider);
BiFunction<? super Throwable, ServerRequest, Mono<ServerResponse>> responseProvider);
/**
* Filters all exceptions of the given type by applying the given response provider
@@ -1199,7 +1199,7 @@ public abstract class RouterFunctions {
}
private static class ResourcesRouterFunction extends AbstractRouterFunction<ServerResponse> {
private static class ResourcesRouterFunction extends AbstractRouterFunction<ServerResponse> {
private final Function<ServerRequest, Mono<Resource>> lookupFunction;

View File

@@ -325,7 +325,7 @@ public final class ProducesRequestCondition extends AbstractRequestCondition<Pro
* with a {@value MediaType#ALL_VALUE} expression.
*/
private List<ProduceMediaTypeExpression> getExpressionsToCompare() {
return (this.expressions.isEmpty() ? this.mediaTypeAllList : this.expressions);
return (this.expressions.isEmpty() ? this.mediaTypeAllList : this.expressions);
}

View File

@@ -134,7 +134,7 @@ class ModelInitializer {
}
private boolean isAsyncVoidType(ResolvableType type, MethodParameter typeSource, @Nullable ReactiveAdapter adapter) {
private boolean isAsyncVoidType(ResolvableType type, MethodParameter typeSource, @Nullable ReactiveAdapter adapter) {
Method method = typeSource.getMethod();
return (adapter != null && (adapter.isNoValue() || type.resolveGeneric() == Void.class)) ||
(method != null && KotlinDetector.isSuspendingFunction(method) && typeSource.getParameterType() == void.class);

View File

@@ -247,7 +247,7 @@ public abstract class AbstractView implements View, BeanNameAware, ApplicationCo
protected Mono<Void> resolveAsyncAttributes(Map<String, Object> model, ServerWebExchange exchange) {
List<Mono<?>> asyncAttributes = null;
for (Map.Entry<String, ?> entry : model.entrySet()) {
Object value = entry.getValue();
Object value = entry.getValue();
if (value == null) {
continue;
}

View File

@@ -204,7 +204,7 @@ public class FreeMarkerView extends AbstractUrlBasedView {
}
catch (ParseException ex) {
throw new ApplicationContextException(
"Failed to parse FreeMarker template for URL [" + getUrl() + "]", ex);
"Failed to parse FreeMarker template for URL [" + getUrl() + "]", ex);
}
catch (IOException ex) {
throw new ApplicationContextException(
@@ -225,7 +225,7 @@ public class FreeMarkerView extends AbstractUrlBasedView {
.switchIfEmpty(Mono.just(Boolean.FALSE))
.onErrorReturn(FileNotFoundException.class, Boolean.FALSE)
.onErrorMap(ParseException.class, ex -> new ApplicationContextException(
"Failed to parse FreeMarker template for URL [" + getUrl() + "]", ex))
"Failed to parse FreeMarker template for URL [" + getUrl() + "]", ex))
.onErrorMap(IOException.class, ex -> new ApplicationContextException(
"Could not load FreeMarker template for URL [" + getUrl() + "]", ex));
}

View File

@@ -50,7 +50,7 @@ public final class CloseStatus {
* "1002 indicates that an endpoint is terminating the connection due to a protocol
* error."
*/
public static final CloseStatus PROTOCOL_ERROR = new CloseStatus(1002);
public static final CloseStatus PROTOCOL_ERROR = new CloseStatus(1002);
/**
* "1003 indicates that an endpoint is terminating the connection because it has

View File

@@ -100,7 +100,7 @@ public class ViewResolverRegistryTests {
List<ViewResolver> viewResolvers = this.registry.getViewResolvers();
assertThat(viewResolvers).hasSize(1);
assertThat(viewResolvers.get(0).getClass()).isEqualTo(ScriptTemplateViewResolver.class);
DirectFieldAccessor accessor = new DirectFieldAccessor(viewResolvers.get(0));
DirectFieldAccessor accessor = new DirectFieldAccessor(viewResolvers.get(0));
assertThat(accessor.getPropertyValue("prefix")).isEqualTo("/");
assertThat(accessor.getPropertyValue("suffix")).isEqualTo(".html");
}

View File

@@ -181,7 +181,7 @@ class WebClientDataBufferAllocatingTests extends AbstractDataBufferAllocatingTes
.setHeader("Content-Type", "text/plain")
.setBody("foo bar"));
Mono<Void> result = this.webClient.get()
Mono<Void> result = this.webClient.get()
.exchangeToMono(ClientResponse::releaseBody);
StepVerifier.create(result)
@@ -198,7 +198,7 @@ class WebClientDataBufferAllocatingTests extends AbstractDataBufferAllocatingTes
.setHeader("Foo", "bar")
.setBody("foo bar"));
Mono<ResponseEntity<Void>> result = this.webClient.get()
Mono<ResponseEntity<Void>> result = this.webClient.get()
.exchangeToMono(ClientResponse::toBodilessEntity);
StepVerifier.create(result)

View File

@@ -92,11 +92,11 @@ public abstract class AbstractRequestMappingIntegrationTests extends AbstractHtt
if (out != null) {
headers.setAccept(Collections.singletonList(out));
}
return getRestTemplate().exchange(preparePost(url, headers, body), type);
return getRestTemplate().exchange(preparePost(url, headers, body), type);
}
<T> ResponseEntity<T> performPost(String url, HttpHeaders headers, Object body, Class<T> type) {
return getRestTemplate().exchange(preparePost(url, headers, body), type);
return getRestTemplate().exchange(preparePost(url, headers, body), type);
}
<T> ResponseEntity<T> performPost(String url, MediaType in, Object body, MediaType out, ParameterizedTypeReference<T> type) {

View File

@@ -83,7 +83,7 @@ public class ExpressionValueMethodArgumentResolverTests {
System.setProperty("systemProperty", "22");
try {
Mono<Object> mono = this.resolver.resolveArgument(
this.paramSystemProperty, new BindingContext(), this.exchange);
this.paramSystemProperty, new BindingContext(), this.exchange);
Object value = mono.block();
assertThat(value).isEqualTo(22);

View File

@@ -87,7 +87,7 @@ class HandshakeWebSocketServiceTests {
@Override
public Mono<Void> upgrade(ServerWebExchange exchange, WebSocketHandler webSocketHandler,
@Nullable String subProtocol, Supplier<HandshakeInfo> handshakeInfoFactory) {
@Nullable String subProtocol, Supplier<HandshakeInfo> handshakeInfoFactory) {
this.handshakeInfo = handshakeInfoFactory.get();
return Mono.empty();