Skip to content

Commit bb44c0e

Browse files
committed
Polishing
See gh-28386
1 parent 4bddbd3 commit bb44c0e

File tree

8 files changed

+11
-13
lines changed

8 files changed

+11
-13
lines changed

spring-web/src/main/java/org/springframework/web/service/annotation/GetRequest.java

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727

2828
/**
29+
* Shortcut for {@link HttpRequest} for HTTP GET requests.
2930
*
3031
* @author Rossen Stoyanchev
3132
* @since 6.0

spring-web/src/main/java/org/springframework/web/service/annotation/PostRequest.java

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.springframework.core.annotation.AliasFor;
2626

2727
/**
28+
* Shortcut for {@link HttpRequest} for HTTP POST requests.
2829
*
2930
* @author Rossen Stoyanchev
3031
* @since 6.0

spring-web/src/main/java/org/springframework/web/service/annotation/PutRequest.java

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.springframework.core.annotation.AliasFor;
2626

2727
/**
28+
* Shortcut for {@link HttpRequest} for HTTP PUT requests.
2829
*
2930
* @author Rossen Stoyanchev
3031
* @since 6.0

spring-web/src/main/java/org/springframework/web/service/invoker/HttpRequestDefinition.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
import org.springframework.core.MethodParameter;
3030
import org.springframework.core.ParameterizedTypeReference;
31-
import org.springframework.core.ResolvableType;
3231
import org.springframework.http.HttpHeaders;
3332
import org.springframework.http.HttpMethod;
3433
import org.springframework.http.HttpRequest;
@@ -56,7 +55,7 @@ public class HttpRequestDefinition {
5655

5756
@Nullable
5857
private URI uri;
59-
58+
6059
@Nullable
6160
private String uriTemplate;
6261

@@ -80,7 +79,7 @@ public class HttpRequestDefinition {
8079

8180
@Nullable
8281
private Publisher<?> bodyPublisher;
83-
82+
8483
@Nullable
8584
private ParameterizedTypeReference<?> bodyPublisherElementType;
8685

spring-web/src/main/java/org/springframework/web/service/invoker/HttpServiceProxyFactory.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
import org.aopalliance.intercept.MethodInterceptor;
2626
import org.aopalliance.intercept.MethodInvocation;
27-
import org.jetbrains.annotations.NotNull;
28-
import org.jetbrains.annotations.Nullable;
2927

3028
import org.springframework.aop.framework.ProxyFactory;
3129
import org.springframework.core.MethodIntrospector;
@@ -91,7 +89,7 @@ private HttpServiceMethod initServiceMethod(Method method, Class<?> serviceType)
9189

9290

9391
/**
94-
*
92+
* {@link MethodInterceptor} that invokes an {@link HttpServiceMethod}.
9593
*/
9694
private static final class HttpServiceMethodInterceptor implements MethodInterceptor {
9795

@@ -101,9 +99,8 @@ private HttpServiceMethodInterceptor(List<HttpServiceMethod> methods) {
10199
methods.forEach(serviceMethod -> this.serviceMethodMap.put(serviceMethod.getMethod(), serviceMethod));
102100
}
103101

104-
@Nullable
105102
@Override
106-
public Object invoke(@NotNull MethodInvocation invocation) throws Throwable {
103+
public Object invoke(MethodInvocation invocation) throws Throwable {
107104
Method method = invocation.getMethod();
108105
HttpServiceMethod httpServiceMethod = this.serviceMethodMap.get(method);
109106
return httpServiceMethod.invoke(invocation.getArguments());

spring-web/src/main/java/org/springframework/web/service/invoker/package-info.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
2-
*
2+
* Support to create a client proxy for an HTTP service annotated with
3+
* {@link org.springframework.web.service.annotation.HttpRequest} methods.
34
*/
45
@NonNullApi
56
@NonNullFields

spring-web/src/test/java/org/springframework/web/service/invoker/HttpMethodArgumentResolverTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ public class HttpMethodArgumentResolverTests {
3737

3838
private final Service service = this.clientAdapter.createService(Service.class, new HttpMethodArgumentResolver());
3939

40-
40+
4141
@Test
4242
void shouldResolveRequestMethodFromArgument() {
4343
this.service.execute(HttpMethod.GET);
4444
assertThat(getActualMethod()).isEqualTo(HttpMethod.GET);
4545
}
46-
46+
4747
@Test
4848
void shouldIgnoreArgumentsNotMatchingType() {
4949
this.service.execute("test");

spring-web/src/test/java/org/springframework/web/service/invoker/PathVariableArgumentResolverTests.java

-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.util.Map;
2020
import java.util.Optional;
2121

22-
import org.jetbrains.annotations.NotNull;
2322
import org.junit.jupiter.api.Test;
2423

2524
import org.springframework.core.convert.support.DefaultConversionService;
@@ -143,7 +142,6 @@ private void assertPathVariable(String name, @Nullable String expectedValue) {
143142
assertThat(getActualUriVariables().get(name)).isEqualTo(expectedValue);
144143
}
145144

146-
@NotNull
147145
private Map<String, String> getActualUriVariables() {
148146
return this.clientAdapter.getRequestDefinition().getUriVariables();
149147
}

0 commit comments

Comments
 (0)