提交 45e520ed 编写于 作者: I igor-suhorukov 提交者: Juergen Hoeller

Polish: remove unused private fields, remove empty operator

上级 1908080d
......@@ -31,7 +31,6 @@ import java.nio.file.StandardOpenOption;
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.BinaryOperator;
import java.util.function.Consumer;
import org.reactivestreams.Publisher;
......@@ -57,13 +56,6 @@ public abstract class DataBufferUtils {
private static final Consumer<DataBuffer> RELEASE_CONSUMER = DataBufferUtils::release;
private static final BinaryOperator<DataBuffer> WRITE_AGGREGATOR =
(dataBuffer1, dataBuffer2) -> {
DataBuffer result = dataBuffer1.write(dataBuffer2);
release(dataBuffer2);
return result;
};
//---------------------------------------------------------------------
// Reading
//---------------------------------------------------------------------
......
......@@ -321,7 +321,7 @@ public class MethodReference extends SpelNodeImpl {
Class<?> publicDeclaringClass = methodExecutor.getPublicDeclaringClass();
Assert.state(publicDeclaringClass != null, "No public declaring class");
classDesc = publicDeclaringClass.getName().replace('.', '/');
};
}
if (!isStaticMethod) {
if (descriptor == null || !descriptor.substring(1).equals(classDesc)) {
......
......@@ -239,7 +239,7 @@ public class ModelResultMatchers {
ModelAndView mav = mvcResult.getModelAndView();
if (mav == null) {
fail("No ModelAndView found");
};
}
return mav;
}
......
......@@ -194,8 +194,6 @@ class DefaultPathContainer implements PathContainer {
private final String value;
private final char[] valueAsChars;
private final String valueToMatch;
private final char[] valueToMatchAsChars;
......@@ -206,7 +204,6 @@ class DefaultPathContainer implements PathContainer {
DefaultPathSegment(String value, String valueToMatch, MultiValueMap<String, String> params) {
Assert.isTrue(!value.contains("/"), () -> "Invalid path segment value: " + value);
this.value = value;
this.valueAsChars = value.toCharArray();
this.valueToMatch = valueToMatch;
this.valueToMatchAsChars = valueToMatch.toCharArray();
this.parameters = CollectionUtils.unmodifiableMultiValueMap(params);
......
......@@ -254,7 +254,7 @@ public class ServletHttpHandlerAdapter implements Servlet {
public void onComplete(AsyncEvent event) {
// no-op
}
};
}
private class HandlerResultSubscriber implements Subscriber<Void> {
......
......@@ -40,7 +40,7 @@ import org.springframework.util.ObjectUtils;
*/
public class DefaultUriBuilderFactory implements UriBuilderFactory {
public enum EncodingMode {URI_COMPONENT, VALUES_ONLY, NONE };
public enum EncodingMode {URI_COMPONENT, VALUES_ONLY, NONE }
private final UriComponentsBuilder baseUri;
......
......@@ -16,11 +16,9 @@
package org.springframework.web.reactive.result;
import java.lang.reflect.Method;
import reactor.core.publisher.Mono;
import org.springframework.core.MethodParameter;
import org.springframework.web.reactive.DispatcherHandler;
import org.springframework.web.reactive.HandlerAdapter;
import org.springframework.web.reactive.HandlerResult;
......@@ -37,20 +35,6 @@ import org.springframework.web.server.WebHandler;
*/
public class SimpleHandlerAdapter implements HandlerAdapter {
private static final MethodParameter RETURN_TYPE;
static {
try {
Method method = WebHandler.class.getMethod("handle", ServerWebExchange.class);
RETURN_TYPE = new MethodParameter(method, -1);
}
catch (NoSuchMethodException ex) {
throw new IllegalStateException(
"Failed to initialize the return type for WebHandler: " + ex.getMessage());
}
}
@Override
public boolean supports(Object handler) {
return WebHandler.class.isAssignableFrom(handler.getClass());
......
......@@ -90,7 +90,7 @@ public class WebMvcStompEndpointRegistry implements StompEndpointRegistry {
WebSocketHandler actual = WebSocketHandlerDecorator.unwrap(handler);
if (!(actual instanceof SubProtocolWebSocketHandler)) {
throw new IllegalArgumentException("No SubProtocolWebSocketHandler in " + handler);
};
}
return (SubProtocolWebSocketHandler) actual;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册