提交 b67039d1 编写于 作者: A Arjen Poutsma

Fix checkstyle issue

上级 2e7f98d7
/*
* Copyright 2002-2019 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Provides the types that make up Spring's functional web framework for Reactive environments.
*/
......
......@@ -62,8 +62,9 @@ import org.springframework.web.servlet.ModelAndView;
*
* @author Arjen Poutsma
* @since 5.2
* @param <T> the entity type
*/
class DefaultEntityResponseBuilder<T> implements EntityResponse.Builder<T> {
final class DefaultEntityResponseBuilder<T> implements EntityResponse.Builder<T> {
private final T entity;
......
......@@ -220,7 +220,8 @@ class DefaultServerRequest implements ServerRequest {
.getAttribute(RouterFunctions.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
if (pathVariables != null) {
return pathVariables;
} else {
}
else {
return Collections.emptyMap();
}
}
......@@ -235,7 +236,9 @@ class DefaultServerRequest implements ServerRequest {
return Optional.ofNullable(this.serverHttpRequest.getPrincipal());
}
/**
* Default implementation of {@link Headers}.
*/
static class DefaultRequestHeaders implements Headers {
private final HttpHeaders delegate;
......@@ -298,7 +301,7 @@ class DefaultServerRequest implements ServerRequest {
}
}
private static class ServletParametersMap extends AbstractMap<String, List<String>> {
private static final class ServletParametersMap extends AbstractMap<String, List<String>> {
private final HttpServletRequest servletRequest;
......@@ -353,7 +356,7 @@ class DefaultServerRequest implements ServerRequest {
}
private static class ServletAttributesMap extends AbstractMap<String, Object> {
private static final class ServletAttributesMap extends AbstractMap<String, Object> {
private final HttpServletRequest servletRequest;
......
......@@ -283,7 +283,8 @@ class DefaultServerRequestBuilder implements ServerRequest.Builder {
.get(RouterFunctions.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
if (pathVariables != null) {
return pathVariables;
} else {
}
else {
return Collections.emptyMap();
}
}
......
......@@ -286,8 +286,9 @@ class DefaultServerResponseBuilder implements ServerResponse.BodyBuilder {
else {
return writeToInternal(request, response, context);
}
} catch (Throwable t) {
return handleError(t, request, response, context);
}
catch (Throwable throwable) {
return handleError(throwable, request, response, context);
}
}
......
......@@ -72,6 +72,7 @@ public interface EntityResponse<T> extends ServerResponse {
/**
* Defines a builder for {@code EntityResponse}.
* @param <T> the entity type
*/
interface Builder<T> {
......
......@@ -830,10 +830,11 @@ public abstract class RouterFunctions {
"Nested predicate \"%s\" matches against \"%s\"",
this.predicate, serverRequest));
}
Optional<HandlerFunction<T>> result = this.routerFunction.route(nestedRequest);
Optional<HandlerFunction<T>> result =
this.routerFunction.route(nestedRequest);
if (result.isPresent() && nestedRequest != serverRequest) {
serverRequest.attributes().clear();
serverRequest.attributes().putAll(nestedRequest.attributes());
serverRequest.attributes().clear();
serverRequest.attributes().putAll(nestedRequest.attributes());
}
return result;
}
......
......@@ -223,7 +223,7 @@ public interface ServerRequest {
// Static methods
/**
* Create a new {@code ServerRequest} based on the given {@code {@link HttpServletRequest} and
* Create a new {@code ServerRequest} based on the given {@code HttpServletRequest} and
* message converters.
* @param servletRequest the request
* @param messageReaders the message readers
......
......@@ -71,7 +71,8 @@ public interface ServerResponse {
MultiValueMap<String, Cookie> cookies();
/**
* Write this response to the servlet response (and return {@code null}, or return a
* Write this response to the servlet response (and return {@code null}, or return a model and
* view.
* @param request the current request
* @param response the response to write to
* @param context the context to use when writing
......
/*
* Copyright 2002-2019 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Classes supporting the {@code org.springframework.web.servlet.function} package.
* Contains a {@code HandlerAdapter} that supports {@code HandlerFunction}s,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册