Polishing

This commit is contained in:
Juergen Hoeller
2024-10-16 11:35:23 +02:00
parent a228eb8bd6
commit feb6a5f52d
12 changed files with 75 additions and 124 deletions

View File

@@ -187,7 +187,6 @@ class DefaultServerHttpRequestBuilder implements ServerHttpRequest.Builder {
private final ServerHttpRequest originalRequest;
public MutatedServerHttpRequest(URI uri, @Nullable String contextPath,
HttpMethod method, @Nullable SslInfo sslInfo, @Nullable InetSocketAddress remoteAddress,
HttpHeaders headers, Flux<DataBuffer> body, ServerHttpRequest originalRequest) {
@@ -227,7 +226,6 @@ class DefaultServerHttpRequestBuilder implements ServerHttpRequest.Builder {
return this.body;
}
@SuppressWarnings("unchecked")
@Override
public <T> T getNativeRequest() {
return ServerHttpRequestDecorator.getNativeRequest(this.originalRequest);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2024 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.
@@ -113,6 +113,11 @@ public class ServerHttpRequestDecorator implements ServerHttpRequest {
return getDelegate().getBody();
}
@Override
public String toString() {
return getClass().getSimpleName() + " [delegate=" + getDelegate() + "]";
}
/**
* Return the native request of the underlying server API, if possible,
@@ -130,15 +135,8 @@ public class ServerHttpRequestDecorator implements ServerHttpRequest {
return getNativeRequest(serverHttpRequestDecorator.getDelegate());
}
else {
throw new IllegalArgumentException(
"Can't find native request in " + request.getClass().getName());
throw new IllegalArgumentException("Cannot find native request in " + request.getClass().getName());
}
}
@Override
public String toString() {
return getClass().getSimpleName() + " [delegate=" + getDelegate() + "]";
}
}