Skip to content

Commit 9c94058

Browse files
committed
GH-10083: Migrate spring-integration-ws module to Jspecify
Related to: #10083 - Replace `org.springframework.lang.Nullable` with `org.jspecify.annotations.Nullable` - Migrate `package-info.java` files to use `@NullMarked` annotation - Add `@SuppressWarnings("NullAway.Init")` for fields initialized in lifecycle methods Signed-off-by: Jooyoung Pyoung <[email protected]>
1 parent d63dd26 commit 9c94058

File tree

6 files changed

+29
-12
lines changed

6 files changed

+29
-12
lines changed

spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceOutboundGateway.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
import java.io.IOException;
2020

21-
import org.springframework.lang.Nullable;
21+
import org.jspecify.annotations.Nullable;
22+
2223
import org.springframework.messaging.Message;
2324
import org.springframework.oxm.Marshaller;
2425
import org.springframework.oxm.Unmarshaller;

spring-integration-ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceOutboundGateway.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,9 +25,9 @@
2525
import javax.xml.transform.dom.DOMResult;
2626
import javax.xml.transform.dom.DOMSource;
2727

28+
import org.jspecify.annotations.Nullable;
2829
import org.w3c.dom.Document;
2930

30-
import org.springframework.lang.Nullable;
3131
import org.springframework.messaging.Message;
3232
import org.springframework.messaging.MessagingException;
3333
import org.springframework.util.Assert;

spring-integration-ws/src/main/java/org/springframework/integration/ws/dsl/BaseWsOutboundGatewaySpec.java

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2021 the original author or authors.
2+
* Copyright 2020-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,12 +19,14 @@
1919
import java.util.HashMap;
2020
import java.util.Map;
2121

22+
import org.jspecify.annotations.Nullable;
23+
2224
import org.springframework.expression.Expression;
2325
import org.springframework.integration.JavaUtils;
2426
import org.springframework.integration.dsl.MessageHandlerSpec;
2527
import org.springframework.integration.ws.AbstractWebServiceOutboundGateway;
2628
import org.springframework.integration.ws.SoapHeaderMapper;
27-
import org.springframework.web.util.DefaultUriBuilderFactory;
29+
import org.springframework.web.util.DefaultUriBuilderFactory.EncodingMode;
2830
import org.springframework.ws.WebServiceMessageFactory;
2931
import org.springframework.ws.client.core.FaultMessageResolver;
3032
import org.springframework.ws.client.core.WebServiceMessageCallback;
@@ -51,26 +53,36 @@ public abstract class BaseWsOutboundGatewaySpec<
5153

5254
private final Map<String, Expression> uriVariableExpressions = new HashMap<>();
5355

56+
@Nullable
5457
protected WebServiceTemplate template; // NOSONAR
5558

59+
@Nullable
5660
protected DestinationProvider destinationProvider; // NOSONAR
5761

62+
@Nullable
5863
protected String uri; // NOSONAR
5964

65+
@Nullable
6066
protected WebServiceMessageFactory webServiceMessageFactory; // NOSONAR
6167

68+
@Nullable
6269
private SoapHeaderMapper headerMapper;
6370

64-
private DefaultUriBuilderFactory.EncodingMode encodingMode;
71+
@Nullable
72+
private EncodingMode encodingMode;
6573

6674
private boolean ignoreEmptyResponses = true;
6775

76+
@Nullable
6877
private WebServiceMessageCallback requestCallback;
6978

79+
@Nullable
7080
protected FaultMessageResolver faultMessageResolver; // NOSONAR
7181

82+
@SuppressWarnings("NullAway.Init")
7283
protected WebServiceMessageSender[] messageSenders; // NOSONAR
7384

85+
@SuppressWarnings("NullAway.Init")
7486
protected ClientInterceptor[] gatewayInterceptors; // NOSONAR
7587

7688
protected boolean extractPayload = true; // NOSONAR
@@ -117,11 +129,11 @@ public S uriVariableExpressions(Map<String, Expression> uriVariableExpressions)
117129
}
118130

119131
/**
120-
* Specify a {@link DefaultUriBuilderFactory.EncodingMode} for uri construction.
132+
* Specify a {@link EncodingMode} for uri construction.
121133
* @param encodingMode to use for uri construction.
122134
* @return the spec
123135
*/
124-
public S encodingMode(DefaultUriBuilderFactory.EncodingMode encodingMode) {
136+
public S encodingMode(EncodingMode encodingMode) {
125137
this.encodingMode = encodingMode;
126138
return _this();
127139
}

spring-integration-ws/src/main/java/org/springframework/integration/ws/dsl/MarshallingWsOutboundGatewaySpec.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2021 the original author or authors.
2+
* Copyright 2020-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -63,8 +63,10 @@ public static class MarshallingWsOutboundGatewayNoTemplateSpec
6363
extends BaseWsOutboundGatewaySpec<MarshallingWsOutboundGatewayNoTemplateSpec,
6464
MarshallingWebServiceOutboundGateway> {
6565

66+
@SuppressWarnings("NullAway.Init")
6667
protected Marshaller gatewayMarshaller; // NOSONAR
6768

69+
@SuppressWarnings("NullAway.Init")
6870
protected Unmarshaller gatewayUnmarshaller; // NOSONAR
6971

7072
/**

spring-integration-ws/src/main/java/org/springframework/integration/ws/dsl/SimpleWsOutboundGatewaySpec.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2024 the original author or authors.
2+
* Copyright 2020-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,9 +18,10 @@
1818

1919
import java.util.Arrays;
2020

21+
import org.jspecify.annotations.Nullable;
22+
2123
import org.springframework.integration.JavaUtils;
2224
import org.springframework.integration.ws.SimpleWebServiceOutboundGateway;
23-
import org.springframework.lang.Nullable;
2425
import org.springframework.ws.WebServiceMessageFactory;
2526
import org.springframework.ws.client.core.FaultMessageResolver;
2627
import org.springframework.ws.client.core.SourceExtractor;
@@ -100,6 +101,7 @@ protected SimpleWebServiceOutboundGateway create() {
100101
public static class SimpleWsOutboundGatewayNoTemplateSpec
101102
extends BaseWsOutboundGatewaySpec<SimpleWsOutboundGatewayNoTemplateSpec, SimpleWebServiceOutboundGateway> {
102103

104+
@Nullable
103105
protected SourceExtractor<?> sourceExtractor; // NOSONAR
104106

105107
private boolean extractPayload = true;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
22
* Contains classes for DSL support.
33
*/
4-
@org.springframework.lang.NonNullApi
4+
@org.jspecify.annotations.NullMarked
55
package org.springframework.integration.ws.dsl;

0 commit comments

Comments
 (0)