Skip to content

Commit 84dac20

Browse files
committed
Fix compiler "deprecation" warnings
1 parent 4e53faf commit 84dac20

10 files changed

+28
-28
lines changed

spring-graphql/src/main/java/org/springframework/graphql/server/WebGraphQlRequest.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,17 @@ public class WebGraphQlRequest extends DefaultExecutionGraphQlRequest implements
7676
* @param locale the locale from the HTTP request, if any
7777
* @since 1.3.0
7878
*/
79-
public WebGraphQlRequest(URI uri, HttpHeaders headers, @Nullable MultiValueMap<String, HttpCookie> cookies,
80-
@Nullable InetSocketAddress remoteAddress, Map<String, Object> attributes,
81-
GraphQlRequest body, String id, @Nullable Locale locale) {
79+
public WebGraphQlRequest(
80+
URI uri, HttpHeaders headers, @Nullable MultiValueMap<String, HttpCookie> cookies,
81+
@Nullable InetSocketAddress remoteAddress, Map<String, Object> attributes,
82+
GraphQlRequest body, String id, @Nullable Locale locale) {
83+
8284
this(uri, headers, cookies, remoteAddress, attributes, body.getDocument(),
8385
body.getOperationName(), body.getVariables(), body.getExtensions(), id, locale);
8486
}
8587

8688
/**
87-
* Variant of {@link #WebGraphQlRequest(URI, HttpHeaders, MultiValueMap, Map, GraphQlRequest, String, Locale)}
88-
* with a Map for the request body.
89+
* Constructor variant with a Map for the request body.
8990
* @param uri the URL for the HTTP request or WebSocket handshake
9091
* @param headers the HTTP request headers
9192
* @param cookies the HTTP request cookies
@@ -127,8 +128,7 @@ public WebGraphQlRequest(
127128
}
128129

129130
/**
130-
* Variant of {@link #WebGraphQlRequest(URI, HttpHeaders, MultiValueMap, Map, GraphQlRequest, String, Locale)}
131-
* with a Map for the request body.
131+
* Create an instance.
132132
* @param uri the URL for the HTTP request or WebSocket handshake
133133
* @param headers the HTTP request headers
134134
* @param cookies the HTTP request cookies

spring-graphql/src/main/java/org/springframework/graphql/server/WebSocketGraphQlRequest.java

+13-13
Original file line numberDiff line numberDiff line change
@@ -46,44 +46,44 @@ public class WebSocketGraphQlRequest extends WebGraphQlRequest {
4646
* @param uri the URL for the HTTP request or WebSocket handshake
4747
* @param headers the HTTP request headers
4848
* @param cookies the HTTP request cookies
49+
* @param remoteAddress the client remote address
4950
* @param attributes session attributes
5051
* @param body the deserialized content of the GraphQL request
5152
* @param id the id from the GraphQL over WebSocket {@code "subscribe"} message
5253
* @param locale the locale from the HTTP request, if any
5354
* @param sessionInfo the WebSocket session id
54-
* @since 1.1.3
55-
* @deprecated in favor of {@link #WebSocketGraphQlRequest(URI, HttpHeaders, MultiValueMap, InetSocketAddress, Map, Map, String, Locale, WebSocketSessionInfo)}
55+
* @since 1.3.0
5656
*/
57-
@Deprecated(since = "1.3.0", forRemoval = true)
5857
public WebSocketGraphQlRequest(
5958
URI uri, HttpHeaders headers, @Nullable MultiValueMap<String, HttpCookie> cookies,
60-
Map<String, Object> attributes, Map<String, Object> body, String id, @Nullable Locale locale,
61-
WebSocketSessionInfo sessionInfo) {
59+
@Nullable InetSocketAddress remoteAddress, Map<String, Object> attributes, Map<String, Object> body,
60+
String id, @Nullable Locale locale, WebSocketSessionInfo sessionInfo) {
6261

63-
this(uri, headers, cookies, null, attributes, body, id, locale, sessionInfo);
62+
super(uri, headers, cookies, remoteAddress, attributes, body, id, locale);
63+
Assert.notNull(sessionInfo, "WebSocketSessionInfo is required");
64+
this.sessionInfo = sessionInfo;
6465
}
6566

6667
/**
6768
* Create an instance.
6869
* @param uri the URL for the HTTP request or WebSocket handshake
6970
* @param headers the HTTP request headers
7071
* @param cookies the HTTP request cookies
71-
* @param remoteAddress the client remote address
7272
* @param attributes session attributes
7373
* @param body the deserialized content of the GraphQL request
7474
* @param id the id from the GraphQL over WebSocket {@code "subscribe"} message
7575
* @param locale the locale from the HTTP request, if any
7676
* @param sessionInfo the WebSocket session id
77-
* @since 1.3.0
77+
* @since 1.1.3
78+
* @deprecated in favor of {@link #WebSocketGraphQlRequest(URI, HttpHeaders, MultiValueMap, InetSocketAddress, Map, Map, String, Locale, WebSocketSessionInfo)}
7879
*/
80+
@Deprecated(since = "1.3.0", forRemoval = true)
7981
public WebSocketGraphQlRequest(
8082
URI uri, HttpHeaders headers, @Nullable MultiValueMap<String, HttpCookie> cookies,
81-
@Nullable InetSocketAddress remoteAddress, Map<String, Object> attributes, Map<String, Object> body,
82-
String id, @Nullable Locale locale, WebSocketSessionInfo sessionInfo) {
83+
Map<String, Object> attributes, Map<String, Object> body, String id, @Nullable Locale locale,
84+
WebSocketSessionInfo sessionInfo) {
8385

84-
super(uri, headers, cookies, remoteAddress, attributes, body, id, locale);
85-
Assert.notNull(sessionInfo, "WebSocketSessionInfo is required");
86-
this.sessionInfo = sessionInfo;
86+
this(uri, headers, cookies, null, attributes, body, id, locale, sessionInfo);
8787
}
8888

8989

spring-graphql/src/test/java/org/springframework/graphql/data/query/QuerydslDataFetcherTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ private static RuntimeWiringConfigurer createRuntimeWiringConfigurer(
376376

377377
private WebGraphQlRequest request(String query) {
378378
return new WebGraphQlRequest(
379-
URI.create("/"), new HttpHeaders(), null, Collections.emptyMap(),
379+
URI.create("/"), new HttpHeaders(), null, null, Collections.emptyMap(),
380380
new DefaultGraphQlRequest(query), "1", Locale.ENGLISH);
381381
}
382382

spring-graphql/src/test/java/org/springframework/graphql/data/query/jpa/QueryByExampleDataFetcherJpaTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ private static RuntimeWiringConfigurer createRuntimeWiringConfigurer(QueryByExam
262262

263263
private WebGraphQlRequest request(String query) {
264264
return new WebGraphQlRequest(
265-
URI.create("/"), new HttpHeaders(), null, Collections.emptyMap(),
265+
URI.create("/"), new HttpHeaders(), null, null, Collections.emptyMap(),
266266
new DefaultGraphQlRequest(query), "1", null);
267267
}
268268

spring-graphql/src/test/java/org/springframework/graphql/data/query/mongo/QueryByExampleDataFetcherMongoDbTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ private static RuntimeWiringConfigurer createRuntimeWiringConfigurer(QueryByExam
240240

241241
private WebGraphQlRequest request(String query) {
242242
return new WebGraphQlRequest(
243-
URI.create("/"), new HttpHeaders(), null, Collections.emptyMap(),
243+
URI.create("/"), new HttpHeaders(), null, null, Collections.emptyMap(),
244244
new DefaultGraphQlRequest(query), "1", null);
245245
}
246246

spring-graphql/src/test/java/org/springframework/graphql/data/query/mongo/QueryByExampleDataFetcherReactiveMongoDbTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ private static RuntimeWiringConfigurer createRuntimeWiringConfigurer(ReactiveQue
213213

214214
private WebGraphQlRequest request(String query) {
215215
return new WebGraphQlRequest(
216-
URI.create("/"), new HttpHeaders(), null, Collections.emptyMap(),
216+
URI.create("/"), new HttpHeaders(), null, null, Collections.emptyMap(),
217217
new DefaultGraphQlRequest(query), "1", null);
218218
}
219219

spring-graphql/src/test/java/org/springframework/graphql/data/query/neo4j/QueryByExampleDataFetcherNeo4jTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ private static RuntimeWiringConfigurer createRuntimeWiringConfigurer(QueryByExam
242242

243243
private WebGraphQlRequest request(String query) {
244244
return new WebGraphQlRequest(
245-
URI.create("/"), new HttpHeaders(), null, Collections.emptyMap(),
245+
URI.create("/"), new HttpHeaders(), null, null, Collections.emptyMap(),
246246
new DefaultGraphQlRequest(query), "1", null);
247247
}
248248

spring-graphql/src/test/java/org/springframework/graphql/data/query/neo4j/QueryByExampleDataFetcherReactiveNeo4jDbTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ private static RuntimeWiringConfigurer createRuntimeWiringConfigurer(ReactiveQue
226226

227227
private WebGraphQlRequest request(String query) {
228228
return new WebGraphQlRequest(
229-
URI.create("/"), new HttpHeaders(), null, Collections.emptyMap(),
229+
URI.create("/"), new HttpHeaders(), null, null, Collections.emptyMap(),
230230
new DefaultGraphQlRequest(query), "1", null);
231231
}
232232

spring-graphql/src/test/java/org/springframework/graphql/server/WebGraphQlHandlerTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
public class WebGraphQlHandlerTests {
4747

4848
private static final WebGraphQlRequest webInput = new WebGraphQlRequest(
49-
URI.create("https://abc.org"), new HttpHeaders(), null, Collections.emptyMap(),
49+
URI.create("https://abc.org"), new HttpHeaders(), null, null, Collections.emptyMap(),
5050
new DefaultGraphQlRequest("{ greeting }"), "1", null);
5151

5252

spring-graphql/src/test/java/org/springframework/graphql/server/WebGraphQlInterceptorTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
public class WebGraphQlInterceptorTests {
4242

4343
private static final WebGraphQlRequest webRequest = new WebGraphQlRequest(
44-
URI.create("http://abc.org"), new HttpHeaders(), null, Collections.emptyMap(),
44+
URI.create("http://abc.org"), new HttpHeaders(), null, null, Collections.emptyMap(),
4545
new DefaultGraphQlRequest("{ notUsed }"), "1", null);
4646

4747
@Test

0 commit comments

Comments
 (0)