diff --git a/spring-aspects/src/main/java/org/springframework/transaction/aspectj/JtaAnnotationTransactionAspect.aj b/spring-aspects/src/main/java/org/springframework/transaction/aspectj/JtaAnnotationTransactionAspect.aj
index 6b02e1de3a5..22a3bb134b5 100644
--- a/spring-aspects/src/main/java/org/springframework/transaction/aspectj/JtaAnnotationTransactionAspect.aj
+++ b/spring-aspects/src/main/java/org/springframework/transaction/aspectj/JtaAnnotationTransactionAspect.aj
@@ -45,7 +45,7 @@ import org.springframework.transaction.annotation.AnnotationTransactionAttribute
* @see javax.transaction.Transactional
* @see AnnotationTransactionAspect
*/
-@RequiredTypes({"javax.transaction.Transactional"})
+@RequiredTypes("javax.transaction.Transactional")
public aspect JtaAnnotationTransactionAspect extends AbstractTransactionAspect {
public JtaAnnotationTransactionAspect() {
diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MessageMethodArgumentResolver.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MessageMethodArgumentResolver.java
index 2d695d8adff..8a337715a50 100644
--- a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MessageMethodArgumentResolver.java
+++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MessageMethodArgumentResolver.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2018 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.
@@ -97,7 +97,7 @@ public class MessageMethodArgumentResolver implements HandlerMethodArgumentResol
private Class> getPayloadType(MethodParameter parameter) {
Type genericParamType = parameter.getGenericParameterType();
ResolvableType resolvableType = ResolvableType.forType(genericParamType).as(Message.class);
- return resolvableType.getGeneric(0).resolve(Object.class);
+ return resolvableType.getGeneric().resolve(Object.class);
}
/**
diff --git a/spring-test/src/main/java/org/springframework/mock/http/client/reactive/MockClientHttpRequest.java b/spring-test/src/main/java/org/springframework/mock/http/client/reactive/MockClientHttpRequest.java
index d6fc9ebd002..0ebf84dc1d8 100644
--- a/spring-test/src/main/java/org/springframework/mock/http/client/reactive/MockClientHttpRequest.java
+++ b/spring-test/src/main/java/org/springframework/mock/http/client/reactive/MockClientHttpRequest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2018 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.
@@ -36,6 +36,7 @@ import org.springframework.web.util.UriComponentsBuilder;
/**
* Mock implementation of {@link ClientHttpRequest}.
+ *
* @author Brian Clozel
* @author Rossen Stoyanchev
* @since 5.0
@@ -97,11 +98,9 @@ public class MockClientHttpRequest extends AbstractClientHttpRequest {
/**
* Configure a custom handler for writing the request body.
- *
*
The default write handler consumes and caches the request body so it
* may be accessed subsequently, e.g. in test assertions. Use this property
* when the request body is an infinite stream.
- *
* @param writeHandler the write handler to use returning {@code Mono}
* when the body has been "written" (i.e. consumed).
*/
diff --git a/spring-test/src/main/java/org/springframework/mock/http/server/reactive/MockServerHttpResponse.java b/spring-test/src/main/java/org/springframework/mock/http/server/reactive/MockServerHttpResponse.java
index 14665c9c93a..325fb3d4619 100644
--- a/spring-test/src/main/java/org/springframework/mock/http/server/reactive/MockServerHttpResponse.java
+++ b/spring-test/src/main/java/org/springframework/mock/http/server/reactive/MockServerHttpResponse.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2017 the original author or authors.
+ * Copyright 2002-2018 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.
@@ -125,10 +125,8 @@ public class MockServerHttpResponse extends AbstractServerHttpResponse {
* charset or "UTF-8" by default.
*/
public Mono getBodyAsString() {
-
Charset charset = Optional.ofNullable(getHeaders().getContentType()).map(MimeType::getCharset)
.orElse(StandardCharsets.UTF_8);
-
return getBody()
.reduce(bufferFactory().allocateBuffer(), (previous, current) -> {
previous.write(current);
@@ -139,7 +137,6 @@ public class MockServerHttpResponse extends AbstractServerHttpResponse {
}
private static String bufferToString(DataBuffer buffer, Charset charset) {
- Assert.notNull(charset, "'charset' must not be null");
byte[] bytes = new byte[buffer.readableByteCount()];
buffer.read(bytes);
return new String(bytes, charset);
diff --git a/spring-test/src/main/java/org/springframework/test/web/client/AbstractRequestExpectationManager.java b/spring-test/src/main/java/org/springframework/test/web/client/AbstractRequestExpectationManager.java
index c62200b3e7b..460d7b4f3e5 100644
--- a/spring-test/src/main/java/org/springframework/test/web/client/AbstractRequestExpectationManager.java
+++ b/spring-test/src/main/java/org/springframework/test/web/client/AbstractRequestExpectationManager.java
@@ -239,13 +239,16 @@ public abstract class AbstractRequestExpectationManager implements RequestExpect
/**
* Add expectations to this group.
- * @deprecated as of 5.0.3 please use {@link #addAllExpectations(Collection)} instead.
+ * @deprecated as of 5.0.3, if favor of {@link #addAllExpectations}
*/
@Deprecated
public void updateAll(Collection expectations) {
expectations.forEach(this::updateInternal);
}
+ /**
+ * Reset all expectations for this group.
+ */
public void reset() {
this.expectations.clear();
}
diff --git a/spring-web/src/main/java/org/springframework/http/codec/ServerSentEventHttpMessageReader.java b/spring-web/src/main/java/org/springframework/http/codec/ServerSentEventHttpMessageReader.java
index 1d17ba88363..1897a56d741 100644
--- a/spring-web/src/main/java/org/springframework/http/codec/ServerSentEventHttpMessageReader.java
+++ b/spring-web/src/main/java/org/springframework/http/codec/ServerSentEventHttpMessageReader.java
@@ -103,7 +103,7 @@ public class ServerSentEventHttpMessageReader implements HttpMessageReader hints) {
boolean shouldWrap = isServerSentEvent(elementType);
- ResolvableType valueType = (shouldWrap ? elementType.getGeneric(0) : elementType);
+ ResolvableType valueType = (shouldWrap ? elementType.getGeneric() : elementType);
return stringDecoder.decode(message.getBody(), STRING_TYPE, null, Collections.emptyMap())
.bufferUntil(line -> line.equals(""))
diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/AbstractMessageWriterResultHandler.java b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/AbstractMessageWriterResultHandler.java
index c73daa3f82a..8fbfe0af9c3 100644
--- a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/AbstractMessageWriterResultHandler.java
+++ b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/AbstractMessageWriterResultHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2017 the original author or authors.
+ * Copyright 2002-2018 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.
@@ -123,7 +123,7 @@ public abstract class AbstractMessageWriterResultHandler extends HandlerResultHa
ResolvableType elementType;
if (adapter != null) {
publisher = adapter.toPublisher(body);
- ResolvableType genericType = bodyType.getGeneric(0);
+ ResolvableType genericType = bodyType.getGeneric();
elementType = getElementType(adapter, genericType);
}
else {
diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/result/view/AbstractView.java b/spring-webflux/src/main/java/org/springframework/web/reactive/result/view/AbstractView.java
index 5841b899a9a..601ca736f8a 100644
--- a/spring-webflux/src/main/java/org/springframework/web/reactive/result/view/AbstractView.java
+++ b/spring-webflux/src/main/java/org/springframework/web/reactive/result/view/AbstractView.java
@@ -56,9 +56,9 @@ public abstract class AbstractView implements View, ApplicationContextAware {
private static final Object NO_VALUE = new Object();
- private final List mediaTypes = new ArrayList<>(4);
+ private final ReactiveAdapterRegistry reactiveAdapterRegistry;
- private final ReactiveAdapterRegistry adapterRegistry;
+ private final List mediaTypes = new ArrayList<>(4);
private Charset defaultCharset = StandardCharsets.UTF_8;
@@ -73,9 +73,9 @@ public abstract class AbstractView implements View, ApplicationContextAware {
this(ReactiveAdapterRegistry.getSharedInstance());
}
- public AbstractView(ReactiveAdapterRegistry registry) {
+ public AbstractView(ReactiveAdapterRegistry reactiveAdapterRegistry) {
+ this.reactiveAdapterRegistry = reactiveAdapterRegistry;
this.mediaTypes.add(ViewResolverSupport.DEFAULT_CONTENT_TYPE);
- this.adapterRegistry = registry;
}
@@ -155,7 +155,7 @@ public abstract class AbstractView implements View, ApplicationContextAware {
/**
* Prepare the model to render.
- * @param model Map with name Strings as keys and corresponding model
+ * @param model a Map with name Strings as keys and corresponding model
* objects as values (Map can also be {@code null} in case of empty model)
* @param contentType the content type selected to render with which should
* match one of the {@link #getSupportedMediaTypes() supported media types}.
@@ -209,7 +209,6 @@ public abstract class AbstractView implements View, ApplicationContextAware {
* @return {@code Mono} for the completion of async attributes resolution
*/
protected Mono resolveAsyncAttributes(Map model) {
-
List names = new ArrayList<>();
List> valueMonos = new ArrayList<>();
@@ -218,7 +217,7 @@ public abstract class AbstractView implements View, ApplicationContextAware {
if (value == null) {
continue;
}
- ReactiveAdapter adapter = this.adapterRegistry.getAdapter(null, value);
+ ReactiveAdapter adapter = this.reactiveAdapterRegistry.getAdapter(null, value);
if (adapter != null) {
names.add(entry.getKey());
if (adapter.isMultiValue()) {
diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/support/AbstractAnnotationConfigDispatcherHandlerInitializer.java b/spring-webflux/src/main/java/org/springframework/web/reactive/support/AbstractAnnotationConfigDispatcherHandlerInitializer.java
index ff9dafe9ef8..f731a901c9c 100644
--- a/spring-webflux/src/main/java/org/springframework/web/reactive/support/AbstractAnnotationConfigDispatcherHandlerInitializer.java
+++ b/spring-webflux/src/main/java/org/springframework/web/reactive/support/AbstractAnnotationConfigDispatcherHandlerInitializer.java
@@ -35,7 +35,6 @@ import org.springframework.util.ObjectUtils;
public abstract class AbstractAnnotationConfigDispatcherHandlerInitializer
extends AbstractDispatcherHandlerInitializer {
-
/**
* {@inheritDoc}
*
This implementation creates an {@link AnnotationConfigApplicationContext},
diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ReactiveTypeHandler.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ReactiveTypeHandler.java
index 0a6a2fd15c1..bd4ecd73f3d 100644
--- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ReactiveTypeHandler.java
+++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ReactiveTypeHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2017 the original author or authors.
+ * Copyright 2002-2018 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.
@@ -86,9 +86,7 @@ class ReactiveTypeHandler {
this(ReactiveAdapterRegistry.getSharedInstance(), new SyncTaskExecutor(), new ContentNegotiationManager());
}
- ReactiveTypeHandler(ReactiveAdapterRegistry registry, TaskExecutor executor,
- ContentNegotiationManager manager) {
-
+ ReactiveTypeHandler(ReactiveAdapterRegistry registry, TaskExecutor executor, ContentNegotiationManager manager) {
Assert.notNull(registry, "ReactiveAdapterRegistry is required");
Assert.notNull(executor, "TaskExecutor is required");
Assert.notNull(manager, "ContentNegotiationManager is required");
@@ -120,7 +118,7 @@ class ReactiveTypeHandler {
ReactiveAdapter adapter = this.reactiveRegistry.getAdapter(returnValue.getClass());
Assert.state(adapter != null, "Unexpected return value: " + returnValue);
- ResolvableType elementType = ResolvableType.forMethodParameter(returnType).getGeneric(0);
+ ResolvableType elementType = ResolvableType.forMethodParameter(returnType).getGeneric();
Class> elementClass = elementType.resolve(Object.class);
Collection mediaTypes = getMediaTypes(request);
@@ -249,7 +247,7 @@ class ReactiveTypeHandler {
schedule();
}
}
-
+
private void schedule() {
try {
this.taskExecutor.execute(this);
@@ -264,7 +262,7 @@ class ReactiveTypeHandler {
}
}
}
-
+
@Override
public void run() {
if (this.done) {
@@ -310,7 +308,7 @@ class ReactiveTypeHandler {
}
return;
}
-
+
if (this.executing.decrementAndGet() != 0) {
schedule();
}
@@ -324,7 +322,6 @@ class ReactiveTypeHandler {
this.subscription.cancel();
}
}
-
}
@@ -407,16 +404,12 @@ class ReactiveTypeHandler {
private final CollectedValuesList values;
-
- DeferredResultSubscriber(DeferredResult