- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.1k
 
          GH-10083: Migrate spring-integration-ws module to Jspecify
          #10098
        
          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
Conversation
…pecify Related to: spring-projects#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 <pyoungjy@gmail.com>
| 
           I found some packages don't have   | 
    
        
          
                ...ation-ws/src/main/java/org/springframework/integration/ws/dsl/BaseWsOutboundGatewaySpec.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                ...ation-ws/src/main/java/org/springframework/integration/ws/dsl/BaseWsOutboundGatewaySpec.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                ...s/src/main/java/org/springframework/integration/ws/dsl/MarshallingWsOutboundGatewaySpec.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      
          
 Right. Let's finish with the current change you have so far and then we will go from there for others. Thanks  | 
    
| 
           I've applied all the requested changes! 
 I'll add commits tomorrow for other packages in the   | 
    
          
 I know, but the easier way to proceed is to replace imports and leave as is. It is fine to continue in this PR. Thanks.  | 
    
        
          
                ...s/src/main/java/org/springframework/integration/ws/dsl/MarshallingWsOutboundGatewaySpec.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      * Add `@NullMarked` to all the `ws` packages
* Add `@Nullable` or `@SuppressWarnings("NullAway.Init")` whenever it is requested
* Add defensive null checks for better safety (`DefaultSoapHeaderMapper`, `SimpleWebServiceOutboundGateway`)
Signed-off-by: Jooyoung Pyoung <pyoungjy@gmail.com>
            
          
                ...n-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                ...ion-ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceOutboundGateway.java
          
            Show resolved
            Hide resolved
        
              
          
                ...s/src/main/java/org/springframework/integration/ws/MarshallingWebServiceOutboundGateway.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | 
           Hey @anthologia ! Any updates, please?  | 
    
* Add constructor overloads without messageFactory parameter * Clean up unnecessary @SuppressWarnings("NullAway") annotations Signed-off-by: Jooyoung Pyoung <pyoungjy@gmail.com>
| 
          
 Sorry for the delay ! I just pushed the updates 😊 I noticed something while working on this - the  Should the  What do you think?  | 
    
| 
           The logic there is like this: So, the contract enforces us to provide not-null if we chose that specific ctor. You may raise a GH issue in Spring WS if you still think that it is OK to have it nullable in the second ctor since the first one simply assumes that it really can be null.  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for an update.
Please, give me some feedback on those comments I have left.
As a fix or reject with respective arguments.
        
          
                ...n-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                ...s/src/main/java/org/springframework/integration/ws/MarshallingWebServiceOutboundGateway.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                ...s/src/main/java/org/springframework/integration/ws/MarshallingWebServiceOutboundGateway.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                ...s/src/main/java/org/springframework/integration/ws/MarshallingWebServiceOutboundGateway.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                ...s/src/main/java/org/springframework/integration/ws/MarshallingWebServiceOutboundGateway.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                ...ation-ws/src/main/java/org/springframework/integration/ws/dsl/BaseWsOutboundGatewaySpec.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                ...est/java/org/springframework/integration/ws/config/WebServiceOutboundGatewayParserTests.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      …ressions
* Use `@Nullable` `WebServiceMessageFactory` with conditional `webServiceTemplate` creation
* Mark `uri` and webServiceMessageFactory fields as `@Nullable`, keep template as final
* Remove all `@SuppressWarnings("NullAway")` annotations
* Remove unnecessary ctor overloads from previous approach
Signed-off-by: Jooyoung Pyoung <pyoungjy@gmail.com>
    | @@ -1,5 +1,5 @@ | |||
| /* | |||
| * Copyright 2002-2024 the original author or authors. | |||
| * Copyright 2002-2025 the original author or authors. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the first time.
So, after merging your PR, I'm going to apply our new -present style for Copyright.
That would make our life easier 😄
Related to: #10083
org.springframework.lang.Nullablewithorg.jspecify.annotations.Nullablepackage-info.javafiles to use@NullMarkedannotation@SuppressWarnings("NullAway.Init")for fields initialized in lifecycle methodsFor the array fields
BaseWsOutboundGatewaySpec.messageSendersandBaseWsOutboundGatewaySpec.gatewayInterceptors, I applied@SuppressWarnings("NullAway.Init")instead of@Nullablebecause adding@Nullablestill produces the same NullAway warnings.