Skip to content

Polish: remove unused private fields, remove empty operator #1682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
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;
Expand All @@ -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
//---------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public void generateCode(MethodVisitor mv, CodeFlow cf) {
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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ private ModelAndView getModelAndView(MvcResult mvcResult) {
ModelAndView mav = mvcResult.getModelAndView();
if (mav == null) {
fail("No ModelAndView found");
};
}
return mav;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ private static class DefaultPathSegment implements PathSegment {

private final String value;

private final char[] valueAsChars;

private final String valueToMatch;

private final char[] valueToMatchAsChars;
Expand All @@ -206,7 +204,6 @@ private static class DefaultPathSegment implements PathSegment {
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public void onStartAsync(AsyncEvent event) {
public void onComplete(AsyncEvent event) {
// no-op
}
};
}


private class HandlerResultSubscriber implements Subscriber<Void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -37,20 +35,6 @@
*/
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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private static SubProtocolWebSocketHandler unwrapSubProtocolWebSocketHandler(Web
WebSocketHandler actual = WebSocketHandlerDecorator.unwrap(handler);
if (!(actual instanceof SubProtocolWebSocketHandler)) {
throw new IllegalArgumentException("No SubProtocolWebSocketHandler in " + handler);
};
}
return (SubProtocolWebSocketHandler) actual;
}

Expand Down