Polishing

This commit is contained in:
Juergen Hoeller
2016-12-13 13:02:23 +01:00
parent eeb7ae537f
commit 5169c51a6c
7 changed files with 27 additions and 22 deletions

View File

@@ -164,6 +164,7 @@ public class FreeMarkerView extends AbstractUrlBasedView {
@Override
protected Mono<Void> renderInternal(Map<String, Object> renderAttributes, MediaType contentType,
ServerWebExchange exchange) {
// Expose all standard FreeMarker hash models.
SimpleHash freeMarkerModel = getTemplateModel(renderAttributes, exchange);
if (logger.isDebugEnabled()) {
@@ -186,8 +187,8 @@ public class FreeMarkerView extends AbstractUrlBasedView {
return exchange.getResponse().writeWith(Flux.just(dataBuffer));
}
private static Optional<Charset> getCharset(MediaType mediaType) {
return mediaType != null ? Optional.ofNullable(mediaType.getCharset()) : Optional.empty();
private Optional<Charset> getCharset(MediaType mediaType) {
return (mediaType != null ? Optional.ofNullable(mediaType.getCharset()) : Optional.empty());
}
/**

View File

@@ -38,7 +38,6 @@ import org.springframework.web.reactive.socket.WebSocketSession;
*/
public class JettyWebSocketSession extends AbstractListenerWebSocketSession<Session> {
public JettyWebSocketSession(Session session) {
super(session, ObjectUtils.getIdentityHexString(session),
session.getUpgradeRequest().getRequestURI());
@@ -52,12 +51,12 @@ public class JettyWebSocketSession extends AbstractListenerWebSocketSession<Sess
@Override
protected void suspendReceiving() {
// No-op
// no-op
}
@Override
protected void resumeReceiving() {
// No-op
// no-op
}
@Override

View File

@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.web.reactive.socket.adapter;
import java.net.URI;
@@ -39,7 +40,6 @@ import org.springframework.web.reactive.socket.WebSocketSession;
*/
public class RxNettyWebSocketSession extends NettyWebSocketSessionSupport<WebSocketConnection> {
public RxNettyWebSocketSession(WebSocketConnection conn, URI uri, NettyDataBufferFactory factory) {
super(conn, uri, factory);
}

View File

@@ -40,7 +40,6 @@ import org.springframework.web.reactive.socket.WebSocketSession;
*/
public class TomcatWebSocketSession extends AbstractListenerWebSocketSession<Session> {
public TomcatWebSocketSession(Session session) {
super(session, session.getId(), session.getRequestURI());
}
@@ -53,12 +52,12 @@ public class TomcatWebSocketSession extends AbstractListenerWebSocketSession<Ses
@Override
protected void suspendReceiving() {
// No-op
// no-op
}
@Override
protected void resumeReceiving() {
// No-op
// no-op
}
@Override

View File

@@ -41,7 +41,6 @@ import org.springframework.web.reactive.socket.WebSocketSession;
*/
public class UndertowWebSocketSession extends AbstractListenerWebSocketSession<WebSocketChannel> {
public UndertowWebSocketSession(WebSocketChannel channel, URI url) {
super(channel, ObjectUtils.getIdentityHexString(channel), url);
}